* { margin: 0; padding: 0; box-sizing: border-box; }
/* Horizontal-overflow containment — see wwwroot/index.html for the full rationale.
   Applied at html because iOS Safari treats html as the viewport; body-only clipping
   doesn't suffice. `overscroll-behavior-x: none` suppresses the iOS 16.4+ rubber-band
   bounce without cascading to descendants (so <pre>/tables keep horizontal scroll). */
html {
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior-x: none;
}
body {
    background: #0a0a0f;
    color: #b0b0c0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
a { color: #D6F08D; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: #12121a;
    border-bottom: 1px solid #1e1e2e;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Wrap the logo + nav onto two rows instead of forcing horizontal scroll on narrow
       phones. `gap: 12px` keeps both rows breathing when stacked. */
    flex-wrap: wrap;
    gap: 12px;
}
.topbar-logo { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.topbar-nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.topbar-nav a { color: #6b6b80; font-size: 14px; }
.topbar-nav a.active { color: #D6F08D; }
.topbar-nav .logout-btn {
    background: #1e1e2e;
    border: 1px solid #2e2e3e;
    color: #b0b0c0;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.topbar-nav .logout-btn:hover { background: #2e2e3e; color: #fff; }

/* Mobile overrides must come after the base rules above — same specificity means source
   order decides the winner, and an earlier revision put this media query first which let
   the non-media rules override it even on narrow viewports. */
@media (max-width: 480px) {
    .topbar { padding: 12px 16px; gap: 10px; }
    .topbar-nav { gap: 14px; }
    .topbar-nav a { font-size: 13px; }
    .topbar-nav .logout-btn { padding: 5px 10px; font-size: 12px; }
}

.container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
h1 { color: #fff; font-size: 24px; margin-bottom: 24px; }
h2 { color: #fff; font-size: 18px; margin-bottom: 16px; }

.card {
    background: #12121a;
    border: 1px solid #1e1e2e;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #0a0a0f;
    border: 1px solid #1e1e2e;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: #D6F08D; }
.stat-label { font-size: 13px; color: #6b6b80; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #6b6b80; font-size: 13px; font-weight: 500; padding: 10px 12px; border-bottom: 1px solid #1e1e2e; }
td { padding: 10px 12px; border-bottom: 1px solid #1e1e2e; font-size: 14px; }
tr:last-child td { border-bottom: none; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn-primary { background: #D6F08D; color: #0a0a0f; }
.btn-primary:hover { background: #e0f5a0; text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-outline { background: transparent; border: 1px solid #2e2e3e; color: #b0b0c0; }
.btn-outline:hover { background: #1e1e2e; color: #fff; text-decoration: none; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #6b6b80; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    background: #0a0a0f;
    border: 1px solid #1e1e2e;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: #D6F08D;
}
.form-group textarea { resize: vertical; min-height: 80px; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-active { background: #1a2e10; color: #D6F08D; }
.badge-expired { background: #2e1a1a; color: #ff6b6b; }
.badge-submitted { background: #1a2e10; color: #D6F08D; }
.badge-approved { background: #1a1a2e; color: #6b9bff; }

.empty { text-align: center; padding: 40px; color: #4a4a5a; }
.error-msg { color: #ff6b6b; }
.loading { color: #6b6b80; }

/* Login page */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 0 24px;
}
.login-card {
    background: #12121a;
    border: 1px solid #1e1e2e;
    border-radius: 16px;
    padding: 36px;
}
.divider {
    text-align: center;
    color: #4a4a5a;
    font-size: 13px;
    margin: 24px 0;
    position: relative;
}
.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #1e1e2e;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* Cookie consent banner - dark theme, shared with marketing pages. */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: #12121a;
    border-top: 1px solid #2a2a3a;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
    color: #e0e0f0;
    font-size: 14px;
    line-height: 1.5;
}
.cookie-banner__body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cookie-banner__text {
    margin: 0;
    /* flex-basis `auto` — lets the text size to its content. `320px` was interpreted as a
       320-pixel height when flex-direction flips to column on mobile, producing a huge
       empty banner. */
    flex: 1 1 auto;
    min-width: 0;
    color: #d0d0d8;
}
.cookie-banner__text a { color: #D6F08D; text-decoration: underline; }
.cookie-banner__text a:hover { color: #e0f5a0; }
.cookie-banner__actions { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-btn {
    border: 1px solid #2e2e3e;
    background: transparent;
    color: #d0d0d8;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.cookie-btn:focus { outline: 2px solid #D6F08D; outline-offset: 2px; }
.cookie-btn--decline:hover { background: #1e1e2e; color: #fff; border-color: #3e3e4e; }
.cookie-btn--accept {
    background: #D6F08D;
    color: #0a0a0f;
    border-color: #D6F08D;
}
.cookie-btn--accept:hover { background: #e0f5a0; border-color: #e0f5a0; transform: translateY(-1px); }

@media (max-width: 640px) {
    .cookie-banner { font-size: 13px; line-height: 1.45; }
    .cookie-banner__body {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 10px;
    }
    .cookie-banner__text { flex: 0 1 auto; }
    .cookie-banner__actions { justify-content: flex-end; gap: 8px; }
    .cookie-btn { padding: 8px 14px; font-size: 13px; }
}

/* Dashboard footer with legal links */
.dashboard-footer {
    max-width: 900px;
    margin: 24px auto 48px;
    padding: 16px 24px 0;
    border-top: 1px solid #1e1e2e;
    text-align: center;
    font-size: 13px;
    color: #4a4a5a;
}
.dashboard-footer a { color: #6b6b80; }
.dashboard-footer a:hover { color: #D6F08D; }
.dashboard-footer .sep { margin: 0 8px; color: #2e2e3e; }
