/* ==========================================================================
   LotoKeep Admin — Enterprise Professional Design System
   ========================================================================== */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Slate palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Indigo Brand */
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;

    /* Emerald */
    --emerald-50: #ecfdf5;
    --emerald-500: #10b981;
    --emerald-600: #059669;

    /* Amber / Gold */
    --amber-50: #fffbeb;
    --amber-500: #f59e0b;
    --amber-600: #d97706;

    /* App Shell */
    --app-bg: #f1f5f9;
    --app-surface: #ffffff;
    --app-border: #e2e8f0;

    /* Override Bootstrap primary */
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
}

html, body {
    font-family: var(--font-sans);
    background-color: var(--app-bg);
    color: var(--slate-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--app-bg);
}

.sidebar-wrapper {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 1020;
    background-color: #090d16;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.main-wrapper {
    flex: 1;
    min-width: 0;
    background-color: var(--app-bg);
}

.app-topbar {
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    z-index: 1010;
}

.content-wrapper {
    background-color: var(--app-bg);
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar-wrapper {
        width: 100%;
        height: auto;
        position: relative;
    }
}

/* ==========================================================================
   Sidebar Navigation (Guaranteed NO Blue Links / Underlines)
   ========================================================================== */
.sidebar-container {
    background-color: #090d16;
    color: #94a3b8;
    height: 100%;
}

.sidebar-header {
    background-color: rgba(9, 13, 22, 0.98);
    height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.brand-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.brand-badge {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: #818cf8;
    font-weight: 700;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #475569;
}

/* Force override of ANY <a> or .nav-link styles inside sidebar */
.sidebar-container a,
.sidebar-container a:link,
.sidebar-container a:visited,
.sidebar-container .nav-link,
.sidebar-container .nav-link-custom {
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.16s ease;
    border-left: 3px solid transparent;
}

.sidebar-container a .nav-icon,
.sidebar-container .nav-link-custom .nav-icon {
    font-size: 1.15rem;
    color: #64748b;
    transition: color 0.16s ease;
}

.sidebar-container a:hover,
.sidebar-container .nav-link-custom:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
    text-decoration: none !important;
}

.sidebar-container a:hover .nav-icon,
.sidebar-container .nav-link-custom:hover .nav-icon {
    color: #c7d2fe !important;
}

.sidebar-container a.active,
.sidebar-container .nav-link-custom.active {
    color: #ffffff !important;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0.04) 100%) !important;
    border-left: 3px solid #6366f1 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.sidebar-container a.active .nav-icon,
.sidebar-container .nav-link-custom.active .nav-icon {
    color: #818cf8 !important;
}

.sidebar-footer {
    background-color: rgba(9, 13, 22, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.user-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
}

.user-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-role-badge {
    background-color: rgba(99, 102, 241, 0.25) !important;
    color: #c7d2fe !important;
    font-size: 0.65rem !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.user-top-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    font-size: 0.85rem;
}

.btn-logout {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1 !important;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
    padding: 0;
    cursor: pointer;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.55) !important;
    color: #fca5a5 !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   Typography & Headers
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--slate-900);
}

.tracking-tight {
    letter-spacing: -0.03em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: 1px solid #4338ca;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    border-color: #3730a3;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: #4f46e5;
    border-color: #c7d2fe;
    background-color: #ffffff;
}

.btn-outline-primary:hover {
    background-color: var(--indigo-50);
    border-color: #4f46e5;
    color: #4338ca;
}

.btn-outline-secondary {
    color: var(--slate-600);
    border-color: var(--slate-300);
    background-color: #ffffff;
}

.btn-outline-secondary:hover {
    background-color: var(--slate-100);
    border-color: var(--slate-400);
    color: var(--slate-900);
}

/* ==========================================================================
   Cards & Elevated KPI Cards
   ========================================================================== */
.card {
    background-color: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.shadow-sm {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.03) !important;
}

.card-hoverable:hover {
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04) !important;
    transform: translateY(-2px);
}

.kpi-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.kpi-icon-indigo {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
}

.kpi-icon-emerald {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
}

.kpi-icon-amber {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #ffffff;
}

.kpi-icon-sky {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
}

/* ==========================================================================
   Table & Lottery Numbers
   ========================================================================== */
.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
}

.table > thead > tr > th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--slate-500);
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(241, 245, 249, 0.75);
}

.lottery-number-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lottery-number-badge.gordo {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #78350f;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.35rem 0.65rem;
}

.badge.bg-primary-subtle {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}

.badge.bg-success-subtle {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}

.badge.bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

.badge.bg-warning-subtle {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fde68a !important;
}

.badge.bg-info-subtle {
    background-color: #e0f2fe !important;
    color: #075985 !important;
    border: 1px solid #bae6fd !important;
}

.badge.bg-dark-subtle {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

/* ==========================================================================
   Alerts (High Contrast & Clean Typography)
   ========================================================================== */
.alert {
    border-radius: 12px;
    font-size: 0.875rem;
    padding: 0.85rem 1.15rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}

.alert-danger .text-danger, .alert-danger .bi-exclamation-triangle-fill {
    color: #dc2626 !important;
}

.alert-success {
    background-color: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.alert-warning {
    background-color: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

.alert-info {
    background-color: #f0f9ff !important;
    border-color: #7dd3fc !important;
    color: #075985 !important;
}

/* ==========================================================================
   Live Pulse & Status Dot
   ========================================================================== */
.status-indicator-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% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-content {
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    background-color: #f8fafc;
}
