/* ═══════════════════════════════════════════════════════════════════
   Isente Sdn Bhd — IT Asset Management System
   Design System — style.css
   Matches approved UI design images exactly
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #f4f6fa;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
}

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
    --sidebar-w: 220px;
    --sidebar-bg: #0f1b2d;
    --sidebar-text: #94a3b8;
    --sidebar-active: #2563eb;
    --sidebar-hover: #1e3a5f;

    --blue:          #2563eb;
    --blue-dark:     #1d4ed8;
    --blue-light:    #eff6ff;
    --green:         #10b981;
    --green-light:   #ecfdf5;
    --orange:        #f59e0b;
    --orange-light:  #fffbeb;
    --red:           #ef4444;
    --red-light:     #fef2f2;
    --purple:        #8b5cf6;
    --purple-light:  #f5f3ff;
    --teal:          #0ea5e9;
    --teal-light:    #f0f9ff;
    --grey:          #64748b;
    --grey-light:    #f1f5f9;

    --white: #ffffff;
    --bg: #f4f6fa;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);

    --transition: all .18s ease;
    --header-h: 62px;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-logo .logo-mark {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
    line-height: 1;
    margin-bottom: 2px;
}

.sidebar-logo .logo-sub {
    font-size: .68rem;
    font-weight: 500;
    color: var(--sidebar-text);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    border-radius: 0;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: .95rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.sidebar-footer:hover { background: var(--sidebar-hover); }

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.avatar-info .name  { color: #fff; font-size: .82rem; font-weight: 600; }
.avatar-info .role  { color: var(--sidebar-text); font-size: .72rem; }
.avatar-caret { color: var(--sidebar-text); margin-left: auto; font-size: .8rem; }

/* ── Main Layout ─────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Header ──────────────────────────────────────────────── */
.top-header {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 16px;
}

.header-greeting { flex: 1; }
.header-greeting h1 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.header-greeting p  { font-size: .78rem; color: var(--text-secondary); margin-top: 1px; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.notif-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    position: relative;
    transition: var(--transition);
}
.notif-btn:hover { border-color: var(--blue); color: var(--blue); }

.notif-badge {
    position: absolute;
    top: -5px; right: -5px;
    width: 17px; height: 17px;
    background: var(--red);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--white);
}

.company-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}
.company-selector:hover { border-color: var(--blue); }
.company-selector i { color: var(--text-secondary); font-size: .75rem; }

/* ── Page Content ────────────────────────────────────────────── */
.page-content {
    padding: 28px 28px 40px;
    flex: 1;
}

.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.page-header p  { font-size: .83rem; color: var(--text-secondary); margin-top: 4px; }

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-cards {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-cards-6 { grid-template-columns: repeat(6, 1fr); }
.stat-cards-5 { grid-template-columns: repeat(5, 1fr); }
.stat-cards-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-card-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}

.stat-card-icon.blue   { background: var(--blue-light);   color: var(--blue); }
.stat-card-icon.green  { background: var(--green-light);  color: var(--green); }
.stat-card-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-card-icon.red    { background: var(--red-light);    color: var(--red); }
.stat-card-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-card-icon.teal   { background: var(--teal-light);   color: var(--teal); }
.stat-card-icon.grey   { background: var(--grey-light);   color: var(--grey); }

.stat-card-label { font-size: .75rem; font-weight: 600; color: var(--text-secondary); text-transform: none; }
.stat-card-value { font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; margin: 4px 0 2px; }
.stat-card-sub   { font-size: .72rem; color: var(--text-muted); }
.stat-card-link  { font-size: .75rem; color: var(--blue); font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.stat-card-link:hover { text-decoration: underline; }

.sparkline-wrap {
    height: 40px;
    margin-top: 8px;
}
.sparkline-wrap canvas { width: 100% !important; height: 40px !important; }

/* ── Section Grid ────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr 1fr;
    gap: 20px;
}

/* ── White Card ──────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
}
.card-title i { color: var(--text-muted); font-size: .85rem; }

.card-link {
    font-size: .75rem;
    font-weight: 500;
    color: var(--blue);
    text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

.card-body { padding: 16px 20px; }

/* ── Donut Chart ─────────────────────────────────────────────── */
.donut-wrap {
    position: relative;
    width: 200px; height: 200px;
    margin: 0 auto 16px;
}
.donut-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.donut-center .num  { font-size: 1.9rem; font-weight: 800; color: var(--text-primary); }
.donut-center .lbl  { font-size: .72rem; color: var(--text-secondary); font-weight: 500; }

.legend { margin-top: 4px; }
.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: .78rem;
    border-top: 1px solid #f1f5f9;
}
.legend-item:first-child { border-top: none; }
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-label { flex: 1; margin-left: 8px; color: var(--text-secondary); }
.legend-count { font-weight: 600; color: var(--text-primary); margin-right: 8px; }
.legend-pct   { color: var(--text-muted); min-width: 38px; text-align: right; }

/* ── Alerts List ─────────────────────────────────────────────── */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.alert-item:last-child { border-bottom: none; }

.alert-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}
.alert-icon.warning { background: #fffbeb; color: #f59e0b; }
.alert-icon.info    { background: #eff6ff; color: #2563eb; }
.alert-icon.critical{ background: #fef2f2; color: #ef4444; }

.alert-content { flex: 1; }
.alert-title { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.alert-sub   { font-size: .73rem; color: var(--text-muted); margin-top: 1px; }

.alert-right { text-align: right; flex-shrink: 0; }
.alert-date  { font-size: .73rem; color: var(--text-secondary); margin-bottom: 4px; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fef9c3; color: #a16207; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-grey   { background: #f1f5f9; color: #475569; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-critical { background: #fee2e2; color: #b91c1c; }

/* ── Activity Table ──────────────────────────────────────────── */
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.activity-table td {
    padding: 9px 0;
    font-size: .8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f8f9fa;
    vertical-align: middle;
}
.activity-table td:last-child { color: var(--text-muted); }
.activity-row-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    margin-right: 8px;
    flex-shrink: 0;
}
.activity-cell { display: flex; align-items: center; }

/* ── Filters Bar ─────────────────────────────────────────────── */
.filters-bar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}
.search-input-wrap i { color: var(--text-muted); font-size: .85rem; }
.search-input-wrap input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: .83rem;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }

.filter-select {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 30px 7px 12px;
    font-family: inherit;
    font-size: .83rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    appearance: none;
    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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: var(--transition);
    min-width: 140px;
}
.filter-select:focus { border-color: var(--blue); }

.date-range-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
}
.date-range-wrap i { color: var(--text-muted); font-size: .8rem; }
.date-range-wrap input {
    border: none; background: transparent; font-family: inherit;
    font-size: .83rem; color: var(--text-secondary); outline: none; width: 90px;
}
.date-range-sep { color: var(--text-muted); font-size: .8rem; }

.btn-reset {
    background: none; border: none;
    color: var(--text-secondary);
    font-family: inherit; font-size: .83rem;
    cursor: pointer; padding: 7px 4px;
    font-weight: 500;
}
.btn-reset:hover { color: var(--text-primary); }

.filters-spacer { flex: 1; }

/* ── Main Table ──────────────────────────────────────────────── */
.table-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 10px 16px;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    font-size: .83rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: #fafbff; }

.table-link {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.table-link:hover { text-decoration: underline; }

.table-info { color: var(--text-primary); font-size: .78rem; }

.table-count {
    font-size: .8rem;
    color: var(--text-muted);
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}

/* ── Action Buttons ──────────────────────────────────────────── */
.action-btns { display: flex; align-items: center; gap: 6px; }

.btn-icon {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    color: var(--text-muted);
    font-size: .8rem;
    transition: var(--transition);
}
.btn-icon:hover { border-color: var(--blue); color: var(--blue); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

.btn-danger {
    background: var(--white);
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 10px 22px; font-size: .9rem; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex; align-items: center; gap: 4px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.page-btn {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
    transition: var(--transition);
}
.page-btn:hover    { border-color: var(--blue); color: var(--blue); }
.page-btn.active   { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-dots { padding: 0 4px; color: var(--text-muted); font-size: .8rem; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,27,45,.45);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(12px) scale(.98);
    transition: transform .22s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header-left { display: flex; align-items: center; gap: 12px; }
.modal-header-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--blue-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--blue); font-size: 1rem;
}
.modal-title    { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.modal-subtitle { font-size: .78rem; color: var(--text-secondary); }

.modal-close {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted); font-size: .95rem;
    border: 1px solid var(--border); background: var(--white);
    transition: var(--transition);
}
.modal-close:hover { color: var(--red); border-color: var(--red); }

.modal-body { padding: 20px 24px; }

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
}

.modal-field { margin-bottom: 12px; }
.modal-field-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.modal-field-value { font-size: .85rem; color: var(--text-primary); font-weight: 500; }

.modal-section-title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    padding: 14px 24px 20px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    justify-content: flex-end;
}

/* Model Details specific */
.model-details-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 24px;
}
.warranty-box {
    background: var(--blue-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    margin-bottom: 12px;
}
.warranty-box .days { font-size: 1.4rem; font-weight: 800; color: var(--blue); }
.warranty-box .days-label { font-size: .72rem; color: var(--blue-dark); font-weight: 600; }
.warranty-box .until { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.asset-tag-box {
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.asset-tag-box .tag-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.asset-tag-box .tag-value { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.asset-tag-box .tag-link  { font-size: .75rem; color: var(--blue); text-decoration: none; display: block; margin-top: 4px; }

/* ── Drawer (Right-side) ─────────────────────────────────────── */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(15,27,45,.35);
    z-index: 400;
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
    position: fixed;
    top: 0; right: 0;
    width: 420px;
    height: 100%;
    background: var(--white);
    box-shadow: -8px 0 30px rgba(0,0,0,.12);
    z-index: 410;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: flex-start; justify-content: space-between;
}
.drawer-header-text .drawer-title    { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.drawer-header-text .drawer-subtitle { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .85rem;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: var(--transition);
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

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

.char-count { font-size: .72rem; color: var(--text-muted); text-align: right; margin-top: 3px; }

.form-hint { font-size: .74rem; color: var(--text-muted); margin-top: 4px; }
.form-hint a { color: var(--blue); }

/* ── Add Model Category Shortcuts ────────────────────────────── */
.category-shortcuts {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.category-shortcuts-header { margin-bottom: 12px; }
.category-shortcuts-header h3 { font-size: .9rem; font-weight: 700; color: var(--text-primary); }
.category-shortcuts-header p  { font-size: .78rem; color: var(--text-secondary); }

.category-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.category-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: .83rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}
.category-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.category-btn i { font-size: .9rem; }
.category-btn.cat-laptop   i { color: var(--blue); }
.category-btn.cat-pc       i { color: var(--green); }
.category-btn.cat-printer  i { color: var(--orange); }
.category-btn.cat-projector i { color: var(--purple); }
.category-btn.cat-ups      i { color: var(--red); }

/* ── Dynamic model fields per category ──────────────────────── */
.field-group { display: none; }
.field-group.active { display: block; }

/* ── Confirm Dialog ──────────────────────────────────────────── */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(15,27,45,.5);
    z-index: 600;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .18s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }

.confirm-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(.95);
    transition: transform .18s ease;
}
.confirm-overlay.open .confirm-box { transform: scale(1); }
.confirm-box .confirm-icon { font-size: 2rem; color: var(--red); margin-bottom: 12px; }
.confirm-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.confirm-box p  { font-size: .83rem; color: var(--text-secondary); margin-bottom: 20px; }
.confirm-box .confirm-btns { display: flex; gap: 10px; justify-content: center; }

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(37,99,235,.2);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notification ──────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 700;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--text-primary);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: .83rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 10px;
    min-width: 240px;
    animation: toastIn .3s ease;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Maintenance tab in Project Details ──────────────────────── */
.maint-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.maint-table th {
    font-size: .72rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    padding: 7px 10px; border-bottom: 1px solid var(--border);
    text-align: left; background: #f8f9fa;
}
.maint-table td {
    padding: 9px 10px; font-size: .8rem;
    color: var(--text-secondary); border-bottom: 1px solid #f1f5f9;
}
.maint-table tbody tr:hover td { background: #fafbff; }

/* ── Spec table in Asset Details ─────────────────────────────── */
.spec-table { width: 100%; }
.spec-table tr { border-bottom: 1px solid #f1f5f9; }
.spec-table tr:last-child { border-bottom: none; }
.spec-table td { padding: 5px 0; font-size: .8rem; }
.spec-table td:first-child { color: var(--text-muted); font-weight: 500; width: 140px; }
.spec-table td:last-child  { color: var(--text-primary); font-weight: 600; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; color: #cbd5e1; }
.empty-state p { font-size: .85rem; }

/* ── Utility ─────────────────────────────────────────────────── */
.text-blue   { color: var(--blue); }
.text-green  { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4   { margin-top: 16px; }
.mb-4   { margin-bottom: 16px; }
.gap-8  { gap: 8px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1280px) {
    .stat-cards-6 { grid-template-columns: repeat(3, 1fr); }
    .dashboard-grid { grid-template-columns: 260px 1fr 1fr; }
}
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-220px); }
    .stat-cards-5, .stat-cards-6 { grid-template-columns: repeat(2, 1fr); }
    .stat-cards-4 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .drawer { width: 100%; }
}
