/* ------------------------------
   THEME VARIABLES
------------------------------ */

:root {
    /* Brand colours */
    --brand-primary: #2563eb;
    --brand-primary-soft: #dbeafe;
    --brand-accent: #16a34a;

    /* Global backgrounds */
    /* Light: softer grey gradient instead of bright white */
    --page-bg-light: radial-gradient(circle at top left, #e5e7eb 0, transparent 55%),
        radial-gradient(circle at bottom right, #e5e7eb 0, transparent 55%),
        #f3f4f6;

    /* Dark: slightly lighter slate instead of near-black */
    --page-bg-dark: radial-gradient(circle at top left, #0b1120 0, transparent 55%),
        radial-gradient(circle at bottom right, #020617 0, transparent 55%),
        #020617;

    --text-main-light: #111827;
    --text-main-dark: #e5e7eb;

    /* Cards: less pure white, less pure black */
    --card-bg-light: rgba(248, 250, 252, 0.95);
    /* slate-50 / zinc-50 mix */
    --card-bg-dark: rgba(15, 23, 42, 0.94);
    /* slate-900 with a bit of opacity */

    --border-subtle-light: rgba(148, 163, 184, 0.4);
    --border-subtle-dark: rgba(30, 64, 175, 0.7);
}

/* ------------------------------
   GLOBAL BASE
------------------------------ */

body {
    background: var(--page-bg-light);
    color: var(--text-main-light);
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Theme attribute (light/dark) */
body[data-theme="light"] {
    background: var(--page-bg-light);
    color: var(--text-main-light);
}

body[data-theme="dark"] {
    background: var(--page-bg-dark);
    color: var(--text-main-dark);
}


/* Main content wrapper: keeps everything in a nice column */
.content-wrapper {
    padding-top: 96px;
    /* space for fixed nav */
    padding-bottom: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding-top: 80px;
        padding-inline: 1rem;
    }
}

/* ------------------------------
   NAVIGATION
------------------------------ */

.top-nav {
    backdrop-filter: blur(16px);
    background: rgba(248, 250, 252, 0.9);
    /* softer than pure white */
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.nav-link-item {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.18s ease;
}

.nav-link-item:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #111827;
    transform: translateY(-1px);
}

.nav-link-item.active {
    background: var(--brand-primary-soft);
    color: #1d4ed8;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.nav-user-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.nav-logout {
    border-radius: 999px;
    border: 1px solid #fecaca;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #b91c1c;
    background: linear-gradient(to right, #fee2e2, #fff);
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(248, 113, 113, 0.18);
    transition: all 0.18s ease;
}

.nav-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(248, 113, 113, 0.32);
}

/* Dark nav tweaks */
body[data-theme="dark"] .top-nav {
    background: rgba(15, 23, 42, 0.9);
    /* a touch lighter */
    border-bottom-color: var(--border-subtle-dark);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.85);
}

body[data-theme="dark"] .nav-link-item {
    color: #cbd5f5;
}

body[data-theme="dark"] .nav-link-item:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #ffffff;
}

/* Better active pill in the Accounts sidebar for dark mode */
body[data-theme="dark"] .app-sidebar-card .nav-link-item.active {
    background: linear-gradient(to right, #1d4ed8, #2563eb);
    color: #f9fafb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

/* Form helper text in dark mode (e.g. 'Example: superadmin, accounts') */
body[data-theme="dark"] .form-text {
    color: #9ca3af;
}

/* Admin roles table inside glass card – dark mode polish */
body[data-theme="dark"] .app-glass-card .table {
    background-color: transparent;
    color: #e5e7eb;
}

body[data-theme="dark"] .app-glass-card .table thead th {
    background-color: #020617;
    border-bottom-color: rgba(148, 163, 184, 0.4);
}

body[data-theme="dark"] .app-glass-card .table tbody tr {
    background-color: #020617;
}

body[data-theme="dark"] .app-glass-card .table tbody tr:nth-child(even) {
    background-color: #020617;
}

body[data-theme="dark"] .app-glass-card .table td,
body[data-theme="dark"] .app-glass-card .table th {
    border-color: rgba(31, 41, 55, 0.8);
}

/* Slightly nicer role badges in dark mode */
body[data-theme="dark"] .badge.bg-secondary {
    background-color: #4b5563 !important;
    color: #e5e7eb !important;
}

/* Admin roles table – remove the white slab in dark mode */
body[data-theme="dark"] .app-glass-card .table> :not(caption)>*>* {
    background-color: #020617;
    /* match page background */
    border-color: rgba(31, 41, 55, 0.8);
    /* subtle row separators */
    color: #e5e7eb;
}

/* Keep header aligned with the rest of the card */
body[data-theme="dark"] .app-glass-card .table thead th {
    background-color: #020617;
    border-bottom-color: rgba(148, 163, 184, 0.4);
}

/* Admin roles table – blend table into glass card in LIGHT mode */
body[data-theme="light"] .app-glass-card .table> :not(caption)>*>* {
    background-color: var(--card-bg-light);
    border-color: rgba(209, 213, 219, 0.8);
    /* subtle row separators */
    color: var(--text-main-light);
}

/* Slightly distinct header row, but still matching the card */
body[data-theme="light"] .app-glass-card .table thead th {
    background-color: rgba(243, 244, 246, 0.9);
    border-bottom-color: rgba(209, 213, 219, 0.9);
}




/* ------------------------------
   CARDS / PANELS
------------------------------ */

.app-glass-card {
    border-radius: 18px;
    background: var(--card-bg-light);
    backdrop-filter: blur(18px);
    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(148, 163, 184, 0.18);
}

.app-sidebar-card {
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(16px);
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.05),
        0 0 0 1px rgba(148, 163, 184, 0.18);
}

/* Dark generic cards */
body[data-theme="dark"] .card {
    background-color: rgba(15, 23, 42, 0.94);
    /* use the softer dark card */
    color: var(--text-main-dark);
    border-color: rgba(30, 64, 175, 0.55);
}

/* ------------------------------
   FLASH MESSAGES
------------------------------ */

.flash-box {
    animation: fadeIn 0.35s ease-out;
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 14px 18px;
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Home hero: roles line --- */

.homeHero-roles {
    color: #6b7280;
    /* muted grey in light mode */
}

/* Little role pills: subtle, high contrast on both themes */
.userRole-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    margin-left: 0.25rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(249, 250, 251, 0.95);
    /* light but distinct from card */
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* Dark mode variants */
body[data-theme="dark"] .homeHero-roles {
    color: #9ca3af;
    /* your usual muted grey */
}

body[data-theme="dark"] .userRole-pill {
    border-color: rgba(148, 163, 184, 0.9);
    background: rgba(15, 23, 42, 0.9);
    /* slightly lighter than card bg */
    color: #e5e7eb;
}

/* ------------------------------
   HOME HERO (PORTAL) CARD
------------------------------ */

/* Light defaults */
.homeHero-card {
    background: rgba(255, 255, 255, 0.7);
    color: #111827;
}

.homeHero-title {
    color: #111827;
}

.homeHero-subtitle {
    color: #6b7280;
}

.homeHero-cta {
    /* button already uses Bootstrap primary; keep as-is for now */
}

.homeFeature-card {
    background: #f9fafb;
    color: #111827;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.homeFeature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.homeFeature-label {
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.homeFeature-title {
    /* inherit colour */
}

.homeFeature-text {
    color: #6b7280;
}

.homeFeature-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    /* tweak to match your theme */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Dark mode variants */
body[data-theme="dark"] .homeHero-card,
body[data-theme="dark"] .homeWelcome-card,
body[data-theme="dark"] .errorCard {
    background: rgba(15, 23, 42, 0.94) !important;
    /* slightly lighter + softer */
    border-color: #1f2937;
}

body[data-theme="dark"] .homeFeature-icon {
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

body[data-theme="dark"] .homeHero-title {
    color: #e5e7eb;
}

body[data-theme="dark"] .homeHero-subtitle {
    color: #9ca3af;
}

body[data-theme="dark"] .homeFeature-card {
    background: #020617 !important;
    border-color: #1f2937;
    color: #e5e7eb;
}

body[data-theme="dark"] .homeFeature-label {
    color: #9ca3af;
}

body[data-theme="dark"] .homeFeature-text {
    color: #9ca3af;
}

/* ------------------------------
   VERTEX CHAT (AI ASSISTANT)
------------------------------ */

.aiChat-shell {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.aiChat-header {
    padding: 18px 24px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.aiChat-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #111827;
}

.aiChat-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

.aiChat-userTag {
    font-size: 0.85rem;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f9fafb;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
}

.aiChat-userDot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.aiChat-body {
    padding: 16px 20px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aiChat-messages {
    background: #f9fafb;
    border-radius: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    flex: 1;
    min-height: 260px;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 14px;
}

.aiChat-message {
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
    max-width: 80%;
}

.aiChat-message.ai {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.aiChat-message.user {
    margin-left: auto;
    background: #2563eb;
    color: #ffffff;
}

.aiChat-message-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    opacity: 0.7;
}

/* Markdown body inside assistant replies */
.aiChat-message-body p {
    margin-bottom: 0.4rem;
}

.aiChat-message-body ul,
.aiChat-message-body ol {
    margin-bottom: 0.4rem;
    padding-left: 1.1rem;
}

.aiChat-message-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    background: #e5e7eb;
    padding: 1px 4px;
    border-radius: 4px;
}

.aiChat-message-body pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    background: #020617;
    color: #e5e7eb;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 0.6rem;
}

/* Chat input & button */
.aiChat-inputRow {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
}

.aiChat-inputRow input[type="text"],
.aiChat-inputRow textarea {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 10px 16px;
    outline: none;
    font-size: 0.9rem;
    resize: none;
}

.aiChat-inputRow input[type="text"]:focus,
.aiChat-inputRow textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.aiChat-sendBtn {
    border-radius: 999px;
    padding: 9px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.aiChat-sendBtn:hover {
    transform: translateY(-1px);
    background: #1d4ed8;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.6);
}

.aiChat-sendBtn:disabled {
    opacity: 0.6;
    box-shadow: none;
    cursor: default;
}

/* Typing indicator */
.aiChat-typing {
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 4px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.aiChat-typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #9ca3af;
    animation: aiDot 0.6s infinite ease-in-out;
}

.aiChat-typing-dot:nth-child(2) {
    animation-delay: 0.1s;
}

.aiChat-typing-dot:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes aiDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* Dark mode for chat */
body[data-theme="dark"] .aiChat-shell {
    background: var(--card-bg-dark);
    color: var(--text-main-dark);
}

body[data-theme="dark"] .aiChat-messages {
    background: #0b1120;
    /* was #020617 */
    border-color: #1e293b;
}

body[data-theme="dark"] .aiChat-message.ai {
    background: #020617;
    border-color: #1e293b;
    color: #e5e7eb;
}

body[data-theme="dark"] .aiChat-message.user {
    background: #2563eb;
    color: #ffffff;
}

body[data-theme="dark"] .aiChat-inputRow input[type="text"] {
    background-color: #0b1120;
    /* was #020617 */
    border-color: #1e293b;
    color: #e5e7eb;
}

body[data-theme="dark"] .aiChat-inputRow input[type="text"]::placeholder {
    color: #64748b;
}

body[data-theme="dark"] .nav-user {
    color: #cbd5f5;
}

/* Dark mode header + user tag */
body[data-theme="dark"] .aiChat-title {
    color: #e5e7eb;
}

body[data-theme="dark"] .aiChat-subtitle {
    color: #9ca3af;
}

body[data-theme="dark"] .aiChat-userTag {
    background: #020617;
    border-color: #1e293b;
    color: #e5e7eb;
}

body[data-theme="dark"] .aiChat-userDot {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35);
}

/* ------------------------------
   ERROR PAGES
------------------------------ */

/* Light mode */
.errorCard {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    color: #111827;
}

/* Make sure headings look right in light mode */
.errorCard .text-dark {
    color: #111827 !important;
}

/* Softer muted text in dark mode */
body[data-theme="dark"] .errorCard .text-muted,
body[data-theme="dark"] .errorCard .small.text-muted {
    color: #9ca3af !important;
}

/* Override any text-dark inside errors to be light in dark mode */
body[data-theme="dark"] .errorCard .text-dark {
    color: #e5e7eb !important;
}

/* Logged-out welcome card */
.homeWelcome-card {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    color: #111827;
}

.homeWelcome-title {
    color: #111827;
}

.homeWelcome-subtitle {
    color: #6b7280;
}

.homeWelcome-list {
    color: #6b7280;
    padding-left: 1.25rem;
}

body[data-theme="dark"] .homeWelcome-title {
    color: #e5e7eb;
}

body[data-theme="dark"] .homeWelcome-subtitle,
body[data-theme="dark"] .homeWelcome-list {
    color: #9ca3af;
}

/* Billing Reports / app-glass-card dark-mode tweaks */
body[data-theme="dark"] .app-glass-card {
    background: #020617;
    /* deep slate */
    border-color: #1f2937;
    color: #e5e7eb;
}

/* Heading + hero text inside the card */
body[data-theme="dark"] .app-glass-card .text-dark,
body[data-theme="dark"] .app-glass-card h1,
body[data-theme="dark"] .app-glass-card h2 {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .app-glass-card .text-muted {
    color: #9ca3af !important;
}

/* Checkbox labels */
body[data-theme="dark"] .app-glass-card .form-check-label {
    color: #e5e7eb;
}

/* Checkboxes themselves – subtle dark styling */
body[data-theme="dark"] .app-glass-card .form-check-input {
    background-color: transparent;
    border-color: #64748b;
}

body[data-theme="dark"] .app-glass-card .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

body[data-theme="dark"] .app-sidebar-card {
    background: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
}

body[data-theme="dark"] .app-sidebar-card .text-muted {
    color: #9ca3af !important;
}

/* Brand logo in nav */
.nav-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo-img {
    height: 50px;
    display: block;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Light mode: invert white logo so it appears dark */
body[data-theme="light"] .nav-logo-img {
    filter: invert(1);
}

/* Dark mode: show original white logo */
body[data-theme="dark"] .nav-logo-img {
    filter: none;
}


/* Responsive tweaks */
@media (max-width: 768px) {
    .aiChat-shell {
        border-radius: 18px;
        min-height: 420px;
    }

    .aiChat-messages {
        max-height: 50vh;
    }
}


/* ==========================================================
   VALIDATOR DASHBOARD (DJB Authenticator)
   Clean, modern, matches your dark/light theme
   ---------------------------------------------------------- */

/* ==========================================================
   VALIDATOR DASHBOARD — POLISHED UI + DARK MODE FIXES
   ========================================================== */

/* Main wrapper that contains both panels */
/* Make the validator card bigger */
.validator-wrapper {
    max-width: 900px;
    /* wider card */
    padding: 36px 40px;
    /* more inner space */
    margin-top: 20px;
    /* some breathing room below nav */
}

/* Make left/right panels slightly larger */
.validator-panel {
    padding: 26px 26px;
    /* more content padding */
    min-height: 340px;
    /* gives more vertical presence */
}

/* Make code display bigger */
#code {
    font-size: 3.2rem;
    /* larger OTP display */
    padding: 20px 18px;
}

/* Increase spacing between title + panels */
.validator-subtitle {
    margin-bottom: 28px;
}

body[data-theme="dark"] .validator-wrapper {
    background: var(--card-bg-dark);
    border-color: rgba(30, 64, 175, 0.5);
}

/* Title above panels */
.validator-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main-light);
}

body[data-theme="dark"] .validator-title {
    color: var(--text-main-dark);
}

/* Subtitle */
.validator-subtitle {
    color: #6b7280;
    margin-bottom: 22px;
}

body[data-theme="dark"] .validator-subtitle {
    color: #9ca3af;
}

/* ===========================
   PANEL (Left or Right)
   =========================== */
.validator-panel {
    background: rgba(255, 255, 255, 0.55);
    padding: 22px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.75);
    height: 100%;
}

body[data-theme="dark"] .validator-panel {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(30, 41, 59, 0.8);
}

/* Headings inside panels */
.validator-label {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
    color: #374151;
}

body[data-theme="dark"] .validator-label {
    color: #e5e7eb;
}

/* ===========================
   Code Display
   =========================== */

#code {
    font-size: 2.8rem;
    letter-spacing: 0.14em;
    text-align: center;
    padding: 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #111827;
    user-select: none;
    margin-bottom: 10px;
}

body[data-theme="dark"] #code {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

#remaining {
    font-size: 0.85rem;
    color: #6b7280;
}

body[data-theme="dark"] #remaining {
    color: #9ca3af;
}

/* ===========================
   Buttons
   =========================== */

.authCode-button,
.authVerify-button {
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Improve button contrast in dark mode */
body[data-theme="dark"] .authCode-button {
    background: #3b82f6 !important;
    border-color: transparent !important;
}

body[data-theme="dark"] .authVerify-button {
    background: #1e40af !important;
    color: white !important;
    border-color: #3b82f6 !important;
}

/* ===========================
   Inputs
   =========================== */

.validator-input {
    border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
}

body[data-theme="dark"] .validator-input {
    background: #0b1120;
    border-color: #334155;
    color: #e5e7eb;
}

.validator-input::placeholder {
    color: #9ca3af;
}

/* ===========================
   Autocomplete Suggestions
   =========================== */

.authSuggestions {
    margin-top: 6px;
}

.suggestion-item {
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.suggestion-item:hover {
    background: var(--brand-primary-soft);
    transform: translateX(2px);
}

body[data-theme="dark"] .suggestion-item {
    background: #0b1120;
    border-color: #1e293b;
    color: #e5e7eb;
}

body[data-theme="dark"] .suggestion-item:hover {
    background: rgba(59, 130, 246, 0.35);
}

/* ===========================
   Verify Result Bubble
   =========================== */

#verifyResult {
    padding: 10px 14px;
    border-radius: 10px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}

#verifyResult.ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

#verifyResult.err {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

body[data-theme="dark"] #verifyResult.ok {
    background: rgba(22, 163, 74, 0.25);
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.35);
}

body[data-theme="dark"] #verifyResult.err {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
    border-color: rgba(252, 165, 165, 0.35);
}

/* ------------------------------
   PWA COMPACT MODE
   (for small screens / mobile apps)
   */

body.pwa-compact .top-nav {
    display: none !important;
}

body.pwa-compact {
    background: var(--card-bg);
}

body.pwa-compact .homeHero-card {
    box-shadow: none;
    border-radius: 0;
    padding: 1rem;
}


/* ──────────────────────────────
   Top nav – shared
──────────────────────────────── */

.nav-toggle-btn {
    border: 1px solid rgba(148, 163, 184, 0.7);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.9rem;
    background: rgba(248, 250, 252, 0.9);
    cursor: pointer;
    line-height: 1;
}

body[data-theme="dark"] .nav-toggle-btn {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}


.time-calendar-grid {
    display: grid;
    /* Auto-fit rows, minimum width so it doesn’t squash to toothpicks */
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.time-calendar-day {
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.03);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 7rem;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.1s ease;
}

.time-calendar-day:hover {
    border-color: rgba(148, 163, 184, 0.9);
    background: rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.time-calendar-day-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Make the hours badge a bit more of a “main character” */
.time-calendar-day .badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding-block: 0.15rem;
    padding-inline: 0.6rem;
}

.time-calendar-day-body {
    min-height: 3.2rem;
    margin-top: 0.25rem;
}

.time-entry-card {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(12px);
}

.bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.18) !important;
}


@media (max-width: 992px) {
    .time-calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .time-calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* desktop default */
@media (min-width: 769px) {
    .nav-main {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
}

/* ──────────────────────────────
   Mobile nav behaviour
──────────────────────────────── */

@media (max-width: 768px) {

    /* Shrink the top bar a bit */
    .top-nav {
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    /* Logo + hamburger row */
    .top-nav .container-fluid>.d-flex {
        align-items: center;
    }

    /* Hide nav by default */
    .nav-main {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 0.35rem;
        border-top: 1px solid rgba(148, 163, 184, 0.25);
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        background: rgba(248, 250, 252, 0.96);
        border-radius: 0 0 16px 16px;
    }

    body[data-theme="dark"] .nav-main {
        background: rgba(15, 23, 42, 0.98);
        border-color: rgba(31, 41, 55, 0.9);
    }

    /* When nav is open, show it as a dropdown sheet */
    .top-nav.nav-open .nav-main {
        display: flex !important;
    }

    .top-nav.nav-open .container-fluid>.d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .top-nav.nav-open .nav-main nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.1rem;
    }

    .top-nav.nav-open .nav-main nav .nav-link-item {
        width: 100%;
        text-align: left;
        padding: 0.45rem 0.75rem;
        border-radius: 0.6rem;
    }

    /* Right-side (theme + logout) on its own row */
    .top-nav.nav-open .nav-main>.d-flex {
        justify-content: flex-start;
        margin-top: 0.35rem;
        width: 100%;
        gap: 0.75rem;
        padding: 0.25rem 0.1rem 0;
    }
}