/* =========================================================================
   CONTERTAMIR — School Management Panel Design System
   RTL-first (Arabic default), logical properties throughout so the same
   stylesheet works unmodified once French/LTR ships.
   ========================================================================= */

:root {
    --color-primary: #4f46e5;
    --color-primary-dark: #4338ca;
    --color-primary-light: #eef2ff;
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-info: #0891b2;
    --color-info-light: #cffafe;

    --color-text: #1e2433;
    --color-text-muted: #6b7280;
    --color-text-subtle: #9ca3af;
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-bg: #f5f6fa;
    --color-surface: #ffffff;
    --color-surface-hover: #f9fafb;
    --color-sidebar-bg: #171a2b;
    --color-sidebar-text: #b6bacc;
    --color-sidebar-text-active: #ffffff;
    --color-sidebar-active-bg: rgba(79, 70, 229, 0.35);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);

    --sidebar-width: 268px;
    --topbar-height: 68px;
    --font-arabic: 'Cairo', 'Tahoma', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-arabic);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
[dir="ltr"] body { font-family: 'Inter', 'Cairo', sans-serif; }

h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------------------------------------------------------------------- */
/* App shell                                                               */
/* ---------------------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-badge {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), #818cf8);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.sidebar-brand .brand-text { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.3; }
.sidebar-brand .brand-sub { font-size: 11.5px; color: var(--color-sidebar-text); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group-title { font-size: 11px; color: #6c7290; text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: var(--color-sidebar-text);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--color-sidebar-active-bg); color: var(--color-sidebar-text-active); }
.nav-item.disabled { opacity: .45; cursor: not-allowed; }
.nav-item .badge-soon {
    margin-inline-start: auto; font-size: 10px; padding: 2px 7px;
    border-radius: 999px; background: rgba(255,255,255,.12); color: #d7d9ea;
}

.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #6c7290; }

.main-area {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-toggle {
    display: none;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    cursor: pointer;
}
.topbar-search {
    flex: 1; max-width: 380px;
    position: relative;
}
.topbar-search input {
    width: 100%; padding: 9px 14px 9px 38px;
    border-radius: var(--radius-md); border: 1px solid var(--color-border);
    background: var(--color-bg); font-size: 13.5px;
}
[dir="rtl"] .topbar-search input { padding: 9px 38px 9px 14px; }
.topbar-search svg {
    position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--color-text-subtle);
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    position: relative;
    width: 38px; height: 38px; border-radius: var(--radius-md);
    border: 1px solid var(--color-border); background: var(--color-surface);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--color-text-muted);
}
.icon-btn:hover { background: var(--color-surface-hover); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 7px; inset-inline-end: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--color-danger); border: 1.5px solid #fff; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    min-width: 220px; padding: 8px; z-index: 50;
    display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border-radius: var(--radius-sm); border: none; background: none;
    font-size: 13.5px; color: var(--color-text); text-align: start; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--color-surface-hover); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--color-border); margin: 6px 0; }
.dropdown-header { padding: 8px 10px 4px; font-size: 12px; color: var(--color-text-subtle); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px; border-radius: var(--radius-md); cursor: pointer; }
.user-chip:hover { background: var(--color-surface-hover); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary-light);
    color: var(--color-primary-dark); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.user-chip-role { font-size: 11px; color: var(--color-text-muted); }

.lang-switch { display: flex; gap: 2px; background: var(--color-bg); border-radius: var(--radius-md); padding: 3px; border: 1px solid var(--color-border); }
.lang-switch a { padding: 6px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.lang-switch a.active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }
.lang-switch a:hover { text-decoration: none; }

.content { padding: 24px; flex: 1; }

/* ---------------------------------------------------------------------- */
/* Breadcrumb + page header                                                */
/* ---------------------------------------------------------------------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-subtle); margin-bottom: 10px; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb .sep { opacity: .6; }
.breadcrumb .current { color: var(--color-text); font-weight: 600; }

.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-header h1 { font-size: 21px; margin: 0 0 4px; }
.page-header .page-subtitle { color: var(--color-text-muted); font-size: 13.5px; margin: 0; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                  */
/* ---------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 700;
    border: 1px solid transparent; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-surface-hover); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-hover); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* Cards / stat tiles                                                      */
/* ---------------------------------------------------------------------- */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 15px; margin: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--color-text-muted); }

.stat-icon.tone-primary { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon.tone-success { background: var(--color-success-light); color: var(--color-success); }
.stat-icon.tone-warning { background: var(--color-warning-light); color: var(--color-warning); }
.stat-icon.tone-info { background: var(--color-info-light); color: var(--color-info); }

.placeholder-card { border: 1.5px dashed var(--color-border-strong); border-radius: var(--radius-lg); padding: 18px; background: var(--color-surface-hover); }
.placeholder-card .stat-label { margin-bottom: 4px; }
.placeholder-card .stat-value { color: var(--color-text-subtle); font-size: 15px; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                    */
/* ---------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group.span-2 { grid-column: span 2; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--color-text); }
label .required { color: var(--color-danger); margin-inline-start: 2px; }
.form-hint { font-size: 12px; color: var(--color-text-subtle); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--color-danger); margin-top: 5px; display: flex; align-items: center; gap: 4px; }

input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="number"], input[type="tel"], input[type="search"], input[type="file"],
select, textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md); font-size: 13.5px; background: var(--color-surface);
    color: var(--color-text); font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
input.has-error, select.has-error, textarea.has-error { border-color: var(--color-danger); }
input.has-error:focus, select.has-error:focus { box-shadow: 0 0 0 3px var(--color-danger-light); }
input[disabled], select[disabled] { background: var(--color-bg); color: var(--color-text-subtle); }

.form-section { margin-bottom: 26px; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); }
.form-section-title .step-number {
    width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary-light); color: var(--color-primary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}

.form-actions { display: flex; gap: 10px; justify-content: flex-start; padding-top: 18px; border-top: 1px solid var(--color-border); margin-top: 6px; }
.form-actions.sticky { position: sticky; bottom: 0; background: var(--color-surface); padding: 14px 0; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.photo-upload { display: flex; align-items: center; gap: 16px; }
.photo-preview {
    width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--color-bg);
    border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center;
    color: var(--color-text-subtle); flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------------- */
/* Tables                                                                   */
/* ---------------------------------------------------------------------- */
.table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.table-toolbar .search-box { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.table-toolbar .search-box input { padding-inline-start: 36px; }
.table-toolbar .search-box svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--color-text-subtle); }
.table-toolbar .filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.table-toolbar select { width: auto; min-width: 150px; padding: 9px 12px; }
.table-toolbar-spacer { flex: 1; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
    text-align: start; padding: 12px 16px; background: var(--color-surface-hover);
    color: var(--color-text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--color-surface-hover); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
[dir="rtl"] .row-actions { justify-content: flex-start; }

.cell-primary { font-weight: 700; color: var(--color-text); }
.cell-muted { color: var(--color-text-muted); font-size: 12.5px; }
.cell-with-avatar { display: flex; align-items: center; gap: 10px; }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-info { background: var(--color-info-light); color: var(--color-info); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Pagination                                                               */
/* ---------------------------------------------------------------------- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
.pagination-info { font-size: 12.5px; color: var(--color-text-muted); }
.pagination { display: flex; gap: 4px; }
.pagination a, .pagination span {
    min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700; color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.pagination a:hover { background: var(--color-surface-hover); text-decoration: none; }
.pagination .active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------------------------------------------------------------------- */
/* Empty / loading / error states                                          */
/* ---------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 60px 24px; color: var(--color-text-muted); }
.empty-state .empty-icon {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--color-bg);
    display: flex; align-items: center; justify-content: center; color: var(--color-text-subtle);
}
.empty-state .empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { font-size: 15px; margin-bottom: 6px; color: var(--color-text); }
.empty-state p { font-size: 13px; margin-bottom: 16px; }

.skeleton { background: linear-gradient(90deg, var(--color-border) 25%, #f0f1f4 37%, var(--color-border) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-row td { padding: 14px 16px; }
.skeleton-line { height: 14px; border-radius: 4px; }

.error-state { text-align: center; padding: 60px 24px; }
.error-state .error-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--color-danger-light); color: var(--color-danger); display: flex; align-items: center; justify-content: center; }
.error-state .error-icon svg { width: 30px; height: 30px; }

/* ---------------------------------------------------------------------- */
/* Modal + confirm dialog                                                  */
/* ---------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(17, 20, 33, .55); z-index: 100;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-box { background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-box.modal-lg { max-width: 760px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; cursor: pointer; color: var(--color-text-muted); width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--color-surface-hover); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--color-border); display: flex; gap: 10px; justify-content: flex-start; }

.confirm-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--color-danger-light); color: var(--color-danger); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.confirm-icon svg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------------- */
/* Toasts                                                                   */
/* ---------------------------------------------------------------------- */
.toast-stack { position: fixed; top: 20px; inset-inline-end: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
    animation: toast-in .2s ease;
    border-inline-start: 4px solid var(--color-text-subtle);
}
.toast.toast-success { border-inline-start-color: var(--color-success); }
.toast.toast-error { border-inline-start-color: var(--color-danger); }
.toast.toast-warning { border-inline-start-color: var(--color-warning); }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; }
.toast.toast-success .toast-icon { color: var(--color-success); }
.toast.toast-error .toast-icon { color: var(--color-danger); }
.toast.toast-warning .toast-icon { color: var(--color-warning); }
.toast-message { font-size: 13px; flex: 1; }
.toast-close { border: none; background: none; cursor: pointer; color: var(--color-text-subtle); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------- */
/* Alerts (inline banners)                                                 */
/* ---------------------------------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 16px; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-info { background: var(--color-info-light); color: #155e63; }
.alert-warning { background: var(--color-warning-light); color: #7c4a05; }
.alert-danger { background: var(--color-danger-light); color: #7f1d1d; }

/* ---------------------------------------------------------------------- */
/* Tabs                                                                     */
/* ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 11px 16px; font-size: 13.5px; font-weight: 700; color: var(--color-text-muted); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------------------------------------------------------------- */
/* Auth / guest layout                                                     */
/* ---------------------------------------------------------------------- */
.auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 20% 20%, #4f46e5 0%, #171a2b 55%, #0f1120 100%);
    padding: 20px;
}
.auth-card { width: 100%; max-width: 400px; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 34px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; text-align: center; }
.auth-logo .logo-badge { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--color-primary), #818cf8); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.auth-logo h1 { font-size: 16px; margin: 0; }
.auth-logo p { font-size: 12.5px; color: var(--color-text-muted); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Detail / profile pages                                                  */
/* ---------------------------------------------------------------------- */
.profile-header { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--color-primary-light); color: var(--color-primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; flex-shrink: 0; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta h2 { margin: 0 0 4px; font-size: 19px; }
.profile-meta .meta-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--color-text-muted); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.detail-item .detail-label { font-size: 11.5px; color: var(--color-text-subtle); margin-bottom: 3px; }
.detail-item .detail-value { font-size: 13.5px; font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(100%); }
    [dir="ltr"] .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-inline-start: 0; }
    .topbar-toggle { display: flex; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,17,32,.5); z-index: 39; }
    .sidebar-overlay.open { display: block; }
}

@media (max-width: 720px) {
    .content { padding: 16px; }
    .topbar { padding: 0 14px; gap: 10px; }
    .topbar-search { display: none; }
    .page-header { flex-direction: column; align-items: stretch; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-toolbar .search-box { max-width: none; }

    /* responsive table -> stacked cards */
    table.data-table.responsive-cards thead { display: none; }
    table.data-table.responsive-cards, table.data-table.responsive-cards tbody, table.data-table.responsive-cards tr, table.data-table.responsive-cards td { display: block; width: 100%; }
    table.data-table.responsive-cards tr { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 12px; padding: 6px 4px; }
    table.data-table.responsive-cards td { border-bottom: none; padding: 8px 12px; display: flex; justify-content: space-between; gap: 10px; text-align: end; }
    table.data-table.responsive-cards td::before { content: attr(data-label); font-weight: 700; color: var(--color-text-muted); font-size: 12px; text-align: start; }
    table.data-table.responsive-cards td.cell-actions { justify-content: flex-end; }
    table.data-table.responsive-cards td.cell-actions::before { content: none; }

    .form-grid { grid-template-columns: 1fr; }
    .form-group.span-2 { grid-column: span 1; }
    .auth-card { padding: 24px; }
}
