        body {
            margin: 0;
            padding-top: 0;
            padding-bottom: 120px;
            background: #fff;
            color: #1f2937;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            font-size: 14px;
        }
        .dark body { background: #1b1c1d; color: #e0e0e0; }

        a:not(.btn) { color: #2185d0; text-decoration: none; }
        a:not(.btn):hover { color: #1678c2; }
        .dark a:not(.btn) { color: #6ab0f3; }
        .dark a:not(.btn):hover { color: #8ec8f9; }

        /* ===== Tables ===== */
        .tbl-wrap {
            width: 100%;
            max-width: 100%;
            overflow-x: auto;
        }
        .tbl {
            width: 100%;
            max-width: 100%;
            border-collapse: collapse;
            font-size: 12px;
            background: #fff;
            border: 1px solid #e5e7eb;
            table-layout: fixed;
        }
        body { overflow-x: hidden; }
        .tbl thead th {
            background: #f9fafb;
            color: #374151;
            text-align: left;
            padding: 6px 8px;
            border-bottom: 1px solid #e5e7eb;
            font-weight: 600;
            position: relative;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .tbl tbody td {
            padding: 4px 8px;
            border-top: 1px solid #f0f0f0;
            vertical-align: middle;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .tbl tbody tr:hover { background: #f9fafb; }
        .tbl tbody tr.row-negative { background: #fef2f2; }
        .tbl tbody tr.row-warning  { background: #fefce8; }
        .tbl tbody tr.row-positive { background: #f0fdf4; }
        /* Cells that should wrap (e.g. force normal wrap for long descriptions) */
        .tbl tbody td.td-wrap { white-space: normal; }

        .dark .tbl { background: #27292a; border-color: #3d3d3d; }
        .dark .tbl thead th { background: #1f2021; color: #e0e0e0; border-bottom-color: #3d3d3d; }
        .dark .tbl tbody td { border-top-color: #3d3d3d; }
        .dark .tbl tbody tr:hover { background: rgba(255,255,255,.04); }
        .dark .tbl tbody tr.row-negative { background: #3d1f1f; color: #e8a0a0; }
        .dark .tbl tbody tr.row-warning  { background: #3d3520; color: #f0dfb0; }
        .dark .tbl tbody tr.row-positive { background: #1e3a1e; color: #b5e6b5; }

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

        /* Row action menu (⋯) — the list is position:fixed because `.tbl tbody td`
           has overflow:hidden and would clip an absolutely positioned menu. */
        .row-menu { position: relative; }
        .row-menu-list {
            display: none;
            position: fixed;
            min-width: 190px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
            box-shadow: 0 6px 18px rgba(0,0,0,.15);
            padding: 4px 0;
            z-index: 1000;
        }
        .row-menu.open .row-menu-list { display: block; }
        .row-menu-item {
            display: block;
            width: 100%;
            text-align: left;
            padding: 6px 12px;
            font-size: 12px;
            line-height: 1.4;
            color: #374151;
            background: none;
            border: 0;
            cursor: pointer;
            white-space: nowrap;
        }
        .row-menu-item:hover { background: #f3f4f6; color: #111827; }
        .row-menu-sep { height: 1px; background: #e5e7eb; margin: 4px 0; }
        .dark .row-menu-list { background: #27292a; border-color: #3d3d3d; }
        .dark .row-menu-item { color: #e0e0e0; }
        .dark .row-menu-item:hover { background: rgba(255,255,255,.08); color: #fff; }
        .dark .row-menu-sep { background: #3d3d3d; }

        /* ===== Buttons ===== */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            padding: 4px 10px;
            border-radius: 4px;
            border: 1px solid transparent;
            cursor: pointer;
            font-weight: 500;
            line-height: 1.2;
            user-select: none;
            text-decoration: none;
            background: #e5e7eb;
            color: #1f2937;
            transition: background .12s, color .12s;
        }
        .btn:hover { background: #d1d5db; color: #111827; }
        .btn:disabled { opacity: .5; cursor: not-allowed; }
        .btn-sm { font-size: 10px; padding: 2px 6px; }

        .btn-primary { background: #2185d0; color: #fff; }
        .btn-primary:hover { background: #1678c2; color: #fff; }
        .btn-default { background: #e5e7eb; color: #1f2937; }
        .btn-default:hover { background: #d1d5db; color: #111827; }
        .btn-teal { background: #00b5ad; color: #fff; }
        .btn-teal:hover { background: #009c95; color: #fff; }
        .btn-red { background: #db2828; color: #fff; }
        .btn-red:hover { background: #c81e1e; color: #fff; }
        .btn-olive { background: #b5cc18; color: #fff; }
        .btn-olive:hover { background: #a3b817; color: #fff; }
        .btn-green { background: #21ba45; color: #fff; }
        .btn-green:hover { background: #1ea73c; color: #fff; }
        .btn-blue { background: #2185d0; color: #fff; }
        .btn-blue:hover { background: #1678c2; color: #fff; }
        .btn-orange { background: #f2711c; color: #fff; }
        .btn-orange:hover { background: #e0671b; color: #fff; }
        .btn-yellow { background: #fbbd08; color: #fff; }
        .btn-yellow:hover { background: #eaae07; color: #fff; }

        .dark .btn-default { background: #3d3d3d; color: #e0e0e0; }
        .dark .btn-default:hover { background: #4a4a4a; color: #fff; }

        /* ===== Badges ===== */
        .badge {
            display: inline-block;
            font-size: 11px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 500;
            line-height: 1.4;
            white-space: nowrap;
        }
        .badge-green  { background: #dcfce7; color: #166534; }
        .badge-red    { background: #fee2e2; color: #991b1b; }
        .badge-blue   { background: #dbeafe; color: #1e40af; }
        .badge-yellow { background: #fef3c7; color: #92400e; }
        .badge-gray   { background: #e5e7eb; color: #374151; }
        .badge-orange { background: #ffedd5; color: #9a3412; }
        .badge-teal   { background: #ccfbf1; color: #115e59; }

        .dark .badge-green  { background: #1e3a1e; color: #b5e6b5; }
        .dark .badge-red    { background: #3d1f1f; color: #e8a0a0; }
        .dark .badge-blue   { background: #1e2d3a; color: #b5d5e6; }
        .dark .badge-yellow { background: #3d3520; color: #f0dfb0; }
        .dark .badge-gray   { background: #3d3d3d; color: #e0e0e0; }
        .dark .badge-orange { background: #3d2c1e; color: #f0c08a; }
        .dark .badge-teal   { background: #1e3a38; color: #a0e0d8; }

        /* ===== Inputs ===== */
        .input {
            display: inline-block;
            font-size: 13px;
            padding: 5px 8px;
            border: 1px solid #d1d5db;
            border-radius: 4px;
            background: #fff;
            color: #1f2937;
            line-height: 1.4;
            outline: none;
            box-sizing: border-box;
        }
        .input:focus { border-color: #2185d0; box-shadow: 0 0 0 2px rgba(33,133,208,.2); }
        .input:disabled, .input[readonly] { background: #f3f4f6; color: #6b7280; }
        textarea.input { font-family: inherit; resize: vertical; }
        .dark .input { background: #1f2021; color: #e0e0e0; border-color: #3d3d3d; }
        .dark .input:focus { border-color: #2185d0; }
        .dark .input:disabled, .dark .input[readonly] { background: #2a2a2a; color: #888; }
        .dark .input::placeholder { color: #888; }

        label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            margin-bottom: 4px;
            color: #374151;
        }
        .dark label { color: #e0e0e0; }
        label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; margin-bottom: 0; }

        /* ===== Cards ===== */
        .card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            padding: 16px;
            box-shadow: 0 1px 2px rgba(0,0,0,.04);
        }
        .dark .card { background: #27292a; border-color: #3d3d3d; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

        /* ===== Modals ===== */
        .modal-bg {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,.5);
            z-index: 1000;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding-top: 60px;
            overflow-y: auto;
        }
        .modal-box {
            background: #fff;
            border-radius: 6px;
            padding: 20px;
            width: 600px;
            max-width: 95%;
            box-shadow: 0 10px 25px rgba(0,0,0,.2);
            color: #1f2937;
            margin-bottom: 60px;
        }
        .dark .modal-bg { background: rgba(0,0,0,.7); }
        .dark .modal-box { background: #27292a; color: #e0e0e0; }

        /* ===== Messages ===== */
        .msg-ok, .msg-err, .msg-info, .msg-warn {
            padding: 10px 14px;
            border-radius: 4px;
            margin-bottom: 12px;
            font-size: 13px;
            border: 1px solid transparent;
        }
        .msg-ok   { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
        .msg-err  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
        .msg-info { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
        .msg-warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
        .dark .msg-ok   { background: #1e3a1e; color: #b5e6b5; border-color: #2e5a2e; }
        .dark .msg-err  { background: #3d1f1f; color: #e8a0a0; border-color: #5a2d2d; }
        .dark .msg-info { background: #1e2d3a; color: #b5d5e6; border-color: #2e4d5a; }
        .dark .msg-warn { background: #3d3520; color: #f0dfb0; border-color: #5d5530; }

        /* ===== Tooltips (data-tooltip) ===== */
        [data-tooltip] { position: relative; }
        [data-tooltip]:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 0;
            top: 100%;
            background: #333;
            color: #fff;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 12px;
            z-index: 1000;
            max-width: 400px;
            white-space: normal;
            word-wrap: break-word;
        }

        /* ===== Resizable Columns ===== */
        .col-resize-handle {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 5px;
            cursor: col-resize;
            z-index: 10;
        }
        .col-resize-handle:hover,
        .col-resize-handle.active { background: rgba(0,0,0,.15); }
        .dark .col-resize-handle:hover,
        .dark .col-resize-handle.active { background: rgba(255,255,255,.2); }

        /* ===== Pagination (.pager) ===== */
        .pager { display: inline-flex; gap: 2px; margin-top: 12px; flex-wrap: wrap; }
        .pager a, .pager span {
            display: inline-block;
            padding: 4px 10px;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
            font-size: 12px;
            color: #374151;
            background: #fff;
            text-decoration: none;
        }
        .pager a:hover { background: #f3f4f6; }
        .pager .active { background: #2185d0; color: #fff; border-color: #2185d0; }
        .dark .pager a, .dark .pager span { background: #27292a; color: #e0e0e0; border-color: #3d3d3d; }
        .dark .pager a:hover { background: rgba(255,255,255,.08); }

        /* ===== Nav ===== */
        .nav-bar {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 2px;
            padding: 4px 12px;
            position: sticky;
            top: 0;
            z-index: 1000;
            background: #fff;
            border-bottom: 1px solid #e5e7eb;
            margin-bottom: 10px;
        }
        .dark .nav-bar { background: #1b1c1d; border-bottom-color: #3d3d3d; }
        .nav-bar a.nav-item, .nav-bar .nav-item {
            padding: 6px 12px;
            border-radius: 4px;
            color: #374151;
            font-size: 14px;
            line-height: 1.3;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }
        .nav-bar a.nav-item:hover, .nav-bar .nav-item:hover { background: #f3f4f6; color: #111827; }
        .dark .nav-bar a.nav-item, .dark .nav-bar .nav-item { color: #e0e0e0; }
        .dark .nav-bar a.nav-item:hover, .dark .nav-bar .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }

        /* Dropdown (admin menu) */
        .dropdown { position: relative; }
        .dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 4px;
            box-shadow: 0 4px 12px rgba(0,0,0,.1);
            min-width: 160px;
            z-index: 100;
            padding: 4px 0;
        }
        .dropdown.open .dropdown-menu { display: block; }
        .dropdown-menu a {
            display: block;
            padding: 6px 14px;
            font-size: 13px;
            color: #374151;
        }
        .dropdown-menu a:hover { background: #f3f4f6; color: #111827; }
        .dark .dropdown-menu { background: #27292a; border-color: #3d3d3d; }
        .dark .dropdown-menu a { color: #e0e0e0; }
        .dark .dropdown-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }

        /* Container */
        .container-fluid { padding: 0 20px; }

        /* Headings */
        h1, h2, h3, h4, h5, h6 { color: #1f2937; }
        .dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 { color: #e0e0e0; }

        /* Code */
        code {
            font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
            font-size: 12px;
            background: #f3f4f6;
            padding: 1px 4px;
            border-radius: 3px;
        }
        .dark code { background: #1f2021; color: #e0e0e0; }

        /* Divider */
        .divider { border: 0; border-top: 1px solid #e5e7eb; margin: 16px 0; }
        .dark .divider { border-top-color: #3d3d3d; }

        /* Scrollbar (dark) */
        .dark ::-webkit-scrollbar { width: 10px; height: 10px; }
        .dark ::-webkit-scrollbar-track { background: #1b1c1d; }
        .dark ::-webkit-scrollbar-thumb { background: #3d3d3d; border-radius: 5px; }
        .dark ::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== Utilities (the subset of Tailwind the resource-manager pages rely on) ===== */
*, *::before, *::after { box-sizing: border-box; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w-full { width: 100%; }
.text-2xl { font-size: 24px; line-height: 1.3; }
.text-lg { font-size: 18px; }
.text-base { font-size: 15px; font-weight: 600; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: #6b7280; }
.dark .text-gray-500 { color: #9ca3af; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }
.mt-1 { margin-top: 4px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.ml-auto { margin-left: auto; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; }
form.inline-form { display: inline; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.cmd {
    display: flex; align-items: center; gap: 8px; justify-content: space-between;
    background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px; padding: 6px 10px;
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; font-size: 12px; margin-bottom: 6px;
}
.dark .cmd { background: #1f2021; border-color: #3d3d3d; }
.cmd code { background: none; padding: 0; overflow-x: auto; white-space: nowrap; }
.login-container { max-width: 400px; margin: 100px auto; text-align: center; }
.login-box { background: #f7f9fa; padding: 40px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.dark .login-box { background: #27292a; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.dark .login-box p { color: #a0a0a0; }
.tbl-fixed-auto { table-layout: auto; }
.tbl.auto { table-layout: auto; }
.tbl.auto tbody td { white-space: nowrap; }
.empty { color: #6b7280; padding: 24px 0; text-align: center; }
@media (max-width: 720px) { .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; } }
.nav-bar a.nav-item.active, .nav-bar .nav-item.active { background: #eaf2fb; color: #1678c2; font-weight: 600; }
.dark .nav-bar a.nav-item.active, .dark .nav-bar .nav-item.active { background: rgba(33,133,208,.25); color: #8ec8f9; }
.nav-brand { font-weight: 700; padding: 6px 12px 6px 4px; display: inline-flex; align-items: center; gap: 6px; color: #1f2937; }
.dark .nav-brand { color: #e0e0e0; }
.nav-brand img { width: 20px; height: 20px; border-radius: 4px; }
.btn-link { background: none; border: 0; padding: 0; color: #2185d0; cursor: pointer; font: inherit; }
.dark .btn-link { color: #6ab0f3; }
.chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; }
.chip form { display: inline; margin: 0; }
.chip button { background: none; border: 0; cursor: pointer; color: inherit; padding: 0 0 0 2px; font-size: 12px; opacity: .7; }
.chip button:hover { opacity: 1; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; word-break: break-all; }
