/* ============================================================
   EduMaster — Module Component Styles
   All feature-specific styling: modals, tables, role badges,
   attendance, notice board, forms, charts, ID cards, calendar,
   gallery, kanban, tabs, print
   ============================================================ */

/* ============================================================
   Modals (module-generated via innerHTML)
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card, .modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Role Tags / Badges
   ============================================================ */
.role-tag, .user-role-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.role-tag.admin { background: rgba(67, 83, 255, 0.1); color: var(--primary); }
.role-tag.teacher { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.role-tag.student { background: rgba(6, 182, 212, 0.1); color: var(--accent); }
.role-tag.staff { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.role-tag.superadmin { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }

/* ============================================================
   Attendance Toggle (enhanced)
   ============================================================ */
.att-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 20px;
    background: var(--bg-input);
}

.att-toggle-btn {
    padding: 4px 10px;
    border-radius: 16px;
    border: none;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.att-toggle-btn.active.present { background: var(--success); color: white; }
.att-toggle-btn.active.absent { background: var(--danger); color: white; }
.att-toggle-btn.active.late { background: var(--warning); color: white; }

/* ============================================================
   Notice Board
   ============================================================ */
.notice-card {
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: all var(--transition-fast);
}

.notice-card:hover { border-color: var(--border-glass); box-shadow: var(--shadow-sm); }

.notice-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notice-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notice-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    gap: 12px;
}

/* ============================================================
   Form rows / sections
   ============================================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.form-section {
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

/* Textarea */
textarea.form-input {
    min-height: 80px;
    resize: vertical;
}

/* Checkbox / radio groups */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ============================================================
   Loading states
   ============================================================ */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Page headers (module variant)
   ============================================================ */
.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.module-header h2, .module-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.module-header .header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   Chart / legend (extended)
   ============================================================ */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   Live class / Google Meet
   ============================================================ */
#google-meet-container-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    margin-top: 16px;
}

/* ============================================================
   Grade tables / report cards
   ============================================================ */
.marks-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.marks-grid th {
    background: var(--bg-input);
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid var(--border-glass);
}

.marks-grid td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.marks-grid input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition-fast);
}

.marks-grid input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg);
}

/* ============================================================
   ID cards
   ============================================================ */
.id-card {
    width: 340px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
}

.id-card-header {
    background: var(--primary-gradient);
    color: white;
    padding: 14px 16px;
    text-align: center;
}

.id-card-header h4 { font-size: 0.88rem; font-weight: 600; }

.id-card-body {
    padding: 16px;
    display: flex;
    gap: 14px;
}

.id-card-photo {
    width: 64px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-glass);
    flex-shrink: 0;
}

.id-card-info {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.id-card-info strong { font-weight: 600; }

/* ============================================================
   Calendar grid
   ============================================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.calendar-cell:hover { background: var(--bg-input); }

.calendar-cell.today {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.calendar-cell.has-event {
    position: relative;
}

.calendar-cell.has-event::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
    bottom: 4px;
}

.calendar-header-cell {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
    padding: 8px 0;
}

/* ============================================================
   Gallery
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.gallery-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

.gallery-item-title {
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================
   Module tabs (inline variant)
   ============================================================ */
.module-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
    overflow-x: auto;
}

.module-tab {
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

.module-tab:hover { color: var(--text-primary); }

.module-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   Tab bar (renderTabBar() helper — crm-pages.js and others)
   ============================================================ */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* Tab content panels */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar input[type="search"] {
    padding: 8px 12px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-surface);
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover { background: var(--bg-input); border-color: var(--text-muted); }

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   Action buttons (inline in tables)
   ============================================================ */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--border-glow);
}

.action-btn.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.action-btn svg { width: 14px; height: 14px; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb span { color: var(--text-muted); }

/* ============================================================
   File upload area
   ============================================================ */
.file-upload-area {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-input);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.file-upload-area svg {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.file-upload-area p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================
   Print styles
   ============================================================ */
@media print {
    .sidebar, .topnav, .hamburger, .sidebar-overlay,
    .btn, button, .no-print, .toast-container,
    #ai-coach-fab, #ai-coach-window { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-container { padding: 0 !important; }
    .glass-card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    body { background: white !important; }
}

/* ============================================================
   Responsive table wrapper
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   Card grid for module pages
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* ============================================================
   Tooltip
   ============================================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--text-primary);
    color: white;
    font-size: 0.72rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   Responsive supplements
   ============================================================ */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .card-grid, .card-grid-3 { grid-template-columns: 1fr; }
    .id-card { width: 100%; max-width: 340px; }
    .calendar-grid { gap: 1px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .module-tabs { gap: 0; }
    .module-tab { padding: 8px 12px; font-size: 0.8rem; }
}

/* ============================================================
   School Dashboard (sd-*) — renderDashboardHTML classes
   ============================================================ */
.sd-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 28px;
    position: relative;
    overflow: hidden;
    border: none;
}

.sd-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.sd-hero-main { position: relative; z-index: 1; }

.sd-hero-eyebrow {
    font-size: 0.78rem;
    opacity: 0.8;
    margin-bottom: 6px;
    font-weight: 500;
}

.sd-hero-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.sd-hero-date {
    font-size: 0.82rem;
    opacity: 0.75;
}

.sd-hero-pulse {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

.sd-pulse-item { text-align: center; }
.sd-pulse-num { font-size: 1.3rem; font-weight: 700; display: block; }
.sd-pulse-lbl { font-size: 0.72rem; opacity: 0.75; }
.sd-pulse-sep { width: 1px; height: 32px; background: rgba(255,255,255,0.2); }

.sd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.sd-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
}

.sd-stat:hover { box-shadow: var(--shadow-md); }

/* These tiles used a same-hue pairing — e.g. a green glyph on a 10%-opacity green
   wash — which measured a 1.0-1.2 contrast ratio, i.e. the icon was practically
   invisible and every tile read as the same flat grey-ish block. A white glyph on a
   saturated gradient tile lifts that to roughly 5-8:1 and gives each KPI a distinct,
   deliberate colour identity. */
.sd-stat-ic {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #FFFFFF;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.sd-stat-ic svg { width: 22px; height: 22px; stroke-width: 2.1; }

.sd-indigo .sd-stat-ic  { background: linear-gradient(145deg, #6366F1, #4338CA); }
.sd-emerald .sd-stat-ic { background: linear-gradient(145deg, #22C55E, #15803D); }
.sd-cyan .sd-stat-ic    { background: linear-gradient(145deg, #06B6D4, #0E7490); }
.sd-amber .sd-stat-ic   { background: linear-gradient(145deg, #F59E0B, #B45309); }

.sd-stat-body { min-width: 0; }
.sd-stat-num { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sd-stat-label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }
.sd-stat-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.sd-fee-card { text-align: center; }
.sd-fee-amount {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0 6px;
}
.sd-fee-note { font-size: 0.78rem; color: var(--text-muted); }

.sd-pipeline { display: flex; flex-direction: column; gap: 12px; }
.sd-pipe-row { display: flex; align-items: center; gap: 12px; }
.sd-pipe-lbl { font-size: 0.82rem; color: var(--text-secondary); width: 80px; font-weight: 500; }
.sd-pipe-track { flex: 1; height: 8px; background: var(--bg-input); border-radius: 8px; overflow: hidden; }
.sd-pipe-track i { display: block; height: 100%; border-radius: 8px; transition: width 0.8s ease; }
.sd-pipe-row b { font-size: 0.85rem; color: var(--text-primary); min-width: 28px; text-align: right; }
.sd-pipe-foot { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-light); }

.sd-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sd-actions .btn { padding: 12px; font-size: 0.82rem; }

.ring-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ============================================================
   Super Admin Dashboard (sa-*) classes
   ============================================================ */
.sa-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 28px;
    position: relative;
    overflow: hidden;
    border: none;
}

.sa-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.sa-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 20px;
}

.sa-hero-eyebrow { font-size: 0.78rem; opacity: 0.75; margin-bottom: 4px; font-weight: 500; }
.sa-hero-title { font-size: 1.4rem; font-weight: 700; }
.sa-hero-sub { font-size: 0.85rem; opacity: 0.8; margin-top: 4px; }
.sa-hero-actions { display: flex; gap: 10px; margin-top: 14px; }
.sa-hero-actions .btn { font-size: 0.82rem; }
.sa-hero-actions .btn-outline { border-color: rgba(255,255,255,0.3); color: white; }
.sa-hero-actions .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

.sa-hero-mrr { text-align: right; }
.sa-hero-mrr-label { font-size: 0.75rem; opacity: 0.7; margin-bottom: 4px; }
.sa-hero-mrr-value { font-size: 2rem; font-weight: 800; }
.sa-hero-mrr-foot { font-size: 0.72rem; opacity: 0.65; margin-top: 4px; }

.sa-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: all var(--transition-fast);
}

.sa-tile:hover { box-shadow: var(--shadow-md); }

.sa-tile-icon { margin-bottom: 8px; }
.sa-tile-icon svg { width: 24px; height: 24px; }
.sa-tile-value { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.sa-tile-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.sa-tile-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

.sa-indigo .sa-tile-icon { color: var(--primary); }
.sa-green .sa-tile-icon { color: var(--success); }
.sa-amber .sa-tile-icon { color: var(--warning); }
.sa-cyan .sa-tile-icon { color: var(--accent); }

.sa-health-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.sa-health-row .lbl { font-size: 0.82rem; color: var(--text-secondary); width: 64px; font-weight: 500; }
.sa-health-bar { flex: 1; height: 8px; background: var(--bg-input); border-radius: 8px; overflow: hidden; }
.sa-health-bar i { display: block; height: 100%; border-radius: 8px; transition: width 0.8s ease; }
.sa-health-val { font-size: 0.88rem; font-weight: 700; min-width: 28px; text-align: right; }

.sa-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ============================================================
   Widget cards (dashboard bottom)
   ============================================================ */
.widget-card { padding: 18px; }
.widget-header {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.widget-body { min-height: 60px; }

.widget-item {
    font-size: 0.82rem;
    color: var(--text-primary);
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.5;
}

.widget-item:last-child { border-bottom: none; }

.widget-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.widget-stat-num { font-size: 1.4rem; font-weight: 700; }
.widget-stat-label { font-size: 0.78rem; color: var(--text-muted); }

.empty-state-text {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 16px;
}

/* ============================================================
   Small action buttons (btn-sm, btn-approve etc.)
   ============================================================ */
.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-glass);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: 4px;
}

.btn-sm:hover { background: var(--bg-input); }

.btn-sm.btn-approve { color: var(--success); border-color: rgba(34,197,94,0.3); }
.btn-sm.btn-approve:hover { background: var(--success-bg); }

.btn-sm.btn-reject { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-sm.btn-reject:hover { background: var(--danger-bg); }

.btn-sm.btn-delete { color: var(--text-muted); }
.btn-sm.btn-delete:hover { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   Responsive dashboard supplements
   ============================================================ */
@media (max-width: 768px) {
    .sd-hero { padding: 20px; }
    .sd-hero-title { font-size: 1.15rem; }
    .sd-hero-pulse { flex-wrap: wrap; gap: 12px; }
    .sd-stats { grid-template-columns: 1fr 1fr; }
    .sd-actions { grid-template-columns: 1fr; }
    .sa-hero-content { flex-direction: column; text-align: center; }
    .sa-hero-mrr { text-align: center; }
    .sa-hero-actions { justify-content: center; }
    .sa-actions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .sd-stats { grid-template-columns: 1fr; }
    .sd-pulse-sep { display: none; }
    .sd-hero-pulse { justify-content: space-around; }
}
