/* ================================================================
   TIS ERP — Global Design System v2.0
   Total Interior Solutions | Premium ERP Interface
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Playfair+Display:wght@700&display=swap');

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
    --gold:        #b89c7d;
    --gold-hover:  #a38962;
    --gold-light:  #d4b896;
    --gold-bg:     rgba(184,156,125,0.09);

    --dark:        #111111;
    --dark-2:      #1c1c1c;

    --bg:          #f4f2ef;
    --surface:     #ffffff;
    --surface-2:   #faf9f7;
    --border:      #e6e0d8;
    --border-light:#f0ece6;

    --text-1:      #1a1a1a;
    --text-2:      #5a5450;
    --text-3:      #9b9490;

    --success:     #2d6a4f;
    --success-bg:  #edf7f1;
    --danger:      #c53030;
    --danger-bg:   #fff5f5;
    --warning:     #b45309;
    --warning-bg:  #fffbeb;
    --info:        #1d4ed8;
    --info-bg:     #eff6ff;

    --sidebar-w:   260px;
    --header-h:    60px;
    --page-pad:    28px;
    --card-pad:    24px;

    --r-sm:  6px;
    --r:     10px;
    --r-lg:  14px;
    --r-xl:  20px;

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow:      0 4px 16px rgba(0,0,0,0.07);
    --shadow-lg:   0 12px 40px rgba(0,0,0,0.10);
    --shadow-gold: 0 4px 16px rgba(184,156,125,0.28);

    --ease: 0.2s ease;
    --ease-slow: 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* ================================================================
   RESET + BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text-1);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; }
a { color: var(--gold); transition: color var(--ease); }
a:hover { color: var(--gold-hover); }
h1,h2,h3,h4,h5,h6 { font-family: 'DM Sans', sans-serif; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--ease-slow);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    margin: 0;
    line-height: 1;
}

.sidebar-brand .brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 21px;
    color: var(--gold);
    letter-spacing: 1px;
    display: block;
}

.sidebar-brand .brand-sub {
    font-size: 8.5px;
    letter-spacing: 2.8px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    font-weight: 500;
    display: block;
    margin-top: 3px;
    font-family: 'DM Sans', sans-serif;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--r-sm);
    transition: color var(--ease);
    line-height: 1;
}
.sidebar-close-btn:hover { color: rgba(255,255,255,0.8); }

/* Navigation */
.nav-links {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.nav-links::-webkit-scrollbar { width: 3px; }
.nav-links::-webkit-scrollbar-track { background: transparent; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--ease);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-links li a i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }

.nav-links li a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--gold-light);
    border-left-color: rgba(184,156,125,0.35);
}

.nav-links li.active > a {
    background: rgba(184,156,125,0.10);
    color: var(--gold);
    border-left-color: var(--gold);
}

.nav-links li.section-title {
    padding: 16px 20px 5px;
    font-size: 9px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.22);
    letter-spacing: 2px;
    font-weight: 600;
    cursor: default;
    user-select: none;
}

/* Sub-menus */
.nav-sub-menu {
    list-style: none;
    padding: 2px 0 4px 44px;
    margin: 0;
}
.nav-sub-menu li { margin: 0; }
.nav-sub-menu li a {
    padding: 7px 12px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.38);
    border-left: none;
    gap: 8px;
    font-weight: 400;
}
.nav-sub-menu li a:hover { color: var(--gold); background: transparent; border-left-color: transparent; }
.nav-sub-menu li a.nav-active { color: var(--gold); font-weight: 600; }

/* Sign Out */
.nav-logout { border-top: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.nav-logout li a {
    color: rgba(229,62,62,0.65) !important;
    font-size: 13.5px;
}
.nav-logout li a:hover {
    color: #fc8181 !important;
    background: rgba(229,62,62,0.07) !important;
    border-left-color: transparent !important;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-w));
    display: flex;
    flex-direction: column;
}

/* ================================================================
   HEADER
   ================================================================ */
header, header.app-header {
    background: var(--surface);
    height: var(--header-h);
    padding: 0 var(--page-pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

/* Hamburger */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r-sm);
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    transition: background var(--ease);
    flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-2);
    border-radius: 2px;
    transition: all var(--ease);
}

.header-left { display: flex; align-items: center; gap: 12px; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb .bc-parent { color: var(--text-3); }
.breadcrumb .bc-sep { color: var(--border); }
.breadcrumb .bc-current { color: var(--text-1); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 12px; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
    transition: border-color var(--ease);
    cursor: pointer;
    display: block;
}
.user-avatar:hover { border-color: var(--gold); }

/* ================================================================
   PAGE CONTENT
   ================================================================ */
.page-content, .container-fluid { padding: var(--page-pad); }
.dashboard-container { padding: var(--page-pad); }

/* ================================================================
   PAGE HEADER
   ================================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    margin: 0 0 2px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-3);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ================================================================
   STAT CARDS
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    padding: 22px 22px 20px;
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--gold);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--ease), transform var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 8px;
}
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1; }

/* ================================================================
   CARDS
   ================================================================ */
.tis-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tis-card-body { padding: var(--card-pad); }
.tis-card-header {
    padding: 18px var(--card-pad);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin: 0 0 16px;
}

/* ================================================================
   SEARCH BAR
   ================================================================ */
.search-wrap {
    position: relative;
}
.search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 13px;
    pointer-events: none;
}
.search-wrap input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-1);
    transition: border-color var(--ease), box-shadow var(--ease);
    outline: none;
}
.search-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,156,125,0.12); }
.search-wrap input::placeholder { color: var(--text-3); }

/* ================================================================
   CATEGORY PILLS
   ================================================================ */
.pills-wrap {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    flex-wrap: wrap;
}
.pills-wrap::-webkit-scrollbar { display: none; }

.cat-pill {
    padding: 7px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12.5px;
    transition: all var(--ease);
    white-space: nowrap;
    outline: none;
    font-family: inherit;
    flex-shrink: 0;
}
.cat-pill:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-bg); }
.cat-pill.active {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

/* ================================================================
   TABLES
   ================================================================ */
.tis-table-wrap {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.tis-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tis-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
    min-width: 600px;
}

.tis-table thead tr { border-bottom: 2px solid var(--border-light); }

.tis-table thead th {
    padding: 14px 16px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gold);
    background: var(--surface-2);
    white-space: nowrap;
}
.tis-table thead th:first-child { padding-left: 20px; }
.tis-table thead th:last-child { padding-right: 20px; text-align: right; }

.tis-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--ease);
}
.tis-table tbody tr:last-child { border-bottom: none; }
.tis-table tbody tr:hover { background: #fdf8f3; }

.tis-table tbody td {
    padding: 13px 16px;
    vertical-align: middle;
}
.tis-table tbody td:first-child { padding-left: 20px; }
.tis-table tbody td:last-child { padding-right: 20px; text-align: right; }

/* Action icon buttons in tables */
.tbl-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}
.tbl-actions a, .tbl-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-3);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--ease);
    font-family: inherit;
}
.tbl-actions a:hover { background: var(--bg); color: var(--text-1); border-color: var(--text-3); }
.tbl-actions a.action-edit:hover { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }
.tbl-actions a.action-delete:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.tbl-actions a.action-view:hover { color: var(--info); border-color: var(--info); background: var(--info-bg); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--r);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--ease);
    white-space: nowrap;
    line-height: 1;
}

.btn-primary, .btn-premium {
    background: var(--gold);
    color: white !important;
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    width: auto;
    border: none;
    padding: 10px 22px;
    border-radius: var(--r);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.btn-primary:hover, .btn-premium:hover {
    background: var(--gold-hover);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(184,156,125,0.38);
}

.btn-dark {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}
.btn-dark:hover { background: #2a2a2a; color: white; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--gold);
    border-color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: white; }

.btn-ghost {
    background: var(--bg);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border-light); color: var(--text-1); }

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

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 14px; }

/* Tab toggle */
.btn-tab {
    padding: 9px 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 12.5px;
    transition: all var(--ease);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-tab:hover { border-color: var(--text-3); color: var(--text-1); }
.btn-tab.active { background: var(--dark); color: white; border-color: var(--dark); }

/* ================================================================
   FORMS
   ================================================================ */
.tis-input,
.tis-input[type="text"],
.tis-input[type="number"],
.tis-input[type="email"],
.tis-input[type="password"],
.tis-input[type="date"],
.tis-input[type="file"],
select.tis-input,
textarea.tis-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-1);
    transition: border-color var(--ease), box-shadow var(--ease);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    display: block;
}
.tis-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,156,125,0.12);
}
.tis-input::placeholder { color: var(--text-3); }
.tis-input[readonly] { background: var(--surface-2); color: var(--text-2); cursor: default; }

select.tis-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M5 6L0 0h10z' fill='%239b9490'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}
.form-group { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* Checkbox label */
.check-box-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    transition: all var(--ease);
    user-select: none;
}
.check-box-label:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-bg); }
.check-box-label input[type="checkbox"] { accent-color: var(--gold); width: 14px; height: 14px; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-gold    { background: var(--gold-bg); color: var(--gold-hover); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg); color: var(--info); }
.badge-muted   { background: var(--bg); color: var(--text-3); }

/* ================================================================
   TOGGLE SWITCH
   ================================================================ */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #d1ccc6;
    border-radius: 22px;
    transition: var(--ease);
}
.slider::before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--ease);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(24px); }
.switch input:focus + .slider { box-shadow: 0 0 0 2px rgba(45,106,79,0.2); }

/* ================================================================
   MODALS
   ================================================================ */
/* Works with existing inline display:flex modals */
[id$="Modal"] {
    align-items: center;
    justify-content: center;
}

/* Enhance existing modal boxes */
[id$="Modal"] > div:first-child {
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal backdrop */
.tis-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tis-modal-overlay.show { display: flex; }
.tis-modal {
    background: var(--surface);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.25s ease;
}
.tis-modal-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tis-modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.tis-modal-body { padding: 28px; }
.tis-modal-footer { padding: 16px 28px 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* ================================================================
   ASSET GRID (Furniture Grid View)
   ================================================================ */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.asset-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--ease), transform var(--ease);
}
.asset-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ================================================================
   FILTER TOOLBAR (search + filters combined)
   ================================================================ */
.filter-toolbar {
    background: var(--surface);
    padding: 16px 20px;
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

/* ================================================================
   ONLINE STATUS PULSE
   ================================================================ */
.online-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2.5s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ================================================================
   SIDEBAR OVERLAY (mobile)
   ================================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--ease-slow);
}
.sidebar-overlay.show { display: block; opacity: 1; }

/* Custom scroll container */
.custom-scroll-container {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.custom-scroll-container::-webkit-scrollbar { width: 5px; }
.custom-scroll-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--dark);
}

.login-panel-brand {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: linear-gradient(155deg, #1c1208 0%, #111 55%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

.login-panel-brand::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184,156,125,0.07) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.login-panel-brand .brand-logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 52px;
    color: var(--gold);
    letter-spacing: 3px;
    margin: 0;
    position: relative;
}

.login-panel-brand .brand-tagline {
    font-size: 11px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.22);
    margin-top: 12px;
    font-weight: 400;
}

.login-panel-brand .brand-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    margin-top: 32px;
    line-height: 1.8;
    max-width: 300px;
}

.login-panel-form {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    flex-shrink: 0;
}

.login-inner {
    width: 100%;
}

.login-header { margin-bottom: 36px; }

.login-header .login-logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    color: var(--gold);
    margin: 0 0 6px;
    letter-spacing: 1px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-3);
    margin: 0;
}

.login-field { margin-bottom: 18px; }

.login-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-3);
    margin-bottom: 7px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-1);
    background: var(--surface);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
}
.login-field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,156,125,0.14);
}
.login-field input::placeholder { color: var(--text-3); }

.login-submit {
    width: 100%;
    padding: 13px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: var(--r);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all var(--ease);
    margin-top: 8px;
    box-shadow: var(--shadow-gold);
}
.login-submit:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(184,156,125,0.40);
}

/* Legacy selectors — keep working */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, #2a2a2a 100%);
}
.login-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.justify-center  { justify-content: center; }
.gap-2           { gap: 8px; }
.gap-3           { gap: 12px; }
.gap-4           { gap: 16px; }
.gap-5           { gap: 20px; }
.gap-6           { gap: 24px; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1; }

.fw-400          { font-weight: 400; }
.fw-500          { font-weight: 500; }
.fw-600          { font-weight: 600; }
.fw-700          { font-weight: 700; }
.fw-800          { font-weight: 800; }

.text-gold       { color: var(--gold); }
.text-muted      { color: var(--text-3); }
.text-secondary  { color: var(--text-2); }
.text-danger     { color: var(--danger); }
.text-success    { color: var(--success); }
.text-primary    { color: var(--text-1); }

.text-right      { text-align: right; }
.text-center     { text-align: center; }
.text-sm         { font-size: 12px; }
.text-xs         { font-size: 11px; }
.text-uppercase  { text-transform: uppercase; letter-spacing: 0.7px; }

.m-0             { margin: 0; }
.mt-0            { margin-top: 0; }
.mb-0            { margin-bottom: 0; }
.mb-3            { margin-bottom: 12px; }
.mb-4            { margin-bottom: 16px; }
.mb-5            { margin-bottom: 20px; }
.mb-6            { margin-bottom: 24px; }

.p-0             { padding: 0; }
.w-100           { width: 100%; }
.truncate        { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap          { white-space: nowrap; }
.d-none          { display: none !important; }

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* ---- Tablets (≤ 1024px) ---- */
@media (max-width: 1024px) {
    :root { --sidebar-w: 240px; }

    .form-grid-3 { grid-template-columns: 1fr 1fr; }
    .span-3 { grid-column: span 2; }
}

/* ---- Mobile (≤ 768px) ---- */
@media (max-width: 768px) {
    :root {
        --page-pad:  16px;
        --card-pad:  18px;
    }

    /* Sidebar becomes off-canvas drawer */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1001;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .sidebar-close-btn { display: block; }

    /* Main takes full width */
    .main-content { margin-left: 0; width: 100%; }

    /* Show hamburger */
    .hamburger-btn { display: inline-flex; }

    /* Header shrinks */
    header, header.app-header { padding: 0 var(--page-pad); }

    /* Page header stacks */
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-actions { width: 100%; }

    /* Stats 2 col */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Forms collapse */
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: span 1; }

    /* Asset grid 2 col */
    .asset-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Pills no wrap on mobile */
    .pills-wrap { flex-wrap: nowrap; }

    /* Modal full width */
    .tis-modal { border-radius: var(--r-lg); }

    /* Login */
    .login-panel-brand { display: none; }
    .login-panel-form { max-width: 100%; padding: 40px 24px; }

    /* Show mobile login alternative */
    .login-page { background: var(--surface); }

    /* Hide less important table columns */
    .hide-mobile { display: none !important; }

    /* Stacked login */
    .login-container { align-items: flex-start; background: white; padding-top: 60px; }
    .login-card { box-shadow: none; padding: 2rem; }
}

/* ---- Small mobile (≤ 480px) ---- */
@media (max-width: 480px) {
    :root { --page-pad: 12px; }

    .page-title { font-size: 18px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px 14px 12px; }
    .stat-card .value { font-size: 22px; }

    .asset-grid { grid-template-columns: 1fr; }

    .btn { padding: 9px 16px; font-size: 12.5px; }
    .btn-lg { padding: 11px 22px; font-size: 13px; }

    .page-actions .btn, .page-actions a.btn { flex: 1; }

    .tis-table { font-size: 12.5px; }
    .tis-table tbody td,
    .tis-table thead th { padding: 10px 12px; }

    .login-panel-form { padding: 30px 20px; }
    .login-inner .login-logo { font-size: 24px; }
}

/* ---- Large screens (≥ 1280px) ---- */
@media (min-width: 1280px) {
    .login-panel-brand { display: flex; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Very large screens (≥ 1600px) ---- */
@media (min-width: 1600px) {
    :root { --page-pad: 36px; }
    .stats-grid { gap: 24px; }
}
