/* ============================================================
   BASE — CSS Variables, Theme Tokens, Reset, Typography
   ============================================================ */

:root, html[data-theme="light"] {
    --bg-main: #F4F4F4;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8F8F8;
    --bg-header: #FFFFFF;
    --header-text: #404040;
    --border-color: #E9EDF1;
    --border-subtle: #E5E7EB;
    --border-highlight: #7366FF;
    --border-widget-light: #EFEEFF;

    --text-primary: #404040;
    --text-secondary: #757589;
    --text-muted: #6C757D;
    --text-light-gray: #999999;
    --color-dark: #3F475A;

    --accent-indigo: #7366FF;
    --accent-indigo-hover: #5d4ef5;
    --accent-emerald: #65C15C;
    --accent-amber: #FFB829;
    --accent-rose: #FC564A;

    /* Cuba Color Palette Tokens */
    --tenant-primary: #7366FF;
    --tenant-primary-hover: #5d4ef5;
    --tenant-primary-text: #ffffff;
    --tenant-primary-light: #E8E5FF;
    --tenant-primary-70: #9D97FB;
    --tenant-primary-rgb: 115, 102, 255;
    --tenant-primary-border: rgba(115, 102, 255, 0.25);

    --tenant-accent: #65C15C;
    --tenant-accent-hover: #52a84a;
    --tenant-accent-text: #ffffff;
    --tenant-accent-light: #DCF1DA;
    --tenant-accent-rgb: 101, 193, 92;

    --primary-gradient: linear-gradient(103.75deg, #33B1EE -13.9%, #7366FF 79.68%);

    --table-header-bg: #F8F8F8;
    --table-header-text: #404040;
    --table-row-even: #FAFAFA;
    --table-row-hover: #F4F4F4;

    --input-bg: #FFFFFF;
    --input-border: #E9EDF1;
    --input-text: #404040;

    --font-heading: 'Rubik', sans-serif;
    --font-body: 'Rubik', sans-serif;

    /* Semantic fallbacks */
    --primary: #7366FF;
    --primary-hover: #5d4ef5;
    --primary-light: #E8E5FF;
    --primary-text: #ffffff;
    --card-bg: var(--bg-card);
    --danger: #FC564A;
    --danger-light: #FFE8E6;
    --danger-hover: #e04438;
    --warning: #FFB829;
    --warning-light: #FFF7E5;
    --success: #65C15C;
    --success-light: #DCF1DA;
    --info: #40B8F5;
    --info-light: #D5F5FE;
    --secondary: #838383;
    --dark: #3F475A;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-2xl: 15px;
    --shadow-card: 0px 9px 20px rgba(46, 35, 94, 0.07);
    --shadow-header: 0 0 20px rgba(89, 102, 122, 0.1);
    --shadow-card-hover: 0 0 40px rgba(8, 21, 66, 0.05);
    --shadow-accent: 2px 3.464px 8px 0px rgba(22, 145, 248, 0.18);
    --shadow-modal: 0 10px 30px rgba(46, 35, 94, 0.12);
}

html[data-theme="dark"] {
    --bg-main: #1d222e;
    --bg-card: #262c3c;
    --bg-card-hover: #2e3547;
    --bg-header: #262c3c;
    --header-text: #f8fafc;
    --border-color: #333b4f;
    --border-subtle: #2d3546;
    --border-highlight: #7366FF;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-indigo: #7366FF;
    --accent-indigo-hover: #5d4ef5;
    --accent-emerald: #65C15C;
    --accent-amber: #FFB829;
    --accent-rose: #FC564A;

    --tenant-primary-light: rgba(115, 102, 255, 0.2);
    --tenant-accent-light: rgba(101, 193, 92, 0.2);

    /* Semantic fallbacks */
    --primary: #7366FF;
    --primary-hover: #5d4ef5;
    --primary-light: rgba(115, 102, 255, 0.2);
    --primary-text: #ffffff;
    --card-bg: var(--bg-card);
    --danger: #FC564A;
    --danger-light: rgba(252, 86, 74, 0.2);
    --warning: #FFB829;
    --warning-light: rgba(255, 184, 41, 0.2);
    --success: #65C15C;
    --success-light: rgba(101, 193, 92, 0.2);
    --info: #40B8F5;
    --info-light: rgba(64, 184, 245, 0.2);

    --table-header-bg: #1f2533;
    --table-header-text: #f8fafc;
    --table-row-even: #212837;
    --table-row-hover: #293144;

    --input-bg: #1f2533;
    --input-border: #333b4f;
    --input-text: #f8fafc;

    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.25);
    --shadow-header: 0 0 20px rgba(0, 0, 0, 0.3);
    --shadow-modal: 0 20px 30px rgba(0, 0, 0, 0.4);
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
}

/* Form inputs */
select, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(textarea), select {
    height: 42px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

select {
    cursor: pointer;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

input[type="checkbox"], input[type="radio"] {
    cursor: pointer;
    accent-color: var(--tenant-primary);
    width: 16px;
    height: 16px;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--tenant-primary);
    box-shadow: 0 0 0 3px var(--tenant-primary-light);
}

/* Utility */
.hidden { display: none !important; }
.full-width { width: 100%; }

/* Max-width utilities */
.max-w-500 { max-width: 500px; }
.max-w-600 { max-width: 600px; }
.max-w-700 { max-width: 700px; }
.max-w-800 { max-width: 800px; }
.max-w-850 { max-width: 850px; }

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    border: 2px solid var(--border-color);
    border-top-color: var(--tenant-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.35rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* ── Modern Attendance Desk Styles ─────────────────────────── */
.att-pill-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}
.att-pill-counter.present { background: #ecfdf5; color: #047857; }
.att-pill-counter.absent { background: #fef2f2; color: #b91c1c; }
.att-pill-counter.late { background: #fffbeb; color: #b45309; }
.att-pill-counter.excused { background: #eff6ff; color: #1d4ed8; }

.att-status-group {
    display: inline-flex;
    border-radius: 0.5rem;
    background: #e2e8f0;
    padding: 2px;
    gap: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.att-btn {
    border: none;
    background: #f8fafc;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    color: #64748b;
    min-width: 36px;
    text-align: center;
    user-select: none;
}
.att-btn:hover {
    background: #ffffff;
    color: #0f172a;
    transform: translateY(-1px);
}
.att-btn.active.present {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.35);
}
.att-btn.active.absent {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.35);
}
.att-btn.active.late {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.35);
}
.att-btn.active.excused {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.35);
}

.att-row-present { background-color: rgba(236, 253, 245, 0.3) !important; }
.att-row-absent { background-color: rgba(254, 242, 242, 0.5) !important; }
.att-row-late { background-color: rgba(255, 251, 235, 0.5) !important; }
.att-row-excused { background-color: rgba(239, 246, 255, 0.5) !important; }

.att-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Overview Mini List & Item Styles ───────────────────────── */
.mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.mini-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}


