/* ══════════════════════════════════════════════════════════════════════════════
   JAFAN CARDS STYLES - Extracted from Exams Page
   ══════════════════════════════════════════════════════════════════════════════
   
   This CSS file provides reusable card styles for KPIs, action cards,
   content cards, and tab navigation.
   
   Features:
   - KPI metric cards with icons
   - Action cards with hover effects
   - Content cards for sections
   - Tab navigation styling
   - Alert/notification styles
   - Responsive design
   
   Usage:
   - KPI Cards: <div class="kpi-strip">...<div class="kpi-card">...</div></div>
   - Action Cards: <a class="action-card">...</a>
   - Content Cards: <div class="content-card">...</div>
   - Tabs: <div class="tab-bar">...<a class="tab">...</a></div>
   ══════════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════════════════════════════════════════ */

.page-container {
    background: #f8fafc;
    min-height: calc(100vh - 60px);
}

.section-reset {
    padding: 0 !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   KPI CARDS (Metric Cards)
   ══════════════════════════════════════════════════════════════════════════════ */

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

@media (min-width: 1024px) {
    .kpi-strip {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kpi-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: box-shadow 0.15s, transform 0.15s;
}

.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* KPI Icon Color Variants */
.kpi-icon.blue { background: #eff6ff; color: #3b82f6; }
.kpi-icon.green { background: #dcfce7; color: #16a34a; }
.kpi-icon.amber { background: #fef3c7; color: #f59e0b; }
.kpi-icon.purple { background: #f3e8ff; color: #9333ea; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.gray { background: #f1f5f9; color: #64748b; }
.kpi-icon.cyan { background: #ecfeff; color: #06b6d4; }
.kpi-icon.rose { background: #ffe4e6; color: #e11d48; }

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.kpi-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
}

.kpi-value.green { color: #16a34a; }
.kpi-value.amber { color: #f59e0b; }
.kpi-value.blue { color: #3b82f6; }
.kpi-value.red { color: #dc2626; }

/* ══════════════════════════════════════════════════════════════════════════════
   ACTION CARDS
   ══════════════════════════════════════════════════════════════════════════════ */

.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.action-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.action-card-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.action-card-icon.blue { color: #2563eb; background: #eff6ff; }
.action-card-icon.green { color: #16a34a; background: #f0fdf4; }
.action-card-icon.orange { color: #ea580c; background: #fff7ed; }
.action-card-icon.purple { color: #9333ea; background: #faf5ff; }
.action-card-icon.cyan { color: #0891b2; background: #ecfeff; }

.action-card-content h3 {
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0;
    color: #111827;
}

.action-card-content p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

/* Grid layout for action cards */
.action-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   CONTENT CARDS
   ══════════════════════════════════════════════════════════════════════════════ */

.content-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.content-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.content-card-body {
    padding: 0.5rem 0;
}

.content-card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TAB NAVIGATION
   ══════════════════════════════════════════════════════════════════════════════ */

.tab-bar {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e5e7eb;
    background: #fff;
    padding: 0 1.5rem;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
    color: #111827;
}

.tab.active {
    color: #16a34a;
    border-bottom-color: #16a34a;
    font-weight: 600;
}

.tab.burgundy.active {
    color: #8b1a1a;
    border-bottom-color: #8b1a1a;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ALERTS / NOTIFICATIONS
   ══════════════════════════════════════════════════════════════════════════════ */

.alert {
    padding: 0.75rem 2rem;
    font-size: 0.875rem;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #d1fae5;
    border-color: #16a34a;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════════════════════════════ */

.filter-bar {
    padding: 0.75rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TABLE WRAPPER
   ══════════════════════════════════════════════════════════════════════════════ */

.table-container {
    padding: 1.25rem 2rem 2rem;
    background: #f8fafc;
}

.table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SPACING UTILITIES
   ══════════════════════════════════════════════════════════════════════════════ */

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   INFO GRID (for detail views)
   ══════════════════════════════════════════════════════════════════════════════ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #111827;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DARK MODE SUPPORT
   ══════════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] .page-container {
    background: #0f172a;
}

[data-theme="dark"] .kpi-strip,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .table-container {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .kpi-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .action-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .kpi-card:hover,
[data-theme="dark"] .action-card:hover {
    border-color: #3b82f6;
}

[data-theme="dark"] .tab-bar {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .tab {
    color: #94a3b8;
}

[data-theme="dark"] .tab:hover {
    color: #e2e8f0;
}

[data-theme="dark"] .tab.active {
    color: #4ade80;
    border-color: #4ade80;
}

[data-theme="dark"] .kpi-label,
[data-theme="dark"] .info-label {
    color: #94a3b8;
}

[data-theme="dark"] .kpi-value,
[data-theme="dark"] .info-value,
[data-theme="dark"] .content-card-title,
[data-theme="dark"] .action-card-content h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .action-card-content p {
    color: #94a3b8;
}

[data-theme="dark"] .table-card {
    background: #1e293b;
    border-color: #334155;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .kpi-strip {
        padding: 1rem;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpi-card {
        padding: 0.75rem;
    }
    
    .kpi-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.875rem;
    }
    
    .kpi-value {
        font-size: 1.1rem;
    }
    
    .filter-bar {
        padding: 0.75rem 1rem;
    }
    
    .table-container {
        padding: 1rem;
    }
    
    .tab-bar {
        padding: 0 1rem;
    }
    
    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .content-card {
        padding: 1rem;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-strip {
        grid-template-columns: 1fr;
    }
}
