/* ============================
   RESET & BASE
============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f8fafc;
    display: flex;
    height: 100vh;
    overflow: hidden;
    color: #1e293b;
}

/* ============================
   SIDEBAR
============================ */
.sidebar {
    width: 260px;
    background: #0b1a33;
    color: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s ease;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-area a span,
.sidebar.collapsed .sidebar-logo {
    display: none;
}

.sidebar-logo {
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #1a2a47;
    cursor: pointer;
}

.menu-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 15px;
}

.menu-group {
    margin-bottom: 22px;
}

.menu-label {
    font-size: 0.72rem;
    color: #7b8aa3;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 0 22px;
    display: block;
    font-weight: 700;
    border-top: 1px solid #1a2a47;
    padding-top: 14px;
}

.menu-group:first-child .menu-label {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.menu-area a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    margin: 2px 10px;
    color: #b0b8c4;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
}

.menu-area a i {
    width: 18px;
    text-align: center;
}

.menu-area a:hover {
    background: #1a2a47;
    color: #fff;
}

/* active page highlight */
.menu-area a.active {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}

/* ============================
   MAIN CONTENT
============================ */
.main-content {
    flex-grow: 1;
    padding: 25px 30px;
    overflow-y: auto;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.hamburger {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #1e293b;
}

.breadcrumb {
    font-size: 14px;
    color: #64748b;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

h2 {
    margin-top: 5px;
    font-size: 26px;
    color: #0f172a;
}

.page-subtitle {
    color: #64748b;
    margin-bottom: 18px;
    font-size: 14px;
}

/* ============================
   SEARCH BAR
============================ */
.search-bar {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    display: block;
}

.search-bar:focus {
    outline: none;
    border-color: #2563eb;
}

/* ============================
   TOOLBAR & BUTTONS
============================ */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: #14235c;
    color: #fff;
}
.btn-primary:hover { background: #0d1a45; }

.btn-info {
    background: #1d4ed8;
    color: #fff;
}
.btn-info:hover { background: #1e40af; }

.btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
}
.btn-secondary:hover { background: #cbd5e1; }

.btn-danger {
    background: #991b1b;
    color: #fff;
}
.btn-danger:hover { background: #7f1d1d; }

/* ============================
   DROPDOWN
============================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    min-width: 150px;
    overflow: visible;
}

.dropdown-content a {
    color: #333;
    padding: 10px 14px;
    display: block;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-content a:hover { background: #f1f5f9; }

.dropdown-content a.text-danger { color: #dc2626; }

/* Three-dot row action button */
.btn-action {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.btn-action:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-action:focus,
.btn-action:active {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}

/* ============================
   TABLE
============================ */
.clean-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.clean-table th,
.clean-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

.clean-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
}

.clean-table th:first-child { border-top-left-radius: 8px; }
.clean-table th:last-child { border-top-right-radius: 8px; }

.clean-table tbody tr:hover {
    background: #f8fafc;
}

.clean-table td:last-child {
    position: relative;
    overflow: visible;
}

.row-img {
    border-radius: 6px;
    object-fit: cover;
}

.empty-row {
    text-align: center;
    color: #94a3b8;
    padding: 30px 0 !important;
}

/* ============================
   BADGES
============================ */
.badge-active {
    background: #dcfce7;
    color: #16a34a;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-inactive {
    background: #fee2e2;
    color: #dc2626;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================
   PAGINATION
============================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.pagination span {
    font-size: 14px;
    color: #64748b;
}

/* ============================
   SIDEBAR PROFILE SECTION
============================ */
.profile-section {
    border-top: 1px solid #1a2a47;
    padding: 15px;
    flex-shrink: 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.profile-header:hover {
    background: #1a2a47;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.profile-email {
    font-size: 11px;
    color: #7b8aa3;
}

.profile-menu {
    display: none;
    margin-top: 8px;
    padding-left: 4px;
}

.profile-menu.open {
    display: block;
}

.profile-menu a {
    display: block;
    padding: 8px 10px;
    font-size: 13px;
    color: #b0b8c4;
    text-decoration: none;
    border-radius: 6px;
}

.profile-menu a:hover {
    background: #1a2a47;
    color: #fff;
}

.sidebar.collapsed .profile-name,
.sidebar.collapsed .profile-email,
.sidebar.collapsed .profile-menu {
    display: none;
}

/* ============================
   DASHBOARD WIDGETS
============================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.dashboard-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dashboard-card .card-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 5px;
}

.dashboard-card .card-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
}

.dashboard-card .card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #2563eb;
    font-size: 1.2rem;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
    margin-bottom: 25px;
}

.chart-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chart-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-box-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.view-all {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.85rem;
}

.view-all:hover {
    text-decoration: underline;
}

.empty-list {
    color: #94a3b8;
    font-size: 0.9rem;
    text-align: center;
    padding: 40px 0;
}

/* ============================
   ACTION-BTN (used by customers.php style buttons)
============================ */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    background: #14235c;
    color: #fff;
}

.action-btn:hover {
    background: #0d1a45;
}

/* ============================
   GENERIC TABLE (fallback for tables without .clean-table class)
============================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

table th,
table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
}

table th:first-child { border-top-left-radius: 8px; }
table th:last-child { border-top-right-radius: 8px; }

table tbody tr:hover {
    background: #f8fafc;
}

/* ============================
   FILTER DRAWER (used on Products page)
============================ */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 900;
}
.overlay.active { display: block; }

.filter-drawer {
    position: fixed;
    top: 0; right: -400px;
    width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    transition: 0.3s;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}
.filter-drawer.active { right: 0; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    font-size: 13px;
}
.filter-group select {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 4px;
}

/* ============================
   FLASH MESSAGES
============================ */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.flash-success { background: #dcfce7; color: #16a34a; }
.flash-error   { background: #fee2e2; color: #dc2626; }

/* ============================
   DROPDOWN OPEN STATE (export menu, row menus)
============================ */
.dropdown-content.show { display: block; }

/* ============================
   FILTER INPUT / SELECT (aliases matching filter-group select)
============================ */
.filter-input,
.filter-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 18px;
    align-items: center;
}

.link-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }

.date-range-row {
    display: flex;
    gap: 10px;
}

/* Wide variant of the filter-drawer, for forms that need more room (e.g. Create Order) */
.filter-drawer.wide {
    width: 480px;
    right: -520px;
}
.filter-drawer.wide.active { right: 0; }

.drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* ============================
   PURCHASE ORDER STATUS BADGES / MISC (Purchases page)
============================ */
.po-due { color: #dc2626; }

.status-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.status-draft     { background: #f1f5f9; color: #475569; }
.status-ordered   { background: #dbeafe; color: #1d4ed8; }
.status-partial   { background: #fef3c7; color: #b45309; }
.status-received  { background: #dcfce7; color: #16a34a; }
.status-completed { background: #dcfce7; color: #16a34a; }
.status-cancelled { background: #fee2e2; color: #dc2626; }

.pagination-info {
    color: #64748b;
    font-size: 14px;
    margin-top: 18px;
}

/* ============================
   CREATE ORDER FORM (line items)
============================ */
.item-block {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    position: relative;
}

.remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
}

.item-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.line-total-row {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
}

.add-product-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
}

.totals-row.grand {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
}

.discount-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.discount-input-wrap input {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* ============================
   PURCHASE ORDER LETTERHEAD (inside Create Order panel, light theme)
============================ */
.po-letterhead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.po-letterhead-brand { display: flex; align-items: center; gap: 12px; }
.po-letterhead-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #14235c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.po-letterhead-name { font-weight: 700; color: #0f172a; font-size: 15px; }
.po-letterhead-line { color: #64748b; font-size: 12px; }
.po-letterhead-title { text-align: right; }
.po-letterhead-title h3 { margin: 0; color: #0f172a; }

/* ============================
   CENTERED MODAL CARD (Create Order — same white-card style as add_suppliers.php)
============================ */
.modal-center-wrap {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 20px;
}
.modal-center-wrap.active { display: flex; }

.modal-card {
    max-width: 700px;
    width: 100%;
    position: relative;
    margin: 0 auto;
}

/* ============================
   DARK MODE (body.theme-dark) — applied site-wide via sidebar.php script.
   Light mode (default, no class) is completely unaffected below.
============================ */
body.theme-dark {
    background-color: #0f172a;
    color: #e2e8f0;
}

body.theme-dark .sidebar {
    background: #0b1a33;
}

body.theme-dark .main-content { background-color: #0f172a; }
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark .breadcrumb,
body.theme-dark .hamburger { color: #e2e8f0; }

body.theme-dark .page-subtitle { color: #94a3b8; }

body.theme-dark .chart-box,
body.theme-dark .dashboard-card,
body.theme-dark .clean-table,
body.theme-dark table,
body.theme-dark .modal-card,
body.theme-dark .filter-drawer,
body.theme-dark .account-tabs {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .clean-table th,
body.theme-dark table th {
    background: #273449;
    color: #cbd5e1;
}

body.theme-dark .clean-table td,
body.theme-dark table td {
    border-bottom-color: #334155;
}

body.theme-dark .clean-table tbody tr:hover,
body.theme-dark table tbody tr:hover {
    background: #24304a;
}

body.theme-dark .filter-input,
body.theme-dark .filter-select,
body.theme-dark .search-bar,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: #273449;
    border-color: #3a4a63;
    color: #e2e8f0;
}

body.theme-dark .filter-input::placeholder,
body.theme-dark input::placeholder {
    color: #64748b;
}

body.theme-dark .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}
body.theme-dark .btn-secondary:hover { background: #475569; }

body.theme-dark .btn-action {
    background: #273449;
    border-color: #3a4a63;
    color: #cbd5e1;
}
body.theme-dark .btn-action:hover { background: #334155; color: #fff; }

body.theme-dark .dropdown-content {
    background: #1e293b;
    border-color: #334155;
}
body.theme-dark .dropdown-content a { color: #e2e8f0; }
body.theme-dark .dropdown-content a:hover { background: #273449; }

body.theme-dark .account-tab-link { color: #cbd5e1; }
body.theme-dark .account-tab-link:hover { background: #273449; }

body.theme-dark .theme-option {
    border-color: #334155;
    color: #e2e8f0;
    background: #1e293b;
}

body.theme-dark a.link-btn { color: #60a5fa; }

body.theme-dark .empty-row,
body.theme-dark .empty-list { color: #64748b; }

/* ============================
   LIGHT-MODE SIDEBAR (body.theme-light) — makes the sidebar switch to a
   white/light theme instead of staying fixed navy, matching Dark's full
   black switch. Only applies when explicitly in Light (or System resolving
   to light); Dark mode keeps the original navy .sidebar rules untouched.
============================ */
body.theme-light .sidebar {
    background: #ffffff;
    color: #1e293b;
    border-right: 1px solid #e2e8f0;
}
body.theme-light .sidebar-logo {
    color: #14235c;
    border-bottom-color: #e2e8f0;
}
body.theme-light .menu-label {
    color: #64748b;
    border-top-color: #e2e8f0;
}
body.theme-light .menu-area a {
    color: #334155;
}
body.theme-light .menu-area a:hover {
    background: #f1f5f9;
    color: #0f172a;
}
body.theme-light .menu-area a.active {
    background: #2563eb;
    color: #fff;
}
body.theme-light .profile-section {
    border-top-color: #e2e8f0;
}
body.theme-light .profile-header:hover {
    background: #f1f5f9;
}
body.theme-light .profile-name {
    color: #0f172a;
}
body.theme-light .profile-email {
    color: #64748b;
}
body.theme-light .profile-menu a {
    color: #334155;
}
body.theme-light .profile-menu a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* ============================================================
   MOBILE RESPONSIVE (screens 768px and narrower — phones/small tablets)
   Sidebar becomes a hidden off-canvas panel that slides in as an overlay
   when the existing hamburger button is tapped (reuses the same
   .collapsed class the hamburger already toggles — no JS changes needed).
   Grids drop to a single column, tables scroll instead of squeezing.
============================================================ */
@media (max-width: 768px) {

    body {
        overflow: visible;
        height: auto;
        min-height: 100vh;
    }

    /* Sidebar: hidden off-canvas by default, slides in as an overlay
       when .collapsed is toggled on (same class/button the hamburger
       already uses — its meaning is just flipped at this screen size) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        z-index: 2000;
        transform: translateX(-100%);
        box-shadow: 4px 0 18px rgba(0,0,0,0.25);
    }
    .sidebar.collapsed {
        width: 260px;
        transform: translateX(0);
    }
    /* undo the desktop icon-only-collapse hiding rules at mobile size,
       since here .collapsed means "sidebar open", not "narrow icon rail" */
    .sidebar.collapsed .menu-label,
    .sidebar.collapsed .menu-area a span,
    .sidebar.collapsed .sidebar-logo,
    .sidebar.collapsed .profile-name,
    .sidebar.collapsed .profile-email,
    .sidebar.collapsed .profile-menu.open {
        display: revert;
    }

    /* Main content always takes the full screen width on mobile */
    .main-content {
        width: 100%;
        padding: 16px;
        overflow-y: visible;
    }

    .topbar {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    h2 { font-size: 20px; }

    /* Dashboard / chart / filter / order-form grids: single column on phone */
    .dashboard-grid,
    .chart-row,
    .filter-grid,
    .item-row-2 {
        grid-template-columns: 1fr;
    }

    /* Tables: allow horizontal scroll instead of squashing columns */
    .clean-table,
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Filter drawer and modal card: full-width on phone */
    .filter-drawer,
    .filter-drawer.wide {
        width: 100%;
        right: -100%;
    }
    .filter-drawer.active,
    .filter-drawer.wide.active {
        right: 0;
    }

    .modal-card {
        max-width: 100%;
    }

    .toolbar,
    .toolbar-left {
        width: 100%;
    }

    .search-bar {
        max-width: 100%;
    }

    /* ----------------------------------------------------------
       TABLE -> CARD LIST on phone (Users, Suppliers, Categories,
       Products, etc.) instead of a squeezed horizontal table.
       Each row becomes its own rounded card; cells stack inside it.
       If a <td> has a data-label="..." attribute, that label shows
       next to the value (e.g. data-label="Phone"); cells without
       one just show the value alone.
    ---------------------------------------------------------- */
    .clean-table thead,
    table thead {
        display: none;
    }

    .clean-table,
    table {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .clean-table tbody tr,
    table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        margin-bottom: 14px;
        padding: 10px 14px;
    }

    .clean-table tbody tr:hover,
    table tbody tr:hover {
        background: #fff;
    }

    .clean-table td,
    table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 2px;
        border-bottom: 1px dashed #eef2f7;
        font-size: 14px;
        text-align: right;
    }

    .clean-table td:last-child,
    table td:last-child {
        border-bottom: none;
    }

    .clean-table td[data-label]::before,
    table td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 12px;
        text-align: left;
        margin-right: auto;
    }

    /* checkbox / image / action cells: keep them compact, not stretched */
    .clean-table td:has(input[type="checkbox"]),
    table td:has(input[type="checkbox"]) {
        justify-content: flex-start;
    }

    .row-img {
        width: 42px;
        height: 42px;
    }

    body.theme-dark .clean-table tbody tr,
    body.theme-dark table tbody tr {
        background: #1e293b;
        border-color: #334155;
    }
    body.theme-dark .clean-table tbody tr:hover,
    body.theme-dark table tbody tr:hover {
        background: #1e293b;
    }
    body.theme-dark .clean-table td,
    body.theme-dark table td {
        border-bottom-color: #334155;
    }

    /* ---- card polish: checkbox compact at top, action button pinned to the
       top-right corner of the card (matches the reference layout), and two
       utility classes pages can opt into: .hide-on-mobile to drop a less
       important column on phone, .td-inline so two badges/pills sit on the
       same line instead of stacking ---- */
    .clean-table tbody tr,
    table tbody tr {
        position: relative;
        padding-right: 50px;
    }
    .clean-table td:has(input[type="checkbox"]),
    table td:has(input[type="checkbox"]) {
        display: inline-flex;
        width: auto;
        padding-bottom: 8px;
        border-bottom: none;
    }
    .clean-table td:last-child,
    table td:last-child {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 0;
        border-bottom: none;
    }
    .hide-on-mobile {
        display: none !important;
    }
    .td-inline {
        display: inline-flex !important;
        width: auto !important;
        padding-right: 16px !important;
        border-bottom: none !important;
    }
}