/* ============================================================
   CodeSpazio Productivity Platform
   Premium Design System — State-of-the-Art Hybrid Theme
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
    /* Brand Palette (Hybrid Theme Optimized) */
    --primary:          #0F172A; /* Deep Slate (Sidebar Anchor) */
    --primary-mid:      #1E293B; /* Medium Slate */
    --primary-light:    #F1F5F9; /* Slate-100 */
    --primary-accent:   #2563EB; /* Premium Royal Blue */
    --primary-accent-hover: #1D4ED8;
    --secondary:        #D97706; /* Gold Accent */
    --secondary-hover:  #B55C03;
    --secondary-light:  #FEF3C7;

    /* Semantic Status */
    --success:          #059669; /* Emerald Green */
    --success-light:    #D1FAE5;
    --warning:          #D97706; /* Amber Gold */
    --danger:           #DC2626; /* Crimson Red */
    --danger-light:     #FEE2E2;
    --info:             #0EA5E9; /* Sky Blue */

    /* Surfaces & Layout */
    --bg-main:          #F8FAFC; /* Clean Ice-White Background */
    --bg-card:          rgba(255, 255, 255, 0.85); /* Translucent White Glass */
    --bg-card-solid:    #FFFFFF; /* Solid White */
    --bg-input:         #FFFFFF; /* White Input Surface */
    --border-color:     #E2E8F0; /* Soft Slate Border */
    --border-light:     rgba(15, 23, 42, 0.04);

    /* Text */
    --text-primary:     #0F172A; /* Crisp Slate-950 Text */
    --text-secondary:   #475569; /* Slate-600 */
    --text-muted:       #94A3B8; /* Slate-400 */

    /* Typography */
    --font-display:     'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --font-body:        'Inter', 'Segoe UI', system-ui, sans-serif;

    /* Elevated Shadows */
    --shadow-xs:        0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-sm:        0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
    --shadow-md:        0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-lg:        0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    --shadow-xl:        0 25px 50px -12px rgba(15, 23, 42, 0.1);
    --shadow-glow-blue: 0 0 25px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(37, 99, 235, 0.06);
    --shadow-glow-gold: 0 0 25px rgba(217, 119, 6, 0.12), 0 4px 12px rgba(217, 119, 6, 0.06);

    /* Motion */
    --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:   0.48s var(--ease-out-expo);

    /* Dimensions */
    --sidebar-width:    260px;
    --navbar-height:    70px;
    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        24px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(ellipse 60% 40% at 0% 0%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 100% 100%, rgba(217, 119, 6, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.015em;
}

a {
    color: var(--primary-accent);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-fast);
}
a:hover {
    color: var(--primary-accent-hover);
}

/* ── Custom Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ── SVG Icon Handling ───────────────────────────────────── */
svg[aria-hidden="true"] {
    display: block;
    flex-shrink: 0;
    fill: currentColor;
}

.logo-icon svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.item-icon svg {
    width: 17px;
    height: 17px;
}

.sidebar-close svg {
    width: 18px;
    height: 18px;
}

/* ── Layout & Page Transitions ───────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
}

.page-content {
    flex: 1;
    padding: 2.25rem 2.5rem;
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
    animation: slideInUp 0.5s var(--ease-out-expo) both;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Sleek Dark Sidebar Navigation ────────────────────────── */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-normal);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}
.brand-logo:hover {
    opacity: 0.9;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-accent) 0%, #3B82F6 100%);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: #FFFFFF;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.menu-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748B;
    padding: 1.5rem 1.25rem 0.5rem;
}

.sidebar-menu {
    flex: 1;
    padding: 0.5rem 0.75rem 1.5rem;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.9rem;
    color: #94A3B8;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.2rem;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.menu-item .item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
}
.menu-item:hover .item-icon {
    background: rgba(255, 255, 255, 0.08);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(37, 99, 235, 0.06) 100%);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.menu-item.active .item-icon {
    background: var(--primary-accent);
    color: #FFFFFF;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 1rem 0.75rem;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.15);
}
.logout-link:hover .item-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.sidebar-footer {
    padding: 1.15rem 1.25rem;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary) 0%, #F59E0B 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.sidebar-user-info {
    min-width: 0;
}

.user-role {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--secondary);
    font-weight: 700;
    display: block;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: #F1F5F9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* ── Light Sticky Top Navbar ──────────────────────────────── */
.top-navbar {
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.8); /* Translucent white */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    background: none;
    border: none;
    cursor: pointer;
}
.sidebar-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform var(--transition-fast);
}

.page-header-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.user-profile-badge:hover {
    border-color: #CBD5E1;
    box-shadow: var(--shadow-md);
}

.avatar-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-accent) 0%, #3B82F6 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.profile-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Premium Metrics Cards ────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: var(--primary-accent);
}

.metric-card.color-success::before { background: var(--success); }
.metric-card.color-warning::before { background: var(--warning); }
.metric-card.color-danger::before  { background: var(--danger); }

.metric-card:hover {
    transform: translateY(-4px) scale(1.008);
    box-shadow: var(--shadow-lg);
    border-color: #CBD5E1;
}

.metric-card:active {
    transform: scale(0.985) translateY(-2px);
}

.metric-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.metric-title {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 8px;
    font-size: 1.15rem;
}
.metric-card.color-success .metric-icon { background: rgba(5, 150, 105, 0.06); }
.metric-card.color-danger  .metric-icon { background: rgba(220, 38, 38, 0.06); }

.metric-value {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* ── Board Layout Grid ───────────────────────────────────── */
.board-grid {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 992px) {
    .board-grid { grid-template-columns: 1fr; }
}

/* ── Modern Panel Cards ───────────────────────────────────── */
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}
.panel-card:hover {
    border-color: #CBD5E1;
    box-shadow: var(--shadow-md);
}

.panel-card:active {
    transform: scale(0.992) translateY(-1px);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ── Dynamic Form Inputs ─────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.65rem 0.95rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    appearance: none;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
    padding-right: 2.25rem;
    cursor: pointer;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: var(--bg-input);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* ── Interactive Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.965);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0; left: -110%;
    width: 80%; height: 100%;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 55%, transparent 70%);
    transition: left 0.5s ease;
}
.btn:hover::after {
    left: 110%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-accent) 0%, #3B82F6 100%);
    color: #FFFFFF;
    border-color: var(--primary-accent);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-accent-hover) 0%, var(--primary-accent) 100%);
    border-color: var(--primary-accent-hover);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.btn-blue {
    background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary) 100%);
    color: #FFFFFF;
    border-color: var(--primary-mid);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}
.btn-blue:hover {
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-secondary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    background: var(--primary-light);
    color: var(--text-primary);
    border-color: #CBD5E1;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #FFFFFF;
    border-color: #059669;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.15);
}
.btn-success:hover {
    box-shadow: 0 6px 14px rgba(5, 150, 105, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
    color: #FFFFFF;
    border-color: #DC2626;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15);
}
.btn-danger:hover {
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #F59E0B 100%);
    color: #FFFFFF;
    border-color: var(--warning);
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    gap: 0.35rem;
}

.btn-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Light Responsive Tables ─────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table th {
    background: #F8FAFC;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tr {
    transition: background var(--transition-fast);
}
.table tbody tr:hover td {
    background: #F8FAFC !important;
}
.table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Status Badges ───────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.55rem;
    font-size: 0.675rem;
    font-weight: 700;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.badge-low, .badge-pending {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.badge-pending {
    animation: pulseBadge 2.2s ease-in-out infinite;
}
@keyframes pulseBadge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.25); }
    60%       { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0); }
}

.badge-medium {
    background: #FFF3E0;
    color: #E65100;
    border-color: #FFE0B2;
}

.badge-high, .badge-suspended {
    background: var(--danger-light);
    color: #991B1B;
    border-color: #FCA5A5;
}

.badge-completed, .badge-active {
    background: var(--success-light);
    color: #065F46;
    border-color: #A7F3D0;
}

/* ── Alert Notifications ─────────────────────────────────── */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    border: 1.5px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    border-color: #6EE7B7;
    color: #064E3B;
}
.alert-danger {
    background: var(--danger-light);
    border-color: #FCA5A5;
    color: #7F1D1D;
}
.alert-warning {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: #78350F;
}
.alert-info {
    background: #EFF6FF;
    border-color: #93C5FD;
    color: #1E3A8A;
}

/* ── Auth/Guest Layout ────────────────────────────────────── */
.guest-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between;
    background-color: var(--bg-main);
    background-image:
        radial-gradient(ellipse 60% 45% at 0% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 100% 100%, rgba(217, 119, 6, 0.04) 0%, transparent 55%);
}

.guest-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    flex: 1;
}

.auth-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
    animation: cardEntrance 0.5s var(--ease-out-expo) both;
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-footer-links {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.guest-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Footers ─────────────────────────────────────────────── */
.app-footer {
    text-align: center;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Filter & Search Bars ────────────────────────────────── */
.filter-bar {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) auto;
    gap: 1.15rem;
    align-items: flex-end;
}

/* ── Premium Modal Layout ────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.modal.show {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: calc(100% - 2rem);
    max-width: 500px;
    box-shadow: var(--shadow-xl), var(--shadow-glow-blue);
    overflow: hidden;
    transform: translateY(-20px) scale(0.98);
    transition: transform var(--transition-slow);
}
.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F8FAFC;
}
.modal-header .modal-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(15, 23, 42, 0.05);
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.modal-close:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #F8FAFC;
}

/* ── Live Toast Reminders ────────────────────────────────── */
.toast-reminder-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2100;
    max-width: 360px;
    width: 100%;
}

.toast-reminder {
    background: #FFFFFF;
    border: 1.5px solid var(--secondary);
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    animation: toastIn 0.38s var(--ease-out-expo) both;
}

@keyframes toastIn {
    from { transform: translateY(16px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.toast-reminder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.35rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.toast-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.toast-close:hover {
    color: var(--danger);
}

.toast-body {
    color: var(--text-secondary);
    font-size: 0.825rem;
}

.toast-time {
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

/* ── Live Navbar Clock ───────────────────────────────────── */
.navbar-clock {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: #F1F5F9;
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    margin-right: 0.25rem;
    box-shadow: var(--shadow-xs);
}

.live-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulseGreen 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7); }
    60%       { box-shadow: 0 0 0 5px rgba(5, 150, 105, 0); }
}

/* ── Responsive Refinements ──────────────────────────────── */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 230px;
    }
    .page-content {
        padding: 2rem;
    }
}

@media (max-width: 1120px) {
    .board-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }
    .main-container {
        margin-left: 0;
    }
    .app-sidebar {
        transform: translateX(-100%);
        width: 260px; /* Fixed drawer width */
        box-shadow: none;
    }
    .app-sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(15, 23, 42, 0.25);
    }
    .sidebar-toggle {
        display: flex;
    }
    .sidebar-close {
        display: flex;
    }
    .top-navbar {
        padding: 0 1.5rem;
    }
    .page-content {
        padding: 1.75rem 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    h1, .page-header-title { font-size: 1.15rem; }
    h2 { font-size: 1.35rem; }
    h3, .panel-title { font-size: 1.05rem; }
    .metric-value { font-size: 1.85rem; }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    .top-navbar {
        height: 65px;
    }
}

@media (max-width: 576px) {
    .navbar-clock {
        display: none;
    }
    .auth-card {
        padding: 2.25rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    .page-content {
        padding: 1.25rem 1rem;
    }
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .btn-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    .btn-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .profile-name {
        display: none;
    }
    .user-profile-badge {
        padding: 0.25rem;
    }
    .metric-card, .panel-card {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-md);
    }
    .table th, .table td {
        padding: 0.75rem 0.6rem;
        font-size: 0.8rem;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 420px) {
    .metrics-grid {
        grid-template-columns: 1fr; /* Avoid squeezing balance numbers */
        gap: 0.85rem;
    }
    .metric-value {
        font-size: 1.65rem;
    }
}

/* ── Finance Overrides & Custom Component Flex ─────────────── */
.finance-hero {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue) !important;
}

.finance-progress-track {
    height: 8px;
    width: 100%;
    background-color: #E2E8F0 !important;
    border-radius: 99px;
    overflow: hidden;
}

.finance-progress-track.track-sm {
    height: 5px;
}

.finance-progress-bar {
    height: 100%;
    border-radius: 99px;
}

.category-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(15, 23, 42, 0.1);
}

.category-dot-sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.category-badge {
    background-color: #F1F5F9 !important;
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}

.chart-grid-line {
    stroke: #E2E8F0 !important;
    stroke-dasharray: 4;
}

.chart-grid-line.line-axis {
    stroke: #94A3B8 !important;
    stroke-dasharray: none;
}

/* Style horizontal list scroll indicators */
.scroll-hint-wrapper {
    position: relative;
}
.scroll-hint-wrapper::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, var(--bg-main));
    pointer-events: none;
    opacity: 0.8;
}
