/* ═══════════════════════════════════════════════════════════════════
   EduAdmin — Custom component styles
   Layout classes supplement Tailwind utility classes.
   Data Grid styles live in the second half of this file.
═══════════════════════════════════════════════════════════════════ */

/* ── Sidebar navigation — exact values from mocks/app.css ───────── */

/* Hide native disclosure triangle on all summary elements */
details > summary { list-style: none; cursor: pointer; user-select: none; }
details > summary::-webkit-details-marker,
details > summary::marker { display: none; }

/* Chevron rotation */
.chevron { transition: transform 0.2s cubic-bezier(0.4,0,0.2,1); }
details[open] > summary .chevron { transform: rotate(180deg); }

/* Submenu entrance animation */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
details[open] .submenu { animation: slideDown 0.15s ease-out; }

/* Sidebar scrollbar */
aside { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.08) transparent; }
aside::-webkit-scrollbar { width: 3px; }
aside::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }

.group-label {
    padding: 16px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.15s;
    text-decoration: none;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.menu-item:hover { color: #1e293b; background: #f1f5f9; }
.menu-item.active { color: #4f46e5; background: #eef2ff; border-left: 2px solid #6366f1; padding-left: 10px; }
.menu-item svg { flex-shrink: 0; }

.submenu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #94a3b8;
    transition: all 0.15s;
    text-decoration: none;
    width: 100%;
}
.submenu-item:hover { color: #334155; background: #f8fafc; }
.submenu-item.active { color: #4f46e5; font-weight: 600; }

.badge-count {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* ═══════════════════════════════════════════════════════════════════
   DATA GRID
   Z-index: 3–16 sticky · 200 dropdowns · 9001 ctx · 99999 toast
═══════════════════════════════════════════════════════════════════ */

/* ── Wrapper + Card ──────────────────────────────────────────────── */
.dg-wrap { margin-top: 20px; }

.dg-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 12px rgba(15,23,42,.04);
    overflow: clip;
    outline: none;
    font-family: inherit;
}
.dg-card:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

/* ── Toolbar ─────────────────────────────────────────────────────── */
.dg-toolbar {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-bottom: 1px solid #f1f5f9;
    background: #fff; flex-wrap: wrap; min-height: 54px;
}
.dg-title { font-size: 14px; font-weight: 700; color: #1e293b; letter-spacing: -.25px; white-space: nowrap; }
.dg-count { font-size: 11px; font-weight: 600; color: #94a3b8; background: #f1f5f9; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.dg-spacer { flex: 1; min-width: 8px; }

/* search */
.dg-search {
    display: flex; align-items: center; gap: 6px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: 0 10px; height: 32px; width: 196px;
    transition: border-color .15s, box-shadow .15s, background .15s, width .2s;
}
.dg-search:focus-within { background: #fff; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); width: 232px; }
.dg-search > svg { width: 13px; height: 13px; color: #94a3b8; flex-shrink: 0; }
.dg-search input { border: none; background: transparent; font-family: inherit; font-size: 13px; color: #1e293b; outline: none; width: 100%; }
.dg-search input::placeholder { color: #94a3b8; }
.dg-search-clear {
    width: 16px; height: 16px; border-radius: 50%; border: none;
    background: #cbd5e1; color: #fff; display: flex; align-items: center;
    justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; transition: background .12s;
}
.dg-search-clear:hover { background: #dc2626; }
.dg-search-clear svg { width: 8px; height: 8px; pointer-events: none; }

/* toolbar separator */
.dg-tb-sep { width: 1px; height: 20px; background: #e2e8f0; flex-shrink: 0; margin: 0 2px; }

/* density switcher */
.dg-dens-group { display: inline-flex; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 7px; padding: 2px; gap: 1px; }
.dg-dens-btn { width: 26px; height: 24px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: #94a3b8; display: flex; align-items: center; justify-content: center; transition: color .12s, background .12s; }
.dg-dens-btn:hover { color: #64748b; background: rgba(0,0,0,.04); }
.dg-dens-btn.is-active { background: #fff; color: #6366f1; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.06); }
.dg-dens-btn svg { width: 12px; height: 12px; pointer-events: none; }

/* icon button */
.dg-icon-btn {
    width: 32px; height: 32px; border: 1px solid transparent;
    background: transparent; border-radius: 7px; cursor: pointer; color: #94a3b8;
    display: flex; align-items: center; justify-content: center;
    transition: color .12s, border-color .12s, background .12s; flex-shrink: 0;
}
.dg-icon-btn:hover { color: #6366f1; background: #f0f0fe; border-color: #c7d2fe; }
.dg-icon-btn.is-active { color: #6366f1; background: #f0f0fe; border-color: #6366f1; }
.dg-icon-btn:disabled { opacity: .35; pointer-events: none; }
.dg-icon-btn svg { width: 14px; height: 14px; pointer-events: none; }

/* text buttons */
.dg-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0 12px; height: 32px; border-radius: 7px;
    border: 1px solid #e2e8f0; background: #fff;
    font-size: 12.5px; font-weight: 500; color: #475569;
    font-family: inherit; cursor: pointer; white-space: nowrap;
    transition: border-color .13s, color .13s, background .13s;
}
.dg-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.dg-btn:hover { border-color: #6366f1; color: #6366f1; background: #f0f0fe; }
.dg-btn.active { border-color: #6366f1; color: #6366f1; background: #f0f0fe; }
.dg-btn-primary { background: #6366f1; color: #fff; border-color: #6366f1; box-shadow: 0 1px 3px rgba(99,102,241,.3); }
.dg-btn-primary:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.dg-btn-label { /* hidden on mobile */ }

/* export anchor + menu */
.dg-export-anchor { position: relative; }
.dg-export-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 4px 8px rgba(15,23,42,.08), 0 12px 24px rgba(15,23,42,.08);
    min-width: 200px; z-index: 200; padding: 5px; animation: dg-pop .12s ease;
}
.dg-export-scope { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.dg-export-scope label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #334155; cursor: pointer; }
.dg-export-scope input[type=radio] { accent-color: #6366f1; }

/* column picker anchor */
.dg-col-anchor { position: relative; }

/* ── Active filter bar ───────────────────────────────────────────── */
.dg-filter-bar { display: flex; align-items: center; gap: 8px; padding: 7px 16px; background: #fafafe; border-bottom: 1px solid #c7d2fe; flex-wrap: wrap; }
.dg-filter-bar-icon { width: 12px; height: 12px; color: #6366f1; flex-shrink: 0; opacity: .6; }
.dg-filter-bar-pills { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; align-items: center; }
.dg-af-pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px 2px 8px; border-radius: 6px; font-size: 12px; background: #fff; border: 1px solid #c7d2fe; color: #334155; }
.dg-af-pill strong { font-weight: 700; color: #6366f1; }
.dg-af-pill-sep { color: #94a3b8; }
.dg-af-pill button { width: 15px; height: 15px; border-radius: 4px; border: none; background: transparent; color: #94a3b8; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; margin-left: 1px; transition: color .1s, background .1s; }
.dg-af-pill button:hover { background: #fee2e2; color: #dc2626; }
.dg-af-pill button svg { width: 8px; height: 8px; pointer-events: none; }
.dg-filter-bar-clear { font-size: 11.5px; font-weight: 600; color: #94a3b8; background: none; border: none; cursor: pointer; padding: 3px 8px; border-radius: 5px; transition: color .1s, background .1s; margin-left: auto; white-space: nowrap; }
.dg-filter-bar-clear:hover { color: #dc2626; background: #fef2f2; }

/* ── Bulk action bar ─────────────────────────────────────────────── */
.dg-bulk { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: #f0f0fe; border-bottom: 1px solid #c7d2fe; flex-wrap: wrap; }
.dg-bulk.is-visible { display: flex; }
.dg-bulk-count { font-size: 12.5px; font-weight: 600; color: #6366f1; }
.dg-bulk-sep { width: 1px; height: 16px; background: #c7d2fe; flex-shrink: 0; }
.dg-bulk-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 6px; font-size: 12px; font-weight: 500; font-family: inherit; border: 1px solid #c7d2fe; background: #fff; color: #475569; cursor: pointer; transition: all .12s; }
.dg-bulk-btn:hover { border-color: #6366f1; color: #6366f1; background: #f0f0fe; }
.dg-bulk-btn.danger { border-color: rgba(220,38,38,.25); color: #dc2626; }
.dg-bulk-btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.dg-bulk-btn svg { width: 12px; height: 12px; }
.dg-bulk-selall { background: #6366f1 !important; color: #fff !important; border-color: #6366f1 !important; font-weight: 600 !important; }
.dg-bulk-selall:hover { background: #4f46e5 !important; }

/* ── Table wrapper + scrollbar ───────────────────────────────────── */
.dg-table-wrap { overflow-x: auto; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent; }
.dg-table-wrap::-webkit-scrollbar { width: 5px; height: 5px; }
.dg-table-wrap::-webkit-scrollbar-track { background: transparent; }
.dg-table-wrap::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.dg-table-wrap::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ── Table base ──────────────────────────────────────────────────── */
table.dg { width: 100%; border-collapse: collapse; font-size: 13.5px; font-family: inherit; }
table.dg tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .08s; }
table.dg tbody tr:last-child { border-bottom: none; }
table.dg td { padding: 10px 14px; color: #334155; vertical-align: middle; background: #fff; transition: background .08s; }

/* row states */
table.dg tbody tr:hover td              { background: #f8fafc; }
table.dg tbody tr:hover td.dg-check    { background: #f8fafc !important; }
table.dg tbody tr:hover td.dg-col-exp  { background: #f8fafc !important; }
table.dg tbody tr:hover td.dg-pinned   { background: #f8fafc !important; }
table.dg tbody tr.is-selected td            { background: #eef2ff; }
table.dg tbody tr.is-selected td.dg-check   { background: #eef2ff; }
table.dg tbody tr.is-selected td.dg-col-exp { background: #eef2ff; }
table.dg tbody tr.is-selected td.dg-pinned  { background: #eef2ff; }

/* ── Sticky columns ──────────────────────────────────────────────── */
table.dg thead tr { background: transparent; }
table.dg thead th { position: sticky; top: 0; z-index: 12; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }

table.dg th.dg-check, table.dg td.dg-check { position: sticky; left: 0; z-index: 3; width: 40px; text-align: center; background: #fff; }
table.dg thead th.dg-check { z-index: 16; background: #f8fafc; }
table.dg tr.is-selected td.dg-check { background: #eef2ff; }

table.dg th.dg-col-exp, table.dg td.dg-col-exp { position: sticky; left: 40px; z-index: 3; width: 36px; min-width: 36px; max-width: 36px; padding: 0 4px; text-align: center; background: #fff; }
table.dg thead th.dg-col-exp { z-index: 16; background: #f8fafc; }
table.dg tr.is-selected td.dg-col-exp { background: #eef2ff; }

table.dg td.dg-pinned, table.dg th.dg-pinned { position: sticky; z-index: 3; background: #fff; }
table.dg thead th.dg-pinned { z-index: 13; background: #f8fafc; }
table.dg tr.is-selected td.dg-pinned { background: #eef2ff; }

.dg-pin-shadow { position: absolute; right: -8px; top: 0; bottom: 0; width: 8px; pointer-events: none; background: linear-gradient(to right, rgba(15,23,42,.06), transparent); }
.dg-pin-icon { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border-radius: 3px; background: #eef2ff; color: #6366f1; margin-left: 3px; flex-shrink: 0; vertical-align: middle; }
.dg-pin-icon svg { width: 8px; height: 8px; }

/* ── Column headers ──────────────────────────────────────────────── */
table.dg th { padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; user-select: none; position: relative; }
table.dg th.sort-asc, table.dg th.sort-desc { color: #6366f1; }
table.dg th .th-inner { display: inline-flex; align-items: center; gap: 4px; }
table.dg th .th-inner.sortable { cursor: pointer; transition: color .12s; }
table.dg th .th-inner.sortable:hover { color: #334155; }
table.dg th.sort-asc .th-inner.sortable,
table.dg th.sort-desc .th-inner.sortable { color: #6366f1; }
table.dg th .sort-icon { width: 10px; height: 10px; opacity: .25; transition: opacity .12s; flex-shrink: 0; }
table.dg th.sort-asc .sort-icon, table.dg th.sort-desc .sort-icon { opacity: 1; color: #6366f1; }
table.dg th.sort-desc .sort-icon { transform: rotate(180deg); }

.th-drag-handle { display: inline-flex; align-items: center; color: #cbd5e1; cursor: grab; margin-right: 2px; flex-shrink: 0; opacity: 0; transition: opacity .12s; }
table.dg th:hover .th-drag-handle { opacity: 1; }
.th-drag-handle:hover { color: #6366f1; }
.th-drag-handle svg { width: 10px; height: 10px; pointer-events: none; }
table.dg th[draggable] { cursor: default; }
table.dg th.drag-over { background: #eef2ff; outline: 2px dashed #6366f1; outline-offset: -3px; }

.th-filter-wrap { position: relative; display: inline-flex; align-items: center; }
.th-filt-btn { width: 18px; height: 18px; border-radius: 4px; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: #cbd5e1; cursor: pointer; flex-shrink: 0; margin-left: 2px; transition: background .1s, color .1s; }
.th-filt-btn:hover, .th-filt-btn.has-filter { color: #6366f1; background: #eef2ff; }
.th-filt-btn svg { width: 9px; height: 9px; }

.dg-resize-h { position: absolute; right: -3px; top: 20%; bottom: 20%; width: 6px; cursor: col-resize; z-index: 20; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.dg-resize-h::after { content: ""; width: 2px; height: 100%; background: #6366f1; border-radius: 2px; }
table.dg th:hover .dg-resize-h { opacity: .4; }
table.dg th:hover .dg-resize-h:hover { opacity: 1; }
table.dg.is-resizing { cursor: col-resize; user-select: none; }
table.dg.is-resizing * { pointer-events: none; }
table.dg.is-resizing .dg-resize-h { pointer-events: all; }

.dg-sort-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 14px; height: 14px; background: #6366f1; color: #fff; font-size: 8.5px; font-weight: 800; border-radius: 3px; padding: 0 3px; margin-left: 1px; vertical-align: middle; flex-shrink: 0; }

/* ── Density ─────────────────────────────────────────────────────── */
table.dg.dg-compact td, table.dg.dg-compact th { padding: 5px 10px; font-size: 12px; }
table.dg.dg-compact .dg-user-av { width: 24px; height: 24px; font-size: 9px; }
table.dg.dg-comfortable td, table.dg.dg-comfortable th { padding: 15px 14px; }
table.dg.dg-comfortable .dg-user-av { width: 40px; height: 40px; font-size: 14px; }

/* ── Striped ─────────────────────────────────────────────────────── */
table.dg.dg-striped tbody tr:nth-child(even):not(.is-selected):not(.dg-detail-row) td { background: #fcfcfd; }

/* ── Expand button ───────────────────────────────────────────────── */
.dg-expand-btn { width: 20px; height: 20px; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; color: #94a3b8; transition: background .1s, color .1s, transform .16s; flex-shrink: 0; }
.dg-expand-btn:hover { background: #f1f5f9; color: #6366f1; }
.dg-expand-btn.is-open { color: #6366f1; transform: rotate(90deg); }
.dg-expand-btn svg { width: 12px; height: 12px; pointer-events: none; }

/* ── Row detail panel ────────────────────────────────────────────── */
.dg-detail-row > td { padding: 0 !important; background: #f8fafc !important; }
.dg-detail-panel { padding: 20px 20px 20px 80px; border-bottom: 2px solid #c7d2fe; animation: dg-expand .16s ease; }
@keyframes dg-expand { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dg-detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.dg-detail-av { width: 50px; height: 50px; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.dg-detail-name { font-size: 15px; font-weight: 700; color: #1e293b; }
.dg-detail-sub  { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.dg-detail-badges { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dg-detail-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px 24px; }
.dg-detail-field > label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #94a3b8; margin-bottom: 4px; }
.dg-detail-field .dg-fval { font-size: 13.5px; color: #1e293b; font-weight: 500; }
.dg-detail-field .dg-prog { margin-top: 2px; }

/* ── Cell types ──────────────────────────────────────────────────── */
.dg-user { display: flex; align-items: center; gap: 10px; }
.dg-user-av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.dg-user-email { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.dg-name-link { font-size: 13.5px; font-weight: 600; color: #1e293b; text-decoration: none; display: block; transition: color .12s; }
.dg-name-link:hover { color: #6366f1; text-decoration: underline; text-decoration-color: #c7d2fe; }

.dg-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.dg-status .s-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dg-status.active   { background: #d1fae5; color: #059669; }
.dg-status.active   .s-dot { background: #059669; }
.dg-status.pending  { background: #fef3c7; color: #d97706; }
.dg-status.pending  .s-dot { background: #f59e0b; }
.dg-status.inactive { background: #f1f5f9; color: #64748b; }
.dg-status.inactive .s-dot { background: #94a3b8; }
.dg-status.blocked  { background: #fee2e2; color: #dc2626; }
.dg-status.blocked  .s-dot { background: #ef4444; }

.dg-role { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; }
.dg-role.admin   { background: #eef2ff; color: #6366f1; }
.dg-role.editor  { background: #ede9fe; color: #7c3aed; }
.dg-role.viewer  { background: #d1fae5; color: #059669; }
.dg-role.manager { background: #fef3c7; color: #d97706; }

.dg-priority { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.dg-priority svg { width: 12px; height: 12px; }
.dg-priority.high   { color: #dc2626; }
.dg-priority.medium { color: #d97706; }
.dg-priority.low    { color: #0d9488; }

.dg-prog { display: flex; align-items: center; gap: 8px; }
.dg-prog-bar { flex: 1; height: 4px; background: #f1f5f9; border-radius: 20px; overflow: hidden; min-width: 56px; }
.dg-prog-fill { height: 100%; border-radius: 20px; transition: width .4s ease; }
.dg-prog-val { font-size: 12px; font-weight: 600; color: #94a3b8; white-space: nowrap; min-width: 32px; text-align: right; }

.dg-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .1s; }
table.dg tbody tr:hover .dg-actions { opacity: 1; }
.dg-action { width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: #94a3b8; cursor: pointer; transition: background .1s, color .1s; }
.dg-action:hover { background: #f1f5f9; color: #334155; }
.dg-action.danger:hover { background: #fee2e2; color: #dc2626; }
.dg-action svg { width: 13px; height: 13px; }
.dg-check input[type=checkbox] { accent-color: #6366f1; width: 14px; height: 14px; cursor: pointer; }

/* ── Loading skeleton ────────────────────────────────────────────── */
@keyframes dg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.dg-skel { height: 11px; border-radius: 5px; background: linear-gradient(90deg, #f1f5f9 25%, #e8edf3 50%, #f1f5f9 75%); background-size: 200% 100%; animation: dg-shimmer 1.6s infinite linear; }
.dg-skeleton-row:hover td { background: transparent !important; }
.dg-skeleton-row td { padding: 10px 14px; }
.dg-skeleton-row:nth-child(odd) .dg-skel { opacity: .65; }

/* ── Empty state ─────────────────────────────────────────────────── */
.dg-empty { padding: 64px 20px; text-align: center; }
.dg-empty svg { width: 40px; height: 40px; color: #cbd5e1; margin-bottom: 12px; }
.dg-empty h4 { font-size: 14.5px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.dg-empty p  { font-size: 13px; color: #94a3b8; }

/* ── Summary row (tfoot) ─────────────────────────────────────────── */
table.dg tfoot { border-top: 1px solid #e2e8f0; }
.dg-summary-row td { padding: 7px 14px !important; background: #f8fafc !important; position: sticky; bottom: 0; z-index: 11; border-top: 1px solid #e2e8f0; }
table.dg tfoot td.dg-check, table.dg tfoot td.dg-col-exp { position: sticky; z-index: 14; background: #f8fafc !important; }
.dg-summary-row td.dg-pinned { z-index: 14; background: #f8fafc !important; }
.dg-sum-label { display: block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 1px; }
.dg-sum-val { display: block; font-size: 13px; font-weight: 700; color: #6366f1; font-variant-numeric: tabular-nums; }

/* ── Inline editing ──────────────────────────────────────────────── */
table.dg td:not(.dg-check):not(.dg-col-exp):not([data-col="actions"]) { position: relative; }
.dg-cell-editing { background: #eef2ff !important; padding: 3px 6px !important; }
.dg-edit-input { width: 100%; border: 2px solid #6366f1; border-radius: 5px; padding: 4px 8px; font-family: inherit; font-size: 13px; color: #1e293b; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.dg-edit-input[type=number] { -moz-appearance: textfield; }
.dg-edit-input[type=number]::-webkit-inner-spin-button { opacity: .5; }

/* ── Status bar ──────────────────────────────────────────────────── */
.dg-statusbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 5px 16px; border-top: 1px solid #f1f5f9; background: #fafafa; font-size: 11px; color: #94a3b8; }
.dg-sb-item { display: flex; align-items: center; gap: 4px; }
.dg-sb-item strong { color: #64748b; font-weight: 600; font-variant-numeric: tabular-nums; }
.dg-sb-dot { width: 3px; height: 3px; border-radius: 50%; background: #e2e8f0; }
.dg-sb-item.sb-filtered strong { color: #6366f1; }
.dg-sb-item.sb-selected strong { color: #059669; }

/* ── Pagination ──────────────────────────────────────────────────── */
.dg-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid #f1f5f9; flex-wrap: wrap; gap: 10px; background: #fff; }
.dg-foot-info { font-size: 12.5px; color: #94a3b8; }
.dg-foot-info strong { color: #334155; font-weight: 600; }
.dg-foot-sep { margin: 0 7px; color: #cbd5e1; }
.dg-foot-clear { font-size: 12px; font-weight: 600; color: #6366f1; background: none; border: none; cursor: pointer; padding: 4px 9px; border-radius: 7px; font-family: inherit; transition: background 0.12s; }
.dg-foot-clear:hover { background: #eef2ff; }
.dg-per-page { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #94a3b8; }
.dg-per-page select { border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 8px; font-family: inherit; font-size: 12.5px; color: #334155; background: #fff; outline: none; cursor: pointer; transition: border-color .12s; }
.dg-per-page select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
.dg-pagination { display: flex; align-items: center; gap: 2px; }
.dg-page-btn { min-width: 30px; height: 30px; padding: 0 7px; border-radius: 6px; border: 1px solid transparent; background: transparent; font-size: 12.5px; font-weight: 500; color: #64748b; font-family: inherit; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .12s; }
.dg-page-btn:hover:not(:disabled) { background: #f1f5f9; color: #1e293b; }
.dg-page-btn.active { background: #6366f1; color: #fff; box-shadow: 0 1px 3px rgba(99,102,241,.35); }
.dg-page-btn:disabled { opacity: .3; cursor: not-allowed; }
.dg-page-btn svg { width: 10px; height: 10px; }
.dg-jump { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; }
.dg-jump input { width: 42px; height: 28px; border: 1px solid #e2e8f0; border-radius: 6px; text-align: center; font-size: 12px; font-family: inherit; color: #334155; background: #fff; outline: none; transition: border-color .12s; }
.dg-jump input:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.1); }

/* ── Column picker panel ─────────────────────────────────────────── */
.dg-col-panel { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px; min-width: 210px; box-shadow: 0 4px 8px rgba(15,23,42,.06), 0 12px 28px rgba(15,23,42,.1); z-index: 200; animation: dg-pop .12s ease; }
.dg-col-panel.is-open { display: block; }
.dg-col-panel-title { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .07em; padding: 4px 8px 8px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.dg-col-item { display: flex; align-items: center; border-radius: 6px; transition: background .1s; }
.dg-col-item:hover { background: #f8fafc; }
.dg-col-item-check { display: flex; align-items: center; gap: 8px; padding: 7px 10px; flex: 1; cursor: pointer; }
.dg-col-item input[type=checkbox] { accent-color: #6366f1; width: 13px; height: 13px; cursor: pointer; flex-shrink: 0; }
.dg-col-item-name { flex: 1; font-size: 13px; color: #334155; }
.dg-col-filter-dot { width: 6px; height: 6px; border-radius: 50%; background: #6366f1; flex-shrink: 0; margin-left: 2px; display: none; }
.dg-col-filter-dot.is-active { display: block; }
.dg-col-filt-btn { width: 28px; height: 32px; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: #94a3b8; cursor: pointer; flex-shrink: 0; border-radius: 5px; transition: background .1s, color .1s; }
.dg-col-filt-btn:hover { background: #eef2ff; color: #6366f1; }
.dg-col-filt-btn.has-filter { color: #6366f1; }
.dg-col-filt-btn svg { width: 11px; height: 11px; pointer-events: none; }
.dg-col-filt-panel { position: absolute; right: calc(100% + 8px); top: 0; z-index: 400; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 4px 8px rgba(15,23,42,.06), 0 12px 28px rgba(15,23,42,.1); min-width: 232px; display: none; animation: dg-pop .12s ease; overflow: hidden; font-family: inherit; font-size: 13px; color: #334155; text-transform: none; letter-spacing: normal; font-weight: 400; white-space: normal; }
.dg-col-filt-panel.is-open { display: block; }

/* ── Filter panel ────────────────────────────────────────────────── */
.col-filter-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 200; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 4px 8px rgba(15,23,42,.06), 0 12px 28px rgba(15,23,42,.1); min-width: 236px; display: none; animation: dg-pop .12s ease; overflow: hidden; font-family: inherit; font-size: 13px; color: #334155; text-transform: none; letter-spacing: normal; font-weight: 400; white-space: normal; }
.col-filter-panel.is-open { display: block; }

.cfp-head { padding: 10px 14px 9px; border-bottom: 1px solid #f1f5f9; }
.cfp-head-title { font-size: 10.5px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; font-family: inherit; }
.cfp-search { display: flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 10px; transition: border-color .12s; }
.cfp-search:focus-within { border-color: #6366f1; background: #fff; }
.cfp-search svg { width: 12px; height: 12px; color: #94a3b8; flex-shrink: 0; }
.cfp-search input { border: none; background: transparent; font-family: inherit; font-size: 13px; color: #334155; outline: none; width: 100%; }
.cfp-search input::placeholder { color: #94a3b8; }
.cfp-select-all { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-bottom: 1px solid #f1f5f9; font-size: 12.5px; color: #64748b; cursor: pointer; background: #fff; font-family: inherit; user-select: none; transition: background .08s; }
.cfp-select-all:hover { background: #f8fafc; color: #334155; }
.cfp-select-all input[type=checkbox] { accent-color: #6366f1; width: 13px; height: 13px; cursor: pointer; }
.cfp-list { max-height: 192px; overflow-y: auto; scrollbar-width: thin; }
.cfp-list::-webkit-scrollbar { width: 4px; }
.cfp-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }
.cfp-option { display: flex; align-items: center; gap: 9px; padding: 7px 14px; font-size: 12.5px; color: #334155; cursor: pointer; transition: background .08s; user-select: none; font-family: inherit; }
.cfp-option:hover { background: #f8fafc; }
.cfp-option input[type=checkbox] { accent-color: #6366f1; width: 13px; height: 13px; cursor: pointer; flex-shrink: 0; }
.cfp-option-label { flex: 1; display: flex; align-items: center; gap: 7px; }
.cfp-option-count { font-size: 10.5px; font-weight: 500; color: #94a3b8; background: #f1f5f9; padding: 1px 6px; border-radius: 10px; flex-shrink: 0; }
.cfp-foot { display: flex; gap: 6px; padding: 9px 12px; border-top: 1px solid #f1f5f9; background: #fafafa; }
.cfp-apply { flex: 1; padding: 6px 12px; border-radius: 6px; background: #6366f1; color: #fff; border: none; font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .12s; }
.cfp-apply:hover { background: #4f46e5; }
.cfp-clear { padding: 6px 12px; border-radius: 6px; background: transparent; border: 1px solid #e2e8f0; font-size: 12.5px; font-weight: 500; font-family: inherit; color: #64748b; cursor: pointer; transition: all .12s; }
.cfp-clear:hover { border-color: #dc2626; color: #dc2626; }
.cfp-advanced { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.cfp-input-row { display: flex; flex-direction: column; gap: 5px; }
.cfp-input-label { font-size: 10.5px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.cfp-op-select { width: 100%; border: 1px solid #e2e8f0; border-radius: 6px; padding: 7px 28px 7px 10px; font-family: inherit; font-size: 13px; color: #334155; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 10px center; outline: none; cursor: pointer; appearance: none; transition: border-color .12s; }
.cfp-op-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
.cfp-adv-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 6px; padding: 7px 10px; font-family: inherit; font-size: 13px; color: #334155; background: #fff; outline: none; transition: border-color .12s; }
.cfp-adv-input:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
.cfp-adv-input::placeholder { color: #94a3b8; }
.cfp-input-between { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.cfp-between-sep { font-size: 12px; color: #94a3b8; text-align: center; }
.cfp-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.cfp-preset { font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 20px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; font-family: inherit; transition: all .1s; }
.cfp-preset:hover { border-color: #6366f1; color: #6366f1; background: #eef2ff; }
.cfp-preset.active { border-color: #6366f1; color: #6366f1; background: #eef2ff; font-weight: 600; }
.cfp-divider { height: 1px; background: #f1f5f9; margin: 0; }

/* ── Context menu ────────────────────────────────────────────────── */
.dg-ctx-overlay { position: fixed; inset: 0; z-index: 9000; }
.dg-ctx-menu { position: fixed; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 4px 8px rgba(15,23,42,.08), 0 16px 32px rgba(15,23,42,.12); padding: 4px; min-width: 196px; z-index: 9001; animation: dg-pop .1s ease; }
.dg-ctx-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: #334155; font-size: 13px; font-family: inherit; text-align: left; transition: background .08s, color .08s; }
.dg-ctx-btn:hover { background: #f8fafc; color: #1e293b; }
.dg-ctx-btn.danger:hover { background: #fee2e2; color: #dc2626; }
.dg-ctx-btn svg { width: 14px; height: 14px; flex-shrink: 0; color: #94a3b8; }
.dg-ctx-sep { height: 1px; background: #f1f5f9; margin: 3px 0; }

/* ── Toast ───────────────────────────────────────────────────────── */
.dg-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px); background: #1e293b; color: #e2e8f0; padding: 9px 16px 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 16px rgba(15,23,42,.2); z-index: 99999; pointer-events: none; opacity: 0; transition: opacity .2s ease, transform .2s ease; white-space: nowrap; }
.dg-toast.is-in { opacity: 1; transform: translateX(-50%) translateY(0); }
.dg-toast svg { width: 15px; height: 15px; color: #34d399; flex-shrink: 0; }

/* ── Fullscreen ──────────────────────────────────────────────────── */
.dg-card.is-fullscreen { position: fixed !important; inset: 0 !important; z-index: 850; border-radius: 0 !important; box-shadow: none !important; overflow: hidden; display: flex; flex-direction: column; }
.dg-card.is-fullscreen .dg-table-wrap { flex: 1; min-height: 0; max-height: none !important; }
.dg-card.is-fullscreen .dg-statusbar, .dg-card.is-fullscreen .dg-foot { flex-shrink: 0; }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes dg-pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) { .dg-search { width: 170px; } .dg-search:focus-within { width: 200px; } }
@media (max-width: 900px)  { .dg-dens-group { display: none; } .dg-jump { display: none; } }
@media (max-width: 720px)  { .dg-toolbar { padding: 8px 12px; gap: 5px; min-height: 48px; } .dg-count { display: none; } .dg-btn-label { display: none; } .dg-search { width: 140px; } .dg-search:focus-within { width: 170px; } }
@media (max-width: 640px)  { .dg-foot { flex-wrap: wrap; row-gap: 8px; } .dg-per-page { order: 2; } .dg-foot-info { order: 3; width: 100%; text-align: center; } .dg-pagination { order: 1; width: 100%; justify-content: center; } .dg-table-wrap { -webkit-overflow-scrolling: touch; } .dg-statusbar { padding: 4px 12px; font-size: 10.5px; } }

/* ── Mobile card layout ──────────────────────────────────────────── */
@media (max-width: 580px) {
    .dg-table-wrap { overflow-x: visible; }
    table.dg { display: block; min-width: 0; }
    table.dg thead, table.dg tfoot { display: none; }
    table.dg tbody { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
    table.dg tbody tr { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.05); transition: box-shadow .12s; }
    table.dg tbody tr:hover { box-shadow: 0 4px 12px rgba(15,23,42,.1); }
    table.dg tbody tr.is-selected { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.18); }
    table.dg tbody tr td { display: flex !important; flex-direction: column !important; padding: 10px 12px !important; border-bottom: 1px solid #f1f5f9; position: static !important; background: transparent !important; min-width: 0 !important; max-width: none !important; transition: none !important; }
    table.dg tbody tr td:last-child { border-bottom: none; }
    table.dg tbody tr td::before { content: attr(data-label); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin-bottom: 4px; }
    table.dg tbody tr td.dg-check, table.dg tbody tr td.dg-col-exp { flex-direction: row !important; align-items: center !important; padding: 8px 12px !important; border-bottom: none; background: #f8fafc !important; }
    table.dg tbody tr td.dg-check { grid-column: 1; grid-row: 1; }
    table.dg tbody tr td.dg-col-exp { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    table.dg tbody tr td.dg-check::before, table.dg tbody tr td.dg-col-exp::before { display: none; }
    table.dg tbody tr td[data-col="name"] { grid-column: 1 / -1; }
    table.dg tbody tr td[data-col="actions"] { grid-column: 1 / -1; flex-direction: row !important; align-items: center; background: #f8fafc !important; border-top: 1px solid #f1f5f9 !important; }
    table.dg tbody tr td[data-col="actions"]::before { display: none; }
    table.dg tbody tr td[data-col="actions"] .dg-actions { opacity: 1; }
    table.dg tbody tr .dg-pin-shadow { display: none; }
    table.dg tbody tr.dg-detail-row { display: block; }
    table.dg tbody tr.dg-skeleton-row { display: none; }
    .dg-card.is-fullscreen table.dg { display: table; }
    .dg-card.is-fullscreen table.dg thead { display: table-header-group; }
    .dg-card.is-fullscreen table.dg tbody { display: table-row-group; padding: 0; gap: 0; flex-direction: unset; }
    .dg-card.is-fullscreen table.dg tbody tr { display: table-row; border: none; border-radius: 0; box-shadow: none; }
    .dg-card.is-fullscreen table.dg tbody td { display: table-cell !important; flex-direction: unset !important; }
    .dg-card.is-fullscreen table.dg tbody td::before { display: none; }
}

/* ── Students DataGrid — grid-specific styles ── */
.th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; background: #f8fafc; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 4; user-select: none; }
.th.sortable { cursor: pointer; }
.th.sortable:hover { background: #f1f5f9; color: #334155; }
.th.sort-active { color: #6366f1; }
/* overflow:hidden clips content to the fixed colgroup widths (virtualized table) */
.td { padding: 12px 12px; border-bottom: 1px solid #f8fafc; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: #475569; background: #fff; }
.tr:hover .td { background: #eef2ff; }
.tr.selected .td { background: #f5f3ff; }
.tr.selected:hover .td { background: #ede9fe; }
/* Zebra striping (always on) keyed off the data-row index — virtualized rows
   aren't contiguous nth-children; yields to hover + selection so those win. */
#grid-card .tr.dg-stripe:not(.selected):not(:hover) .td { background: #f8fafc; }
/* Sort icons */
.sort-icon { display: inline-flex; flex-direction: column; gap: 1px; margin-left: 5px; opacity: 0.3; vertical-align: middle; }
.sort-icon.asc, .sort-icon.desc { opacity: 1; }
/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.badge-active { background: #f0fdf4; color: #16a34a; }
.badge-pending { background: #fffbeb; color: #b45309; }
.badge-suspended { background: #fef2f2; color: #dc2626; }
.badge-graduated { background: #eff6ff; color: #1d4ed8; }
/* GPA */
.gpa-high { color: #16a34a; font-weight: 700; }
.gpa-mid  { color: #d97706; font-weight: 700; }
.gpa-low  { color: #dc2626; font-weight: 700; }
/* Attendance bar */
.att-wrap { display: flex; flex-direction: column; gap: 3px; }
.att-bar { height: 3px; border-radius: 2px; background: #e2e8f0; overflow: hidden; }
.att-fill { height: 100%; border-radius: 2px; }
/* th inner */
.th-inner { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.th-label { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
/* Drag handle — revealed on header hover so it doesn't crowd the label */
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 0; height: 22px; overflow: hidden; opacity: 0; border-radius: 6px; color: #94a3b8; cursor: grab; transition: width 0.15s, opacity 0.15s, background 0.15s, color 0.15s; flex-shrink: 0; }
.th:hover .drag-handle { width: 22px; opacity: 1; }
.drag-handle:hover { background: #e2e8f0; color: #334155; }
.drag-handle:active { cursor: grabbing; }
.th.is-dragging { opacity: 0.4; background: #eef2ff; }
.th.drop-left  { box-shadow: inset  3px 0 0 #6366f1; background: #f5f3ff; }
.th.drop-right { box-shadow: inset -3px 0 0 #6366f1; background: #f5f3ff; }
/* Filter btn — overlaid at the header's right edge, revealed on hover or when a
   filter is active, so it doesn't eat label width in narrow columns. */
.filter-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent; cursor: pointer; color: #94a3b8; opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.th:hover .filter-btn, .filter-btn.is-filtered { opacity: 1; }
.filter-btn:hover { background: #e2e8f0; color: #334155; }
.filter-btn.is-filtered { color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 1px #c7d2fe; }
.filter-dot { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; background: #6366f1; border-radius: 9999px; border: 1.5px solid #fff; }
/* Filter chips */
.filter-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 500; color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; white-space: nowrap; }
.chip-x { display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 3px; color: #818cf8; cursor: pointer; transition: all 0.1s; }
.chip-x:hover { background: #c7d2fe; color: #4338ca; }
/* Density */
.density-group { display: flex; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #f8fafc; }
.density-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; background: transparent; color: #94a3b8; cursor: pointer; transition: all 0.15s; position: relative; }
.density-btn:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 20%; height: 60%; width: 1px; background: #e2e8f0; }
.density-btn:hover:not(.active) { color: #475569; background: rgba(0,0,0,0.03); }
.density-btn.active { background: #fff; color: #6366f1; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
/* Row density */
#grid-card.density-compact .td { padding-top: 5px; padding-bottom: 5px; }
#grid-card.density-compact .td img { width: 24px !important; height: 24px !important; border-radius: 6px !important; }
#grid-card.density-comfortable .td { padding-top: 18px; padding-bottom: 18px; }
#grid-card.density-comfortable .td img { width: 38px !important; height: 38px !important; border-radius: 10px !important; }
/* Fullscreen */
#grid-card:fullscreen { border-radius: 0 !important; }
#grid-card:-webkit-full-screen { border-radius: 0 !important; }
/* Pagination */
.pg-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid #e2e8f0; background: #fff; color: #64748b; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.pg-btn:hover:not(:disabled) { background: #f8fafc; color: #1e293b; }
.pg-btn.active { background: #6366f1; border-color: #6366f1; color: #fff; }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* Ghost scrollbar */
.grid-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 0.3s; }
.grid-scroll:hover { scrollbar-color: rgba(0,0,0,0.12) transparent; }
.grid-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.grid-scroll::-webkit-scrollbar-track { background: transparent; }
.grid-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 9999px; }
.grid-scroll:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
.grid-scroll::-webkit-scrollbar-corner { background: transparent; }
/* Custom select dropdowns */
.csel { position: relative; display: inline-block; }
.csel-btn { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; cursor: pointer; font-size: 13px; color: #475569; transition: all 0.15s; white-space: nowrap; font-family: inherit; }
.csel-btn:hover { background: #fff; border-color: #94a3b8; color: #1e293b; }
.csel.open .csel-btn { background: #fff; border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(165,180,252,0.2); color: #1e293b; }
.csel-chevron { margin-left: 4px; transition: transform 0.15s; color: #cbd5e1; flex-shrink: 0; }
.csel.open .csel-chevron { transform: rotate(180deg); }
.csel-menu { display: none; position: absolute; top: calc(100% + 5px); left: 0; min-width: 100%; background: #fff; border: 1px solid #e8edf3; border-radius: 13px; box-shadow: 0 10px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05); padding: 5px; z-index: 200; }
.csel-menu.right { left: auto; right: 0; }
.csel.open .csel-menu { display: block; animation: slideDown 0.12s ease-out; }
.csel-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: #475569; cursor: pointer; border: none; background: none; text-align: left; transition: background 0.1s; font-family: inherit; }
.csel-opt:hover { background: #f8fafc; color: #1e293b; }
.csel-opt.sel { color: #4f46e5; font-weight: 600; }
.csel-check { margin-left: auto; flex-shrink: 0; color: #6366f1; opacity: 0; }
.csel-opt.sel .csel-check { opacity: 1; }
.csel-sep { height: 1px; background: #f1f5f9; margin: 4px 0; }
.sdot { width: 7px; height: 7px; border-radius: 9999px; flex-shrink: 0; display: inline-block; }
/* Column picker panel */
.cp { position: fixed; z-index: 9999; width: 340px; background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.06); display: none; overflow: hidden; flex-direction: column; }
.cp.open { display: flex; animation: slideDown 0.15s ease-out; }
.cp-head { padding: 14px 16px 10px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.cp-search-wrap { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; position: relative; }
.cp-search-inp { width: 100%; padding: 7px 10px 7px 32px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 13px; color: #374151; outline: none; background: #f8fafc; transition: all 0.15s; font-family: inherit; box-sizing: border-box; }
.cp-search-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(165,180,252,0.2); background: #fff; }
.cp-body { overflow-y: auto; max-height: 420px; padding: 8px; scrollbar-width: thin; }
.cp-body::-webkit-scrollbar { width: 3px; }
.cp-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }
.cp-foot { padding: 10px 14px; border-top: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: #fafafa; }
.cp-group { margin-bottom: 6px; }
.cp-group-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 4px; }
.cp-group-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.cp-group-count { font-size: 10px; font-weight: 600; color: #94a3b8; }
.cp-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background 0.1s; }
.cp-card:hover { background: #f8fafc; }
.cp-card.cp-fixed { opacity: 0.5; cursor: not-allowed; }
.cp-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-info { flex: 1; min-width: 0; }
.cp-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.cp-desc { font-size: 11px; color: #94a3b8; margin-top: 1px; }
/* Toggle switch */
.tog { position: relative; display: inline-flex; flex-shrink: 0; }
.tog input { position: absolute; opacity: 0; width: 0; height: 0; }
.tog-track { width: 34px; height: 19px; border-radius: 999px; background: #e2e8f0; transition: background 0.2s; cursor: pointer; display: flex; align-items: center; padding: 2px; }
.tog input:checked ~ .tog-track { background: #6366f1; }
.tog-thumb { width: 15px; height: 15px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s cubic-bezier(0.4,0,0.2,1); flex-shrink: 0; }
.tog input:checked ~ .tog-track .tog-thumb { transform: translateX(15px); }
.cp-card.cp-fixed .tog-track { cursor: not-allowed; }
/* Column filter panel */
.cfp { position: fixed; z-index: 9999; min-width: 230px; max-width: 280px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; display: none; }
.cfp.open { display: block; animation: slideDown 0.13s ease-out; }
.cfp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; border-bottom: 1px solid #f1f5f9; }
.cfp-title { font-size: 12px; font-weight: 700; color: #1e293b; text-transform: uppercase; letter-spacing: 0.05em; }
.cfp-body { padding: 8px; max-height: 280px; overflow-y: auto; scrollbar-width: thin; }
.cfp-body::-webkit-scrollbar { width: 3px; }
.cfp-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }
.cfp-foot { padding: 8px 10px; border-top: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background 0.1s; }
.ms-opt:hover { background: #f8fafc; }
.ms-opt input[type=checkbox] { width: 14px; height: 14px; accent-color: #6366f1; cursor: pointer; flex-shrink: 0; }
.ms-opt label { font-size: 13px; color: #374151; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.ms-sep { height: 1px; background: #f1f5f9; margin: 4px 0; }
.range-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.range-inp { flex: 1; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #374151; outline: none; transition: border-color 0.15s; font-family: inherit; }
.range-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
.tf-op { width: 100%; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #374151; outline: none; margin-bottom: 6px; font-family: inherit; box-sizing: border-box; }
.tf-inp { width: 100%; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #374151; outline: none; font-family: inherit; box-sizing: border-box; }
.tf-inp:focus, .tf-op:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
.date-inp { width: 100%; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #374151; outline: none; font-family: inherit; box-sizing: border-box; }
.date-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
/* Spinning animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.6s linear infinite; }
/* Bulk bar */
#bulk-bar { display: none; }
#bulk-bar.visible { display: flex; }


/* ═══════════════════════════════════════════════════════════════════
   ENROLMENT WIZARD  (/students/enroll)
   Multi-step form. Layout via Tailwind utilities in markup; the bespoke
   widgets (stepper, pill pickers, swatches, live preview, success) live
   here. Tokens match the EduAdmin palette: indigo #6366f1 · slate scale.
═══════════════════════════════════════════════════════════════════ */

/* ── Stepper ─────────────────────────────────────────────────────── */
.enr-stepper { display: flex; align-items: flex-start; gap: 0; }
.enr-step { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 0 0 auto; position: relative; background: none; border: none; padding: 0; font-family: inherit; cursor: default; min-width: 0; }
.enr-step.is-nav { cursor: pointer; }
.enr-step-dot {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0; position: relative; z-index: 1;
    background: #fff; color: #94a3b8; border: 2px solid #e2e8f0;
    transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .15s;
}
.enr-step.is-nav:hover .enr-step-dot { border-color: #c7d2fe; color: #6366f1; }
.enr-step.is-active .enr-step-dot { background: #6366f1; border-color: #6366f1; color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.enr-step.is-done .enr-step-dot { background: #eef2ff; border-color: #6366f1; color: #6366f1; }
.enr-step.is-done.is-nav:hover .enr-step-dot { background: #e0e7ff; }
.enr-step-dot svg { width: 15px; height: 15px; }
.enr-step-label { font-size: 11.5px; font-weight: 600; color: #94a3b8; white-space: nowrap; transition: color .25s; text-align: center; }
.enr-step.is-active .enr-step-label { color: #4f46e5; }
.enr-step.is-done .enr-step-label { color: #64748b; }
.enr-step-line { flex: 1 1 auto; height: 2px; background: #e2e8f0; margin-top: 16px; border-radius: 2px; position: relative; overflow: hidden; min-width: 12px; }
.enr-step-line::after { content: ""; position: absolute; inset: 0; background: #6366f1; transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.enr-step-line.is-filled::after { transform: scaleX(1); }

/* compact stepper (mobile): hide labels + lines, show dots only */
@media (max-width: 640px) {
    .enr-step-label { display: none; }
    .enr-step-dot { width: 30px; height: 30px; font-size: 12px; }
}

/* ── Step panel transition ───────────────────────────────────────── */
.enr-panel { animation: enr-slide .28s cubic-bezier(.22,.61,.36,1); }
@keyframes enr-slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.enr-section-title { font-size: 16px; font-weight: 700; color: #1e293b; letter-spacing: -.3px; }
.enr-section-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }

/* ── Fields ──────────────────────────────────────────────────────── */
.enr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.enr-label { font-size: 12px; font-weight: 600; color: #334155; display: flex; align-items: center; gap: 5px; }
.enr-req { color: #ef4444; font-weight: 700; }
.enr-optional { font-size: 11px; font-weight: 500; color: #cbd5e1; }
.enr-hint { font-size: 11.5px; color: #94a3b8; line-height: 1.4; }

.enr-input, .enr-select, .enr-textarea {
    width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13.5px; color: #1e293b;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
    outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.enr-input::placeholder, .enr-textarea::placeholder { color: #94a3b8; }
.enr-input:focus, .enr-select:focus, .enr-textarea:focus { background: #fff; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.enr-input:hover:not(:focus), .enr-select:hover:not(:focus), .enr-textarea:hover:not(:focus) { border-color: #cbd5e1; }
.enr-textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.enr-select { appearance: none; cursor: pointer; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* input with a leading icon and/or trailing adornment */
.enr-input-wrap { position: relative; display: flex; align-items: center; }
.enr-input-wrap .enr-lead-icon { position: absolute; left: 12px; width: 15px; height: 15px; color: #94a3b8; pointer-events: none; }
.enr-input-wrap.has-lead .enr-input { padding-left: 36px; }
.enr-input-suffix { position: absolute; right: 10px; font-size: 12px; color: #94a3b8; font-weight: 500; pointer-events: none; }

/* validation states */
.enr-field.has-error .enr-input,
.enr-field.has-error .enr-select,
.enr-field.has-error .enr-textarea { border-color: #fca5a5; background: #fef2f2; }
.enr-field.has-error .enr-input:focus,
.enr-field.has-error .enr-select:focus,
.enr-field.has-error .enr-textarea:focus { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.14); }
.enr-error { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: #dc2626; animation: enr-shake .3s; }
.enr-error::before { content: ""; display: inline-block; width: 12px; height: 12px; flex-shrink: 0; background: currentColor;
    -webkit-mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath stroke-linecap='round' d='M12 7.5v5M12 16h.01'/%3E%3C/svg%3E");
    mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath stroke-linecap='round' d='M12 7.5v5M12 16h.01'/%3E%3C/svg%3E"); }
@keyframes enr-shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-3px); } 40%,80% { transform: translateX(3px); } }
.enr-valid-tick { color: #10b981; width: 14px; height: 14px; }

/* suggestion chip (e.g. suggested email) */
.enr-suggest { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 500; color: #4f46e5; background: #eef2ff; border: 1px solid #c7d2fe; cursor: pointer; transition: background .12s, border-color .12s; font-family: inherit; }
.enr-suggest:hover { background: #e0e7ff; border-color: #a5b4fc; }
.enr-suggest svg { width: 12px; height: 12px; }

/* ── Pill selector (radio-as-pills) ──────────────────────────────── */
.enr-pillset { display: flex; flex-wrap: wrap; gap: 8px; }
.enr-pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
    font-family: inherit; font-size: 13px; font-weight: 500; color: #475569;
    background: #fff; border: 1.5px solid #e2e8f0; cursor: pointer; white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s, transform .12s;
}
.enr-pill:hover { border-color: #c7d2fe; background: #f8fafc; color: #1e293b; }
.enr-pill:active { transform: scale(.97); }
.enr-pill.is-selected { border-color: #6366f1; background: #eef2ff; color: #4338ca; font-weight: 600; box-shadow: 0 0 0 1px #6366f1; }
.enr-pill .enr-pill-check { width: 14px; height: 14px; color: #6366f1; }
.enr-pill .enr-pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* grade picker — fixed-width cells in a tidy grid */
.enr-grade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .enr-grade-grid { grid-template-columns: repeat(6, 1fr); } }
.enr-grade-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 11px 4px; border-radius: 11px; border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; }
.enr-grade-cell:hover { border-color: #c7d2fe; background: #f8fafc; }
.enr-grade-cell:active { transform: scale(.96); }
.enr-grade-cell.is-selected { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 1px #6366f1; }
.enr-grade-num { font-size: 18px; font-weight: 800; color: #334155; letter-spacing: -.5px; line-height: 1; }
.enr-grade-cell.is-selected .enr-grade-num { color: #4338ca; }
.enr-grade-cap { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; }

/* ── Avatar swatches ─────────────────────────────────────────────── */
.enr-swatch-row { display: flex; flex-wrap: wrap; gap: 9px; }
.enr-swatch { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: none; padding: 0; position: relative; transition: transform .14s, box-shadow .14s; }
.enr-swatch:hover { transform: scale(1.12); }
.enr-swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor; }
.enr-swatch.is-selected::after { content: ""; position: absolute; inset: 0; display: flex; background: center/14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 12.75l6 6 9-13.5'/%3E%3C/svg%3E"); }

/* ── Toggle switch ───────────────────────────────────────────────── */
.enr-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.enr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.enr-switch-track { width: 40px; height: 23px; border-radius: 999px; background: #e2e8f0; padding: 2px; transition: background .2s; flex-shrink: 0; }
.enr-switch input:checked ~ .enr-switch-track { background: #6366f1; }
.enr-switch input:focus-visible ~ .enr-switch-track { box-shadow: 0 0 0 3px rgba(99,102,241,.25); }
.enr-switch-thumb { width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.4,0,.2,1); }
.enr-switch input:checked ~ .enr-switch-track .enr-switch-thumb { transform: translateX(17px); }
.enr-switch-label { font-size: 13px; color: #334155; font-weight: 500; }

/* ── Live preview card ───────────────────────────────────────────── */
.enr-preview { position: sticky; top: 0; }
.enr-preview-banner { height: 64px; background: linear-gradient(135deg,#6366f1,#8b5cf6); position: relative; }
.enr-preview-av { position: relative; z-index: 1; width: 76px; height: 76px; border-radius: 18px; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(99,102,241,.28); margin: -38px auto 0; display: block; background: #eef2ff; transition: box-shadow .2s; }
.enr-preview-name { font-size: 16px; font-weight: 700; color: #1e293b; text-align: center; margin-top: 10px; letter-spacing: -.2px; }
.enr-preview-name.is-empty { color: #cbd5e1; font-weight: 600; }
.enr-preview-id { font-size: 11.5px; color: #94a3b8; text-align: center; margin-top: 2px; font-variant-numeric: tabular-nums; }
.enr-preview-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.enr-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f1f5f9; color: #475569; }
.enr-tag.indigo { background: #eef2ff; color: #4338ca; }
.enr-preview-rows { margin-top: 16px; display: flex; flex-direction: column; }
.enr-prow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f1f5f9; font-size: 12.5px; }
.enr-prow svg { width: 14px; height: 14px; color: #c7d2fe; flex-shrink: 0; }
.enr-prow-k { color: #94a3b8; flex-shrink: 0; }
.enr-prow-v { color: #1e293b; font-weight: 500; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.enr-prow-v.is-empty { color: #cbd5e1; font-weight: 400; font-style: italic; }

/* completion ring */
.enr-ring-wrap { display: flex; align-items: center; gap: 11px; }
.enr-ring { --pct: 0; width: 44px; height: 44px; flex-shrink: 0; position: relative; }
.enr-ring svg { transform: rotate(-90deg); }
.enr-ring-track { stroke: #eef2ff; }
.enr-ring-fill { stroke: #6366f1; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.enr-ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #4f46e5; }

/* ── Status badges (preview + review, reuse grid palette) ────────── */
.enr-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.enr-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.enr-badge.active { background: #f0fdf4; color: #16a34a; } .enr-badge.active .dot { background: #22c55e; }
.enr-badge.pending { background: #fffbeb; color: #b45309; } .enr-badge.pending .dot { background: #f59e0b; }

/* ── Review step ─────────────────────────────────────────────────── */
.enr-review-group { border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.enr-review-head { display: flex; align-items: center; gap: 9px; padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.enr-review-head h4 { font-size: 13px; font-weight: 700; color: #334155; }
.enr-review-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #6366f1; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 7px; font-family: inherit; transition: background .12s; }
.enr-review-edit:hover { background: #eef2ff; }
.enr-review-edit svg { width: 11px; height: 11px; }
.enr-review-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px 20px; padding: 15px 16px; }
@media (max-width: 520px) { .enr-review-body { grid-template-columns: 1fr; } }
.enr-rv-k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 3px; }
.enr-rv-v { font-size: 13.5px; color: #1e293b; font-weight: 500; }
.enr-rv-v.is-empty { color: #cbd5e1; font-style: italic; font-weight: 400; }
.enr-rv-full { grid-column: 1 / -1; }

/* consent box */
.enr-consent { display: flex; gap: 11px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid #e2e8f0; background: #f8fafc; cursor: pointer; transition: border-color .15s, background .15s; }
.enr-consent:hover { border-color: #c7d2fe; }
.enr-consent.is-checked { border-color: #6366f1; background: #eef2ff; }
.enr-consent.has-error { border-color: #fca5a5; background: #fef2f2; }
.enr-consent input { width: 17px; height: 17px; accent-color: #6366f1; margin-top: 1px; flex-shrink: 0; cursor: pointer; }
.enr-consent-text { font-size: 12.5px; color: #475569; line-height: 1.5; }

/* ── Footer nav ──────────────────────────────────────────────────── */
.enr-nav { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.enr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 20px; border-radius: 11px; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .14s, border-color .14s, color .14s, box-shadow .14s, transform .1s; white-space: nowrap; }
.enr-btn:active { transform: translateY(1px); }
.enr-btn svg { width: 15px; height: 15px; }
.enr-btn-ghost { background: #fff; border: 1px solid #e2e8f0; color: #475569; }
.enr-btn-ghost:hover { border-color: #cbd5e1; background: #f8fafc; color: #1e293b; }
.enr-btn-primary { background: #6366f1; border: 1px solid #6366f1; color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,.32); }
.enr-btn-primary:hover { background: #4f46e5; border-color: #4f46e5; box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.enr-btn-success { background: #10b981; border: 1px solid #10b981; color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.32); }
.enr-btn-success:hover { background: #059669; border-color: #059669; }
.enr-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.enr-btn-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .65s linear infinite; }

/* ── Draft-resume banner ─────────────────────────────────────────── */
.enr-draft { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; font-size: 12.5px; color: #92400e; }
.enr-draft svg { width: 15px; height: 15px; color: #d97706; flex-shrink: 0; }
.enr-draft-btn { font-weight: 700; color: #b45309; background: none; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; padding: 3px 8px; border-radius: 6px; transition: background .12s; }
.enr-draft-btn:hover { background: #fef3c7; }
.enr-draft-x { margin-left: auto; }

/* ── Success screen ──────────────────────────────────────────────── */
.enr-success { text-align: center; padding: 14px 0 8px; position: relative; overflow: hidden; }
.enr-check { width: 84px; height: 84px; margin: 0 auto 18px; }
.enr-check circle { stroke: #10b981; stroke-width: 3; fill: #f0fdf4; stroke-dasharray: 251; stroke-dashoffset: 251; animation: enr-draw-c .5s ease forwards; }
.enr-check path { stroke: #10b981; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: enr-draw-t .35s .45s ease forwards; }
@keyframes enr-draw-c { to { stroke-dashoffset: 0; } }
@keyframes enr-draw-t { to { stroke-dashoffset: 0; } }
.enr-success h2 { font-size: 22px; font-weight: 800; color: #1e293b; letter-spacing: -.5px; }
.enr-success p { font-size: 13.5px; color: #64748b; margin-top: 6px; }

/* pure-CSS confetti burst */
.enr-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.enr-confetti i { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; opacity: 0; animation: enr-fall 2.4s ease-in forwards; }
@keyframes enr-fall { 0% { opacity: 0; transform: translateY(-10px) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }
.enr-confetti i:nth-child(1)  { left: 8%;  background: #6366f1; animation-delay: 0s;    }
.enr-confetti i:nth-child(2)  { left: 18%; background: #f59e0b; animation-delay: .12s;  }
.enr-confetti i:nth-child(3)  { left: 28%; background: #10b981; animation-delay: .05s;  }
.enr-confetti i:nth-child(4)  { left: 38%; background: #ec4899; animation-delay: .22s;  }
.enr-confetti i:nth-child(5)  { left: 48%; background: #8b5cf6; animation-delay: .08s;  }
.enr-confetti i:nth-child(6)  { left: 58%; background: #06b6d4; animation-delay: .3s;   }
.enr-confetti i:nth-child(7)  { left: 68%; background: #f97316; animation-delay: .15s;  }
.enr-confetti i:nth-child(8)  { left: 78%; background: #22c55e; animation-delay: .26s;  }
.enr-confetti i:nth-child(9)  { left: 88%; background: #a855f7; animation-delay: .1s;   }
.enr-confetti i:nth-child(10) { left: 14%; background: #0ea5e9; animation-delay: .34s;  }
.enr-confetti i:nth-child(11) { left: 63%; background: #ef4444; animation-delay: .4s;   }
.enr-confetti i:nth-child(12) { left: 33%; background: #14b8a6; animation-delay: .18s;  }

/* ── "What happens next" list (success) ──────────────────────────── */
.enr-next { display: flex; flex-direction: column; }
.enr-next li { display: flex; gap: 11px; padding: 10px 0; align-items: flex-start; border-top: 1px solid #f1f5f9; }
.enr-next li:first-child { border-top: none; }
.enr-next-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.enr-next-ic svg { width: 15px; height: 15px; }
.enr-next-t { font-size: 12.5px; font-weight: 600; color: #334155; }
.enr-next-d { font-size: 11px; color: #94a3b8; margin-top: 1px; line-height: 1.4; word-break: break-word; }
@media (prefers-reduced-motion: reduce) {
    .enr-panel, .enr-error, .enr-check circle, .enr-check path, .enr-confetti i { animation: none; }
    .enr-check circle, .enr-check path { stroke-dashoffset: 0; }
}
