@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0b1120;
    --card-dark: rgba(17, 24, 39, 0.75);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --secondary: #0ea5e9;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.05), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.05), transparent 30%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #ffffff;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    color: var(--text-main);
    border-radius: 1rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.4);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Sidebar */
.sidebar {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

.sidebar-link {
    color: #94a3b8 !important;
    text-decoration: none !important;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff !important;
    transform: translateX(4px);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, transparent 100%);
    color: #34d399 !important;
    border-left: 3px solid #10b981;
    font-weight: 600;
}

/* Stats */
.stat-value {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
}

.stat-primary { color: #34d399; text-shadow: 0 0 20px var(--primary-glow); }
.stat-secondary { color: #38bdf8; text-shadow: 0 0 20px rgba(14, 165, 233, 0.3); }
.stat-warning { color: #fbbf24; text-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }

/* Tables */
.table {
    color: var(--text-main);
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-main);
    border-bottom-color: var(--border-color);
    padding: 1rem 1.5rem;
}

.table-hover tbody tr {
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover > * {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.table th {
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-top: none;
}

/* Forms */
.form-control, .form-select, .form-control:focus, .form-select:focus {
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    color: #ffffff;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-info {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.45);
}

.btn-outline-secondary {
    color: #e2e8f0 !important;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

.btn-outline-danger {
    color: #f87171 !important;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.btn-outline-danger:hover {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}

/* Badges */
.badge {
    padding: 0.45em 0.85em;
    font-weight: 600;
    border-radius: 2rem;
    letter-spacing: 0.02em;
}

.text-muted {
    color: #94a3b8 !important;
}

.form-control::placeholder, .form-select::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* Auth (Login Screen) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem !important;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(16, 185, 129, 0.05);
}


/* Period Selector Pills (High Contrast) */
.period-pills {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 4px;
    gap: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.period-pill {
    color: #cbd5e1 !important;
    text-decoration: none !important;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    display: inline-block;
}

.period-pill:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
}

.period-pill.active {
    background: linear-gradient(135deg, #10b981, #0ea5e9) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* Metric Cards */
.metric-card {
    position: relative;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 25px -4px rgba(0, 0, 0, 0.4);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--border-accent, #10b981), transparent);
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Pulsing Real-Time Dot */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.progress-dark {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.progress-bar-primary {
    background: linear-gradient(90deg, #10b981, #0ea5e9);
}

.progress-bar-purple {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

/* Premium Modals */
.modal-backdrop {
    background-color: #040814;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    color: var(--text-main);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 1.75rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 1.75rem;
}

.modal-body {
    padding: 1.75rem;
}

.btn-close-white {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-close-white:hover {
    opacity: 1;
}

.modal.fade .modal-dialog {
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-dialog {
    transform: none;
}
