/* ==========================================================================
   Vasmor HRMS — Admin Panel Stylesheet
   ========================================================================== */

*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
    /* Sidebar */
    --sb-bg:            #1e282c;
    --sb-bg-hover:      #17201f;
    --sb-active-bg:     #17201f;
    --sb-active-bar:    #00c0ef;
    --sb-text:          #a9b7c0;
    --sb-text-hi:       #ffffff;
    --sb-section:       #556066;
    --sb-border:        #2a353a;

    /* Topbar */
    --tb-bg:            #ffffff;
    --tb-border:        #e1e5eb;
    --tb-text:          #58666e;

    /* Accents */
    --brand:            #00c0ef;
    --brand-dark:       #00a8d4;
    --green:            #00a65a;
    --green-dark:       #008d4c;
    --orange:           #f39c12;
    --orange-dark:      #db8b0b;
    --red:              #dd4b39;
    --red-dark:         #d33724;
    --purple:           #8e44ad;
    --indigo:           #3c8dbc;

    /* Surfaces */
    --body-bg:          #f4f6f9;
    --card-bg:          #ffffff;
    --border:           #e1e5eb;
    --border-light:     #f0f2f5;

    /* Text */
    --text:             #2d353c;
    --text-mid:         #58666e;
    --text-muted:       #8a98a3;
    --text-faint:       #b3bec5;

    /* Layout */
    --sb-w:             240px;
    --tb-h:             56px;
    --radius:           4px;
    --radius-lg:        6px;

    /* Shadows */
    --shadow-sm:        0 1px 2px rgba(0,0,0,0.04);
    --shadow:           0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:        0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:        0 10px 24px rgba(0,0,0,0.08);
}

/* =========================== BASE =========================== */
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: none; color: var(--brand); }

/* =========================== SIDEBAR =========================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sb-w);
    background: var(--sb-bg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* Brand block */
.sidebar__brand {
    height: var(--tb-h);
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    background: var(--sb-bg);
    border-bottom: 1px solid var(--sb-border);
}

.sidebar__brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.sidebar__brand strong { font-weight: 600; }

.sidebar__brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--indigo) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* =========================== FAVORITE STAR =========================== */
.action-btn--favorite:hover { color: #f39c12; background: rgba(243,156,18,0.12); }
.action-btn--favorite.active { color: #f39c12; }
.action-btn--favorite.active svg { fill: #f39c12; stroke: #f39c12; }
/* ===== Notifications dropdown ===== */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -80px;
    width: 360px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    display: none;
    z-index: 300;
    overflow: hidden;
}
.notif-dropdown.open { display: block; animation: slideDown 0.15s ease; }

.notif-dropdown__head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.notif-dropdown__body { max-height: 380px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    transition: background 0.12s;
}

.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: rgba(0,192,239,0.05); }

.notif-item__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 6px;
    flex-shrink: 0;
}
.notif-item.read .notif-item__dot { background: transparent; }

.notif-item__title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item__msg   { font-size: 12.5px; color: var(--text-mid); margin-top: 2px; line-height: 1.4; }
.notif-item__time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.notif-empty {
    padding: 30px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.notif-dropdown__foot {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 12.5px;
    background: #fafbfc;
}

/* Section label */
.sidebar__section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sb-section);
    padding: 18px 20px 8px;
}

/* Links */
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 13.5px;
    color: var(--sb-text);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    text-decoration: none;
    position: relative;
    line-height: 1.4;
}

.sidebar__link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: var(--sb-text);
    transition: color 0.12s;
}

.sidebar__link:hover {
    background: var(--sb-bg-hover);
    color: var(--sb-text-hi);
}

.sidebar__link:hover svg { color: var(--sb-text-hi); }

.sidebar__link.active {
    background: var(--sb-active-bg);
    color: var(--sb-text-hi);
    border-left-color: var(--sb-active-bar);
    font-weight: 500;
}

.sidebar__link.active svg { color: var(--sb-active-bar); }

/* Badge inside a link */
.sidebar__link-badge {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.sidebar__link-badge.warn { background: var(--orange); }
.sidebar__link-badge.danger { background: var(--red); }
.sidebar__link-badge.green { background: var(--green); }

/* Group (dropdown) */
.sidebar__group { position: relative; }

.sidebar__group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 13.5px;
    color: var(--sb-text);
    border-left: 3px solid transparent;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1.4;
}

.sidebar__group-toggle svg:first-child {
    width: 17px;
    height: 17px;
    color: var(--sb-text);
    flex-shrink: 0;
    transition: color 0.12s;
}

.sidebar__group-toggle span { flex: 1; }

.sidebar__group-toggle svg.chev {
    width: 12px;
    height: 12px;
    color: var(--sb-text);
    opacity: 0.6;
    transition: transform 0.2s, opacity 0.12s;
    flex-shrink: 0;
}

.sidebar__group-toggle:hover {
    background: var(--sb-bg-hover);
    color: var(--sb-text-hi);
}
.sidebar__group-toggle:hover svg { color: var(--sb-text-hi); opacity: 1; }

.sidebar__group.active > .sidebar__group-toggle {
    background: var(--sb-active-bg);
    color: var(--sb-text-hi);
    border-left-color: var(--sb-active-bar);
    font-weight: 500;
}

.sidebar__group.active > .sidebar__group-toggle svg:first-child {
    color: var(--sb-active-bar);
}

.sidebar__group.open > .sidebar__group-toggle svg.chev {
    transform: rotate(90deg);
    opacity: 1;
}

.sidebar__group-body {
    display: none;
    background: rgba(0,0,0,0.15);
}

.sidebar__group.open > .sidebar__group-body {
    display: block;
    animation: slideDown 0.18s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sub-links */
.sidebar__sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 44px;
    font-size: 13px;
    color: var(--sb-text);
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    text-decoration: none;
    position: relative;
    line-height: 1.4;
}

.sidebar__sublink::before {
    content: "";
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sb-section);
    transition: background 0.12s;
}

.sidebar__sublink:hover {
    background: var(--sb-bg-hover);
    color: var(--sb-text-hi);
}

.sidebar__sublink:hover::before { background: var(--brand); }

.sidebar__sublink.active {
    color: var(--sb-text-hi);
    background: var(--sb-active-bg);
    border-left-color: var(--sb-active-bar);
    font-weight: 500;
}

.sidebar__sublink.active::before { background: var(--sb-active-bar); }

/* Nested deeper */
.sidebar__sublink--nested {
    padding-left: 58px;
    font-size: 12.5px;
    color: var(--sb-section);
}

.sidebar__sublink--nested::before { left: 40px; }

.sidebar__sublink--nested:hover { color: var(--sb-text-hi); }

.sidebar__sublink--nested.active { color: var(--sb-text-hi); }

/* Sidebar user card at bottom */
.sidebar__user {
    margin-top: auto;
    padding: 14px 16px;
    border-top: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar__user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--indigo) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar__user-info { flex: 1; min-width: 0; }

.sidebar__user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sb-text-hi);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-role {
    font-size: 11px;
    color: var(--sb-section);
    text-transform: capitalize;
}

/* =========================== TOPBAR =========================== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sb-w);
    right: 0;
    height: var(--tb-h);
    background: var(--tb-bg);
    border-bottom: 1px solid var(--tb-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.topbar__toggle {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--tb-text);
    cursor: pointer;
    border-radius: var(--radius);
    margin-right: 12px;
}

.topbar__toggle:hover { background: var(--border-light); color: var(--text); }

.topbar__breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar__breadcrumbs a { color: var(--text-muted); }
.topbar__breadcrumbs a:hover { color: var(--brand-dark); }

.topbar__breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

.topbar__breadcrumbs svg {
    width: 12px;
    height: 12px;
    color: var(--text-faint);
    flex-shrink: 0;
}

.topbar__title {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
}

.topbar__right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar__icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--tb-text);
    cursor: pointer;
    border-radius: var(--radius);
    position: relative;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
}

.topbar__icon:hover { background: var(--border-light); color: var(--text); }
.topbar__icon svg { width: 18px; height: 18px; }

.topbar__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--tb-bg);
}

/* User button */
.topbar__user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 22px;
    cursor: pointer;
    margin-left: 6px;
    transition: background 0.12s;
    color: var(--tb-text);
    font-size: 13.5px;
    border: none;
    background: transparent;
    text-decoration: none;
}

.topbar__user:hover { background: var(--border-light); }

.topbar__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--indigo) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.topbar__user-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.topbar__user-name .role {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
    margin-left: 2px;
}

@media (max-width: 640px) {
    .topbar__user-name { display: none; }
}

/* =========================== MAIN =========================== */
.main {
    margin-left: var(--sb-w);
    padding-top: var(--tb-h);
    min-height: 100vh;
}

.content {
    padding: 24px;
    max-width: 1600px;
}

/* Page head */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-head__title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.page-head__sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

.page-head__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================== STATS =========================== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
    min-height: 92px;
}

.stat__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.stat__icon svg { width: 24px; height: 24px; }

.stat__icon--blue   { background: linear-gradient(135deg, #00c0ef, #0097c4); }
.stat__icon--green  { background: linear-gradient(135deg, #00c97a, #00a65a); }
.stat__icon--orange { background: linear-gradient(135deg, #ffab3d, #f39c12); }
.stat__icon--red    { background: linear-gradient(135deg, #f0614f, #dd4b39); }
.stat__icon--purple { background: linear-gradient(135deg, #a55fc0, #8e44ad); }

.stat__body { min-width: 0; flex: 1; }

.stat__value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.stat__label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat__delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.stat__delta svg { width: 11px; height: 11px; }
.stat__delta.up   { color: var(--green); }
.stat__delta.down { color: var(--red); }

/* =========================== CARDS =========================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card__head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    background: #fff;
}

.card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.card__title small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card__tools {
    display: flex;
    gap: 2px;
}

.card__tool {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.card__tool:hover { background: var(--border-light); color: var(--text); }
.card__tool svg { width: 15px; height: 15px; }

.card__body { padding: 20px; }

/* =========================== BUTTONS =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn--primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,192,239,0.3);
}
.btn--primary:hover:not(:disabled) {
    background: var(--brand-dark);
    color: #fff;
    box-shadow: 0 4px 8px rgba(0,192,239,0.35);
    transform: translateY(-1px);
}

.btn--green {
    background: var(--green);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,166,90,0.3);
}
.btn--green:hover:not(:disabled) {
    background: var(--green-dark);
    color: #fff;
    box-shadow: 0 4px 8px rgba(0,166,90,0.35);
    transform: translateY(-1px);
}

.btn--red {
    background: var(--red);
    color: #fff;
}
.btn--red:hover:not(:disabled) { background: var(--red-dark); color: #fff; }

.btn--orange {
    background: var(--orange);
    color: #fff;
}
.btn--orange:hover:not(:disabled) { background: var(--orange-dark); color: #fff; }

.btn--default {
    background: #fff;
    color: var(--text-mid);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.btn--default:hover:not(:disabled) {
    background: var(--border-light);
    color: var(--text);
    border-color: #d0d5dc;
}

.btn--ghost {
    background: transparent;
    color: var(--text-mid);
    border-color: transparent;
}
.btn--ghost:hover:not(:disabled) { background: var(--border-light); color: var(--text); }

.btn--sm { padding: 5px 11px; font-size: 12px; }
.btn--sm svg { width: 13px; height: 13px; }

/* =========================== FORMS =========================== */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.label .req { color: var(--red); margin-left: 2px; }

.input,
.select,
.textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--text);
    background: #fff;
    border: 1px solid #d5dce3;
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 38px;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a98a3' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.textarea { height: auto; min-height: 96px; resize: vertical; padding: 10px 12px; }

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,192,239,0.15);
}

.input::placeholder { color: var(--text-faint); }

.hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.error {
    font-size: 12px;
    color: var(--red);
    margin-top: 5px;
    font-weight: 500;
}

.field-error .input,
.field-error .select { border-color: var(--red); }
.field-error .input:focus,
.field-error .select:focus { box-shadow: 0 0 0 3px rgba(221,75,57,0.15); }

/* =========================== FILTER BAR =========================== */
.filters {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-items: end;
}

@media (max-width: 1100px) { .filters { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .filters { grid-template-columns: 1fr; } }

.filters__actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    margin-top: 2px;
}

.field { min-width: 0; }
.field__label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* =========================== TABLE =========================== */
.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data thead th {
    text-align: left;
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-mid);
    vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.08s; }
table.data tbody tr:hover { background: #f8fafc; }

/* Document cell */
.doc-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.doc-cell__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.doc-cell__icon svg { width: 17px; height: 17px; }

.doc-cell__name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    display: block;
    line-height: 1.3;
}

.doc-cell__name:hover { color: var(--brand-dark); }

.doc-cell__meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.doc-cell__version {
    display: inline-block;
    font-size: 10.5px;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 3px;
    font-weight: 600;
}

/* Icon color palette */
.doc-icon--blue   { background: linear-gradient(135deg, #00c0ef, #0097c4); }
.doc-icon--green  { background: linear-gradient(135deg, #00c97a, #00a65a); }
.doc-icon--red    { background: linear-gradient(135deg, #f0614f, #dd4b39); }
.doc-icon--amber  { background: linear-gradient(135deg, #ffab3d, #f39c12); }
.doc-icon--purple { background: linear-gradient(135deg, #a55fc0, #8e44ad); }
.doc-icon--gray   { background: linear-gradient(135deg, #9ca8b3, #7d8a95); }

/* =========================== BADGES =========================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    white-space: nowrap;
    line-height: 1.5;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge--blue   { background: rgba(0,192,239,0.14); color: #0097c4; }
.badge--green  { background: rgba(0,166,90,0.14);  color: #008d4c; }
.badge--red    { background: rgba(221,75,57,0.14); color: #c43223; }
.badge--amber  { background: rgba(243,156,18,0.16); color: #d68600; }
.badge--purple { background: rgba(142,68,173,0.14); color: #7a3a95; }
.badge--gray   { background: var(--border-light); color: var(--text-mid); }

/* =========================== ROW ACTIONS =========================== */
.row-actions {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
}

.action-btn svg { width: 15px; height: 15px; }

.action-btn--view:hover     { color: var(--brand-dark); background: rgba(0,192,239,0.12); }
.action-btn--download:hover { color: var(--green-dark); background: rgba(0,166,90,0.12); }
.action-btn--edit:hover     { color: var(--orange-dark); background: rgba(243,156,18,0.14); }
.action-btn--delete:hover   { color: var(--red-dark);  background: rgba(221,75,57,0.12); }

/* =========================== EMPTY =========================== */
.empty {
    padding: 60px 24px;
    text-align: center;
}

.empty__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--border-light);
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty__icon svg { width: 28px; height: 28px; }

.empty__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.empty__text {
    font-size: 13.5px;
    color: var(--text-muted);
    max-width: 380px;
    margin: 0 auto 18px;
}

/* =========================== ALERTS =========================== */
.alert {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    border: 1px solid transparent;
    margin-bottom: 16px;
    align-items: flex-start;
    border-left-width: 3px;
}

.alert svg { flex-shrink: 0; margin-top: 1px; width: 17px; height: 17px; }

.alert--success { background: #e8f7ef; color: #00733e; border-color: #b8e6cf; border-left-color: var(--green); }
.alert--error   { background: #fdecea; color: #a73425; border-color: #f5c6c0; border-left-color: var(--red); }
.alert--info    { background: #e6f7fc; color: #007ba0; border-color: #b9e8f3; border-left-color: var(--brand); }
.alert--warning { background: #fef5e5; color: #b06a00; border-color: #fae0a8; border-left-color: var(--orange); }

.alert ul { padding-left: 18px; }

/* =========================== DROPZONE =========================== */
.dropzone {
    border: 2px dashed #cbd4dc;
    border-radius: var(--radius-lg);
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fafbfc;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--brand);
    background: rgba(0,192,239,0.04);
}

.dropzone__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0,192,239,0.12);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.dropzone__icon svg { width: 26px; height: 26px; }

.dropzone__text {
    font-size: 14px;
    color: var(--text-mid);
    font-weight: 500;
}

.dropzone__text strong { color: var(--brand-dark); font-weight: 600; }

.dropzone__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* =========================== FILE LIST =========================== */
.file-list { list-style: none; margin-top: 14px; }

.file-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    transition: border-color 0.12s;
}

.file-list__item:hover { border-color: var(--brand); }

.file-list__name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-list__size {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* =========================== TOAST =========================== */
.toast {
    position: fixed;
    top: calc(var(--tb-h) + 20px);
    right: 24px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13.5px;
    color: var(--text);
    z-index: 200;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
    min-width: 280px;
}

.toast--success { border-left-color: var(--green); }
.toast--error   { border-left-color: var(--red); }

.toast__icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.toast--success .toast__icon { background: var(--green); }
.toast--error   .toast__icon { background: var(--red); }

.toast__icon svg { width: 13px; height: 13px; }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* =========================== DETAIL PAGE =========================== */
.detail-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px;
    flex-wrap: wrap;
}

.detail-head__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.detail-head__icon svg { width: 26px; height: 26px; }

.detail-head__body { flex: 1; min-width: 220px; }

.detail-head__title {
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.detail-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

.detail-head__meta > span { display: inline-flex; align-items: center; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.detail-field__label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
    font-weight: 700;
}

.detail-field__value {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* =========================== VERSION LIST =========================== */
.version {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.08s;
}

.version:last-child { border-bottom: none; }
.version:hover { background: #fafbfc; }

.version__num {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    background: var(--border-light);
    color: var(--text-mid);
    font-size: 11.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.version__body { flex: 1; min-width: 0; }

.version__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.version__meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.version__notes {
    font-size: 12.5px;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid var(--border);
}

/* =========================== AUTH =========================== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #1e282c 0%, #0f1618 100%);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    color: #fff;
}

.auth-brand__logo {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), var(--indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.auth-brand__name {
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.auth-brand__name strong { font-weight: 700; }

.auth-brand__sub {
    font-size: 12.5px;
    opacity: 0.65;
    margin-top: 2px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    padding: 34px;
}

.auth-card h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.auth-card .sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-footer {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-top: 24px;
}

/* =========================== PAGINATION =========================== */
.pagination-wrap {
    padding: 16px 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-light);
}

.pagination-wrap nav { display: flex; }

.pagination-wrap nav > div:first-child { display: none; }
.pagination-wrap nav > div:last-child { display: flex; gap: 4px; }

.pagination-wrap a,
.pagination-wrap span[aria-current="page"] > span,
.pagination-wrap span[aria-disabled="true"] > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-mid);
    font-weight: 500;
    text-decoration: none;
}

.pagination-wrap a:hover { background: var(--border-light); color: var(--text); border-color: #d0d5dc; }

.pagination-wrap span[aria-current="page"] > span {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.pagination-wrap span[aria-disabled="true"] > span {
    opacity: 0.4;
}

/* =========================== UTILITIES =========================== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }

.grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
@media (max-width: 1000px) { .grid-main { grid-template-columns: 1fr; } }

/* =========================== MOBILE =========================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,0.15); }
    .sidebar-overlay.open { display: block; }
    .main { margin-left: 0; }
    .topbar { left: 0; padding: 0 16px; }
    .topbar__toggle { display: flex; }
    .content { padding: 16px; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
    .stat { padding: 16px; }
    .stat__value { font-size: 22px; }
    .stat__icon { width: 44px; height: 44px; }
    .stat__icon svg { width: 20px; height: 20px; }
    .page-head__title { font-size: 19px; }
    .toast { right: 12px; left: 12px; max-width: none; }
}