/*
Theme Name:  Sales Testing Theme
Theme URI:   https://example.com/sales-testing-theme
Description: Dark modern theme for the Sales Testing plugin. Dark sidebar layout with Inter Tight & Work Sans fonts.
Version:     1.0.0
Author:      Your Company
Author URI:  https://example.com
Text Domain: sales-testing-theme
License:     GPL-2.0+
Tags:        dark, modern, one-column, custom-logo

=============================================================================
  GLOBAL RESET & TOKENS
============================================================================= */

:root {
    --st-bg:              hsl(0 0% 3.9%);
    --st-fg:              hsl(0 0% 98%);
    --st-card:            hsl(0 0% 6%);
    --st-muted:           hsl(0 0% 14.9%);
    --st-muted-fg:        hsl(0 0% 63.9%);
    --st-border:          hsl(0 0% 14.9%);
    --st-primary:         hsl(142 76% 36%);
    --st-primary-fg:      hsl(355 100% 99%);
    --st-sidebar:         hsl(0 0% 5.5%);
    --st-sidebar-fg:      hsl(0 0% 95%);
    --st-sidebar-border:  hsl(0 0% 14.9%);
    --st-sidebar-accent:  hsl(0 0% 11.5%);
    --st-ring:            hsl(0 0% 83.1%);
    --st-destructive:     hsl(0 84.2% 60.2%);
    --st-radius:          0.5rem;
}

html[data-theme='light'] {
    --st-bg:              hsl(0 0% 99%);
    --st-fg:              hsl(0 0% 10%);
    --st-card:            hsl(0 0% 100%);
    --st-muted:           hsl(0 0% 94%);
    --st-muted-fg:        hsl(0 0% 45%);
    --st-border:          hsl(0 0% 86%);
    --st-sidebar:         hsl(0 0% 97%);
    --st-sidebar-fg:      hsl(0 0% 16%);
    --st-sidebar-border:  hsl(0 0% 87%);
    --st-sidebar-accent:  hsl(0 0% 92%);
    color-scheme: light;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark;
}

body {
    font-family: 'Inter Tight', 'Work Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--st-bg);
    color: var(--st-fg);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--st-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: hsl(142 76% 50%);
}

img {
    max-width: 100%;
    height: auto;
}

/* =============================================================================
   TYPOGRAPHY
============================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--st-fg);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    color: var(--st-muted-fg);
    margin-bottom: 1rem;
}

strong { color: var(--st-fg); }

code, pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: var(--st-muted);
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    color: var(--st-fg);
}

pre {
    padding: 1rem;
    overflow-x: auto;
    border-radius: var(--st-radius);
}

/* =============================================================================
   LAYOUT
============================================================================= */

.st-site-wrapper {
    display: flex;
    min-height: 100vh;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Sidebar */
.st-sidebar {
    width: 16rem;
    min-width: 16rem;
    background: var(--st-sidebar);
    border-right: 1px solid var(--st-sidebar-border);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.st-sidebar-brand {
    padding: 1rem;
    border-bottom: 1px solid var(--st-sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.st-sidebar-icon {
    width: 2rem;
    height: 2rem;
    background: var(--st-primary);
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--st-primary-fg);
}

.st-sidebar-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--st-sidebar-fg);
    line-height: 1.2;
}

.st-sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--st-muted-fg);
}

.st-sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-nav-group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--st-muted-fg);
    padding: 0.4rem 0.6rem 0.2rem;
    font-weight: 600;
}

.st-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    color: var(--st-sidebar-fg);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.st-nav-link:hover,
.st-nav-link.active {
    background: var(--st-sidebar-accent);
    color: var(--st-fg);
}

.st-nav-link.active {
    font-weight: 600;
}

/* Main content area */
.st-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* Topbar */
.st-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 3.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: var(--st-bg);
    border-bottom: 1px solid var(--st-border);
}

/* Page content */
.st-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

@media (max-width: 768px) {
    .st-sidebar {
        position: fixed;
        top: 0;
        left: -18rem;
        bottom: 0;
        width: min(86vw, 18rem);
        min-width: 0;
        z-index: 70;
        transition: left 0.2s ease;
        box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35);
    }

    body.st-sidebar-open .st-sidebar {
        left: 0;
    }

    body.st-sidebar-open {
        overflow: hidden;
    }
}

.st-page-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* =============================================================================
   CARDS
============================================================================= */

.st-card {
    background: var(--st-card);
    border: 1px solid var(--st-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.st-card-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--st-border);
}

.st-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--st-fg);
}

.st-card-desc {
    font-size: 0.875rem;
    color: var(--st-muted-fg);
    margin-top: 0.25rem;
}

/* =============================================================================
   BUTTONS
============================================================================= */

.st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.st-btn-primary {
    background: var(--st-primary);
    color: var(--st-primary-fg);
}

.st-btn-primary:hover {
    background: hsl(142 76% 30%);
    color: var(--st-primary-fg);
}

.st-btn-secondary {
    background: var(--st-muted);
    color: var(--st-fg);
    border: 1px solid var(--st-border);
}

.st-btn-secondary:hover {
    background: var(--st-sidebar-accent);
    color: var(--st-fg);
}

.st-btn-danger {
    background: hsl(0 84% 12%/0.5);
    color: hsl(0 84% 70%);
    border: 1px solid hsl(0 84% 40%/0.3);
}

.st-btn-danger:hover {
    background: hsl(0 84% 18%/0.6);
}

/* =============================================================================
   TABLES
============================================================================= */

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.st-table thead tr {
    border-bottom: 1px solid var(--st-border);
}

.st-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    color: var(--st-muted-fg);
    white-space: nowrap;
}

.st-table tbody tr {
    border-bottom: 1px solid var(--st-border);
    transition: background 0.15s;
}

.st-table tbody tr:hover {
    background: hsl(0 0% 100%/0.03);
}

.st-table tbody td {
    padding: 0.75rem 1rem;
    color: var(--st-muted-fg);
}

.st-table tbody td:first-child {
    color: var(--st-fg);
    font-weight: 500;
}

/* =============================================================================
   BADGES
============================================================================= */

.st-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.st-badge-green {
    background: hsl(142 76% 10%/0.6);
    border: 1px solid hsl(142 76% 30%/0.4);
    color: #4ade80;
}

.st-badge-yellow {
    background: hsl(48 96% 10%/0.6);
    border: 1px solid hsl(48 96% 40%/0.4);
    color: #facc15;
}

.st-badge-red {
    background: hsl(0 84% 10%/0.5);
    border: 1px solid hsl(0 84% 40%/0.4);
    color: #f87171;
}

.st-badge-muted {
    background: var(--st-muted);
    color: var(--st-muted-fg);
}

/* =============================================================================
   FORMS
============================================================================= */

.st-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--st-muted);
    border: 1px solid var(--st-border);
    border-radius: 0.375rem;
    color: var(--st-fg);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.st-input:focus {
    border-color: var(--st-ring);
    box-shadow: 0 0 0 2px hsl(0 0% 83%/0.2);
}

.st-input::placeholder {
    color: var(--st-muted-fg);
}

label.st-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--st-fg);
    margin-bottom: 0.35rem;
}

/* =============================================================================
   ALERTS & NOTICES
============================================================================= */

.st-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.st-alert-success {
    background: hsl(142 76% 10%/0.4);
    border: 1px solid hsl(142 76% 30%/0.4);
    color: #4ade80;
}

.st-alert-error {
    background: hsl(0 84% 10%/0.4);
    border: 1px solid hsl(0 84% 40%/0.4);
    color: #f87171;
}

/* =============================================================================
   PAGINATION
============================================================================= */

.st-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.st-pagination a,
.st-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}

.st-pagination a {
    background: var(--st-card);
    border: 1px solid var(--st-border);
    color: var(--st-fg);
}

.st-pagination a:hover {
    background: var(--st-muted);
}

.st-pagination span.current {
    background: var(--st-primary);
    color: var(--st-primary-fg);
}

/* =============================================================================
   WORDPRESS CORE OVERRIDES (keep WP blocks usable)
============================================================================= */

.wp-block-image {
    margin: 1.5rem 0;
}

.wp-block-quote {
    border-left: 3px solid var(--st-primary);
    padding-left: 1rem;
    color: var(--st-muted-fg);
    font-style: italic;
    margin: 1.5rem 0;
}

/* =============================================================================
   RESPONSIVE
============================================================================= */

@media (max-width: 768px) {
    .st-content {
        padding: 1rem;
    }
}
