@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
    /* ── Equinox Media Brand Colors ── */
    --bg:           #0a1628;
    --bg2:          #0d1b2e;
    --bg3:          #112240;
    --surface:      #0f1e35;
    --surface2:     #152643;
    --border:       #1e3a5f;
    --border2:      #254d7a;

    /* Primary accent — cyan (from logo) */
    --accent:       #00c9d4;
    --accent2:      #00e5f0;
    --accent-dim:   rgba(0,201,212,0.12);
    --accent-glow:  rgba(0,201,212,0.28);

    /* Green (from logo) */
    --green:        #00e676;
    --green-dim:    rgba(0,230,118,0.12);

    /* Red */
    --red:          #f87171;
    --red-dim:      rgba(248,113,113,0.12);

    /* Yellow */
    --yellow:       #fbbf24;
    --yellow-dim:   rgba(251,191,36,0.12);

    /* Blue */
    --blue:         #38bdf8;
    --blue-dim:     rgba(56,189,248,0.12);

    /* Purple (from logo) */
    --purple:       #a855f7;
    --purple-dim:   rgba(168,85,247,0.12);

    /* Gradient for accents */
    --grad:         linear-gradient(135deg, #8b3fd9, #00c9d4, #00e676);
    --grad-text:    linear-gradient(135deg, #c084fc, #00c9d4, #00e676);

    --text:         #e2f0ff;
    --text2:        #7fa8cc;
    --text3:        #3d6080;
    --font-head:    'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --radius:       10px;
    --radius-lg:    16px;
    --shadow:       0 4px 24px rgba(0,0,0,0.5);
    --shadow-lg:    0 8px 48px rgba(0,0,0,0.7);
    --transition:   0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── LAYOUT ── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-logo {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-img {
    width: 120px;
    height: auto;
    display: block;
    margin-bottom: 4px;
}

.sidebar-logo .logo-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .brand {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sidebar-logo .sub {
    font-size: 0.7rem;
    color: var(--text3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text3);
    padding: 12px 24px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text2);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    color: var(--text);
    background: var(--accent-dim);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item.active .icon { opacity: 1; }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.user-info .name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

.user-info .role {
    font-size: 0.7rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text3);
    font-size: 0.8rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-dim);
}

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-body { padding: 32px; flex: 1; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0f;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border2);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-warning {
    background: var(--yellow-dim);
    color: var(--yellow);
    border-color: var(--yellow);
}
.btn-warning:hover { background: var(--yellow); color: #0a0a0f; }

.btn-success {
    background: var(--green-dim);
    color: var(--green);
    border-color: var(--green);
}
.btn-success:hover { background: var(--green); color: #0a0a0f; }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }
.btn-icon { padding: 8px; }

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.card-body { padding: 24px; }

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition);
}

.stat-card:hover { border-color: var(--border2); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}

.stat-card.gold::before   { background: var(--grad); }
.stat-card.green::before  { background: var(--green); }
.stat-card.red::before    { background: var(--red); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-value.gold   { color: var(--accent); }
.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.blue   { color: var(--blue); }
.stat-value.purple { color: var(--purple); }

.stat-sub {
    font-size: 0.75rem;
    color: var(--text3);
    margin-top: 4px;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

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

thead th {
    background: var(--bg3);
    padding: 11px 14px;
    text-align: left;
    font-family: var(--font-head);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:hover { background: var(--surface2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 12px 14px;
    color: var(--text);
    vertical-align: middle;
}

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-paid      { background: var(--green-dim);  color: var(--green); }
.badge-pending   { background: var(--yellow-dim); color: var(--yellow); }
.badge-cancelled { background: var(--red-dim);    color: var(--red); }
.badge-overdue   { background: var(--red-dim);    color: var(--red); border: 1px solid var(--red); }
.badge-rolled    { background: var(--blue-dim);   color: var(--blue); }

.badge-retainer  { background: var(--accent-dim); color: var(--accent); }
.badge-project   { background: var(--purple-dim); color: var(--purple); }
.badge-eon       { background: var(--blue-dim);   color: var(--blue); }
.badge-products  { background: var(--green-dim);  color: var(--green); }

.badge-mvr { background: var(--accent-dim); color: var(--accent); }
.badge-usd { background: var(--green-dim);  color: var(--green); }

/* ── FORMS ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text3);
}

input, select, textarea {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: border-color var(--transition);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder, textarea::placeholder { color: var(--text3); }
select option { background: var(--bg3); }

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

.form-hint {
    font-size: 0.73rem;
    color: var(--text3);
    margin-top: 2px;
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.modal-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover { border-color: var(--red); color: var(--red); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ── FILTERS ── */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.filters-bar select,
.filters-bar input {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

/* ── MONTH GRID ── */
.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.month-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.month-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.month-card-header {
    padding: 14px 18px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.month-card-name {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.month-card-body { padding: 16px 18px; }

.month-stat { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.month-stat-label { font-size: 0.78rem; color: var(--text3); }
.month-stat-value { font-size: 0.85rem; font-weight: 600; color: var(--text); }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.alert-error   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(248,113,113,0.3); }
.alert-warning { background: var(--yellow-dim);color: var(--yellow);border: 1px solid rgba(251,191,36,0.3); }
.alert-info    { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(96,165,250,0.3); }

/* ── LOGIN ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(168,85,247,0.15) 0%, transparent 60%);
    top: -250px; right: -200px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0,201,212,0.1) 0%, transparent 60%);
    bottom: -150px; left: -150px;
    pointer-events: none;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .logo-img {
    width: 140px;
    height: auto;
    margin: 0 auto 12px;
    display: block;
}

.login-brand .logo {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-brand .tagline {
    font-size: 0.75rem;
    color: var(--text3);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ── TABS ── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg3);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 8px 14px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text3);
    font-family: var(--font-body);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.tab.active {
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--border);
}

/* ── PROGRESS BAR ── */
.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ── MISC ── */
.text-muted { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text3);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

.section-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-body { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }

.stagger > * {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}
.stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger > *:nth-child(2)  { animation-delay: 0.1s;  }
.stagger > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger > *:nth-child(4)  { animation-delay: 0.2s;  }
.stagger > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger > *:nth-child(6)  { animation-delay: 0.3s;  }
.stagger > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger > *:nth-child(8)  { animation-delay: 0.4s;  }
.stagger > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s;  }
.stagger > *:nth-child(11) { animation-delay: 0.55s; }
.stagger > *:nth-child(12) { animation-delay: 0.6s;  }
