/* Futuron School Portal ERP - Industrial Design System (Light & Dark Themes) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Default Light Theme Variables */
:root, [data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --border-focus: #4f46e5;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #0891b2;
    --accent: #7c3aed;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 8px 32px rgba(79, 70, 229, 0.12);
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --table-header-bg: #f1f5f9;
    --input-bg: #ffffff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: #6366f1;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 8px 32px rgba(99, 102, 241, 0.15);
    --sidebar-bg: rgba(15, 23, 42, 0.95);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --table-header-bg: rgba(15, 23, 42, 0.6);
    --input-bg: rgba(15, 23, 42, 0.8);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary);
}

/* Layout Framework */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.brand-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.brand-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.user-profile {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info .user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-info .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: calc(100vw - 260px);
}

/* Header & Top Bar */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.page-title p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Cards & Containers */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
}

.card:hover {
    border-color: rgba(79, 70, 229, 0.3);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Grid & Metrics */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
}

.stat-val {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.25rem;
}

.stat-label {
    font-size: 0.825rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background: var(--bg-main);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th, .table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: var(--bg-card-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-present, .badge-approved, .badge-paid, .badge-granted, .badge-sent, .badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-absent, .badge-rejected, .badge-unpaid, .badge-denied, .badge-failed, .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-late, .badge-pending, .badge-processing, .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-invoice {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.badge-credit_note {
    background: rgba(8, 145, 178, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(8, 145, 178, 0.3);
}

/* Login Page Styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background-color: var(--bg-main);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}
