/* ============================================================
   ehouseseats.com — Main Stylesheet
   public/assets/css/main.css
   
   Design: clean, minimal, Claude-like.
   Accent: Forest green (#2D6A4F)
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Forest green palette */
    --green-900:  #1B4332;
    --green-800:  #2D6A4F;   /* primary accent */
    --green-700:  #40916C;
    --green-600:  #52B788;
    --green-100:  #D8F3DC;
    --green-50:   #F0FFF4;

    /* Neutrals */
    --gray-900:   #111827;
    --gray-700:   #374151;
    --gray-500:   #6B7280;
    --gray-300:   #D1D5DB;
    --gray-200:   #E5E7EB;
    --gray-100:   #F3F4F6;
    --gray-50:    #F9FAFB;
    --white:      #FFFFFF;

    /* Status colors */
    --red-600:    #DC2626;
    --red-50:     #FEF2F2;
    --amber-600:  #D97706;
    --amber-50:   #FFFBEB;
    --blue-600:   #2563EB;
    --blue-50:    #EFF6FF;

    /* Typography */
    --font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                  Helvetica, Arial, sans-serif;
    --font-mono:  'SF Mono', 'Fira Code', Consolas, monospace;

    /* Spacing */
    --radius-sm:  4px;
    --radius:     8px;
    --radius-lg:  12px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,.06);
    --shadow:     0 1px 4px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
    --shadow-lg:  0 4px 16px rgba(0,0,0,.12), 0 8px 32px rgba(0,0,0,.08);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--green-800);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
    color: var(--green-700);
}

/* ── Auth Pages (login, register, forgot password) ──────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: var(--gray-50);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-800);
    letter-spacing: -0.02em;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.auth-note {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    text-align: center;
}

/* ── App Shell ───────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.sidebar-logo .logo-text {
    font-size: 1.125rem;
}

.sidebar-section {
    padding: 0.5rem 0;
}

.sidebar-label {
    padding: 0.25rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-radius: 0;
    transition: background 0.1s, color 0.1s;
    text-decoration: none;
}

.sidebar-nav a:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.sidebar-nav a.active {
    background: var(--green-50);
    color: var(--green-800);
    font-weight: 500;
    border-right: 2px solid var(--green-800);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem 0;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.sidebar-user-name {
    font-weight: 500;
    color: var(--gray-700);
}

/* Main content area */
.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.page-body {
    padding: 2rem;
    max-width: 1200px;
}

/* Production switcher pill (for multi-production users) */
.production-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    color: var(--green-800);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
}
.production-badge:hover {
    background: var(--green-100);
    text-decoration: none;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 0.5625rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--gray-900);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.125rem;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--green-800);
    color: var(--white);
    border-color: var(--green-800);
}
.btn-primary:hover {
    background: var(--green-900);
    border-color: var(--green-900);
    color: var(--white);
    text-decoration: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.btn-danger {
    background: var(--red-600);
    color: var(--white);
    border-color: var(--red-600);
}
.btn-danger:hover {
    background: #b91c1c;
    text-decoration: none;
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-700);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--red-50);
    color: var(--red-600);
    border-color: #FECACA;
}

.alert-success {
    background: var(--green-50);
    color: var(--green-800);
    border-color: var(--green-100);
}

.alert-warning {
    background: var(--amber-50);
    color: var(--amber-600);
    border-color: #FDE68A;
}

.alert-info {
    background: var(--blue-50);
    color: var(--blue-600);
    border-color: #BFDBFE;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

th {
    text-align: left;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

td {
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr.clickable {
    cursor: pointer;
}

/* ── Status Badges ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.badge-pending   { background: var(--amber-50);  color: var(--amber-600); }
.badge-approved  { background: var(--green-50);  color: var(--green-800); }
.badge-charged   { background: var(--green-100); color: var(--green-900); }
.badge-denied    { background: var(--red-50);    color: var(--red-600);   }
.badge-cancelled { background: var(--gray-100);  color: var(--gray-500);  }
.badge-draft     { background: var(--blue-50);   color: var(--blue-600);  }
.badge-open      { background: var(--green-50);  color: var(--green-800); }
.badge-closed    { background: var(--gray-100);  color: var(--gray-500);  }
.badge-tony      { background: #EDE9FE;          color: #6D28D9;          }

/* ── Seat Grid (performance seat status view) ────────────────── */
.seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.seat-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    background: var(--white);
}

.seat-cell.assigned {
    background: var(--green-50);
    border-color: var(--green-100);
}

.seat-cell.released {
    background: var(--gray-100);
    border-color: var(--gray-200);
    opacity: 0.6;
}

.seat-cell.open {
    background: var(--white);
}

.seat-cell a {
    font-weight: 500;
    color: var(--green-800);
}

.seat-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.75rem;
    margin-right: 0.5rem;
    white-space: nowrap;
}

/* ── Utility ─────────────────────────────────────────────────── */
.link-subtle {
    font-size: 0.875rem;
    color: var(--gray-500);
}
.link-subtle:hover {
    color: var(--green-800);
}

.text-muted { color: var(--gray-500); }
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
.text-right { text-align: right; }
.text-center{ text-align: center; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex          { display: flex; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-gap      { display: flex; align-items: center; gap: 0.75rem; }
.flex-wrap     { flex-wrap: wrap; }

.divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 1.5rem 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* mobile nav to be added in a later phase */
    }
    .main-content {
        margin-left: 0;
    }
    .page-body {
        padding: 1rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ROLE-SPECIFIC THEMES
   Applied via <body class="theme-admin"> etc. in layout files.
   To change a sidebar color, update the background value below.
   Main content area intentionally stays neutral across all themes.
   ============================================================ */

/* ── Admin — Deep Navy ───────────────────────────────────────── */
.theme-admin .sidebar {
    background: #1e3a5f;
    border-right-color: #162d4a;
}
.theme-admin .sidebar-logo {
    border-bottom-color: rgba(255,255,255,.12);
}
.theme-admin .sidebar-logo .logo-text {
    color: #ffffff;
}
.theme-admin .sidebar-label {
    color: rgba(255,255,255,.5);
}
.theme-admin .sidebar-nav a {
    color: rgba(255,255,255,.8);
}
.theme-admin .sidebar-nav a:hover {
    background: rgba(255,255,255,.1);
    color: #ffffff;
}
.theme-admin .sidebar-nav a.active {
    background: rgba(255,255,255,.15);
    color: #ffffff;
    border-right-color: #ffffff;
}
.theme-admin .sidebar-footer {
    border-top-color: rgba(255,255,255,.12);
}
.theme-admin .sidebar-user-name {
    color: rgba(255,255,255,.9);
}
.theme-admin .sidebar-footer a,
.theme-admin .sidebar-footer button {
    color: rgba(255,255,255,.6) !important;
}
.theme-admin .sidebar-footer a:hover,
.theme-admin .sidebar-footer button:hover {
    color: #ffffff !important;
}
/* Badge on nav items */
.theme-admin .sidebar-nav span[style*="background:var(--amber"] {
    background: #f59e0b !important;
}

/* ── Production — Forest Green (brand color) ─────────────────── */
.theme-production .sidebar {
    background: #2D6A4F;
    border-right-color: #245a42;
}
.theme-production .sidebar-logo {
    border-bottom-color: rgba(255,255,255,.15);
}
.theme-production .sidebar-logo .logo-text {
    color: #ffffff;
}
.theme-production .sidebar-label {
    color: rgba(255,255,255,.55);
}
.theme-production .sidebar-nav a {
    color: rgba(255,255,255,.85);
}
.theme-production .sidebar-nav a:hover {
    background: rgba(255,255,255,.12);
    color: #ffffff;
}
.theme-production .sidebar-nav a.active {
    background: rgba(255,255,255,.18);
    color: #ffffff;
    border-right-color: #ffffff;
}
.theme-production .sidebar-footer {
    border-top-color: rgba(255,255,255,.15);
}
.theme-production .sidebar-user-name {
    color: rgba(255,255,255,.9);
}
.theme-production .sidebar-footer a,
.theme-production .sidebar-footer button {
    color: rgba(255,255,255,.6) !important;
}
.theme-production .sidebar-footer a:hover,
.theme-production .sidebar-footer button:hover {
    color: #ffffff !important;
}
/* Production badge (pending orders count) */
.theme-production .sidebar-nav span[style*="background:var(--green-800)"] {
    background: rgba(255,255,255,.25) !important;
    color: #ffffff !important;
}

/* ── Box Office — Deep Burgundy ──────────────────────────────── */
.theme-boxoffice .sidebar {
    background: #7B2D42;
    border-right-color: #692538;
}
.theme-boxoffice .sidebar-logo {
    border-bottom-color: rgba(255,255,255,.12);
}
.theme-boxoffice .sidebar-logo .logo-text {
    color: #ffffff;
}
.theme-boxoffice .sidebar-label {
    color: rgba(255,255,255,.5);
}
.theme-boxoffice .sidebar-nav a {
    color: rgba(255,255,255,.85);
}
.theme-boxoffice .sidebar-nav a:hover {
    background: rgba(255,255,255,.1);
    color: #ffffff;
}
.theme-boxoffice .sidebar-nav a.active {
    background: rgba(255,255,255,.15);
    color: #ffffff;
    border-right-color: #ffffff;
}
.theme-boxoffice .sidebar-footer {
    border-top-color: rgba(255,255,255,.12);
}
.theme-boxoffice .sidebar-user-name {
    color: rgba(255,255,255,.9);
}
.theme-boxoffice .sidebar-footer a,
.theme-boxoffice .sidebar-footer button {
    color: rgba(255,255,255,.6) !important;
}
.theme-boxoffice .sidebar-footer a:hover,
.theme-boxoffice .sidebar-footer button:hover {
    color: #ffffff !important;
}

/* ── Purchaser — Slate Blue ──────────────────────────────────── */
.theme-purchaser .sidebar {
    background: #2D4A7B;
    border-right-color: #253f6a;
}
.theme-purchaser .sidebar-logo {
    border-bottom-color: rgba(255,255,255,.12);
}
.theme-purchaser .sidebar-logo .logo-text {
    color: #ffffff;
}
.theme-purchaser .sidebar-label {
    color: rgba(255,255,255,.5);
}
.theme-purchaser .sidebar-nav a {
    color: rgba(255,255,255,.85);
}
.theme-purchaser .sidebar-nav a:hover {
    background: rgba(255,255,255,.1);
    color: #ffffff;
}
.theme-purchaser .sidebar-nav a.active {
    background: rgba(255,255,255,.15);
    color: #ffffff;
    border-right-color: #ffffff;
}
.theme-purchaser .sidebar-footer {
    border-top-color: rgba(255,255,255,.12);
}
.theme-purchaser .sidebar-user-name {
    color: rgba(255,255,255,.9);
}
.theme-purchaser .sidebar-footer a,
.theme-purchaser .sidebar-footer button {
    color: rgba(255,255,255,.6) !important;
}
.theme-purchaser .sidebar-footer a:hover,
.theme-purchaser .sidebar-footer button:hover {
    color: #ffffff !important;
}
/* Forward badge */
.theme-purchaser .sidebar-nav span[style*="background:var(--amber"] {
    background: #f59e0b !important;
}

/* ============================================================
   END ROLE THEMES
   ============================================================ */
