    :root {
        --bg-dark: #050b16;
        --bg-card: #101a2b;
        --bg-card-soft: #141f34;
        --primary: #1d4ed8;
        --primary-soft: #2448a5;
        --accent: #22c55e;
        --danger: #ef4444;
        --text-main: #e5f0ff;
        --text-muted: #9ca3af;
        --border-soft: #1f2937;
        --radius-lg: 12px;
        --radius-xl: 18px;
    }

    * {
        box-sizing: border-box;
        font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    body {
        margin: 0;
        background: radial-gradient(circle at top, #0b1c3b, #020617);
        color: var(--text-main);
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 16px;
    }

    .app-shell {
        width: 100%;
        max-width: 1200px;
        background: rgba(3, 7, 18, 0.9);
        border-radius: 24px;
        box-shadow: 0 25px 70px rgba(15, 23, 42, 0.8);
        border: 1px solid rgba(148, 163, 184, 0.18);
        padding: 18px 18px 24px;
        margin-top: 12px;
    }

    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
        border-radius: 14px;
        background: radial-gradient(circle at 30% 0, #60a5fa, #0f172a);
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 800;
        font-size: 18px;
        color: #e5f0ff;
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    }

    .brand-text-main {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 0.03em;
    }

    .brand-text-sub {
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.18em;
    }

    .header-right {
        font-size: 12px;
        color: var(--text-muted);
        text-align: right;
    }

    h2,
    h3,
    h4 {
        margin: 0;
    }

    .section {
        display: none;
    }

    .section.active {
        display: block;
    }

    .card {
        background: linear-gradient(140deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.85));
        border-radius: var(--radius-xl);
        padding: 18px 16px;
        border: 1px solid var(--border-soft);
        margin-bottom: 16px;
    }

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

    .card-header h3 {
        font-size: 16px;
    }

    .chip {
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.5);
        color: var(--text-muted);
    }

    .muted {
        color: var(--text-muted);
        font-size: 13px;
    }

    .btn-row {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 6px;
    }

    button {
        border-radius: 999px;
        border: none;
        padding: 9px 16px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        background: var(--primary);
        color: #e5f0ff;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    button.secondary {
        background: rgba(15, 23, 42, 0.8);
        border: 1px solid rgba(148, 163, 184, 0.4);
        box-shadow: none;
    }

    button.danger {
        background: var(--danger);
        box-shadow: 0 4px 16px rgba(248, 113, 113, 0.6);
    }

    button.small {
        padding: 6px 10px;
        font-size: 12px;
    }

    button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        box-shadow: none;
    }

    input,
    select {
        width: 100%;
        padding: 7px 10px;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.45);
        background: rgba(15, 23, 42, 0.9);
        color: var(--text-main);
        font-size: 13px;
        outline: none;
    }

    input[type="date"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
        cursor: pointer;
    }

    input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
    }

    label {
        font-size: 12px;
        margin-bottom: 3px;
        color: var(--text-muted);
        display: block;
    }

    .field {
        margin-bottom: 10px;
    }

    .two-col {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
    }

    .login-choice {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .pill-btn {
        padding: 10px 16px;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.5);
        background: rgba(15, 23, 42, 0.8);
        cursor: pointer;
        font-size: 14px;
        color: var(--text-main);
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .pill-btn span.icon {
        width: 22px;
        height: 22px;
        border-radius: 999px;
        background: rgba(37, 99, 235, 0.2);
        display: inline-flex;
        justify-content: center;
        align-items: center;
        font-size: 12px;
    }

    .pill-btn:hover {
        border-color: var(--primary);
        background: rgba(15, 23, 42, 0.94);
    }

    .tabs {
        display: flex;
        gap: 8px;
        border-bottom: 1px solid rgba(31, 41, 55, 0.9);
        margin-bottom: 10px;
        padding-bottom: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 7px 13px;
        font-size: 12px;
        border-radius: 999px;
        cursor: pointer;
        color: var(--text-muted);
        background: transparent;
        border: 1px solid transparent;
        white-space: nowrap;
    }

    .tab.active {
        background: rgba(37, 99, 235, 0.2);
        border-color: rgba(37, 99, 235, 0.8);
        color: var(--text-main);
    }

    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
        margin-top: 8px;
    }

    th,
    td {
        padding: 6px 6px;
        text-align: left;
        border-bottom: 1px solid rgba(31, 41, 55, 0.9);
        vertical-align: middle;
    }

    th {
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.05em;
    }

    tr:nth-child(even) td {
        background: rgba(15, 23, 42, 0.5);
    }

    .badge {
        display: inline-block;
        padding: 2px 7px;
        border-radius: 999px;
        font-size: 11px;
        background: rgba(37, 99, 235, 0.18);
        color: var(--text-main);
    }

    .badge.green {
        background: rgba(34, 197, 94, 0.18);
    }

    .badge.red {
        background: rgba(239, 68, 68, 0.18);
    }

    .align-right {
        text-align: right;
    }

    .notice {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 5px;
    }

    .error {
        font-size: 12px;
        color: #fecaca;
        background: rgba(127, 29, 29, 0.7);
        border-radius: 999px;
        padding: 6px 10px;
        margin-top: 6px;
        display: none;
    }

    .error.visible {
        display: block;
    }

    .success {
        font-size: 12px;
        color: #bbf7d0;
        background: rgba(22, 101, 52, 0.7);
        border-radius: 999px;
        padding: 6px 10px;
        margin-top: 6px;
        display: none;
    }

    .success.visible {
        display: block;
    }

    .pill-stat {
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.4);
        display: inline-flex;
        gap: 10px;
        align-items: center;
        margin-right: 6px;
        margin-top: 4px;
    }

    .pill-stat span.label {
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .pill-stat span.value {
        font-weight: 600;
    }

    textarea {
        width: 100%;
        min-height: 80px;
        border-radius: 12px;
        border: 1px solid rgba(148, 163, 184, 0.45);
        background: rgba(15, 23, 42, 0.9);
        color: var(--text-main);
        font-size: 13px;
        padding: 8px 10px;
        resize: vertical;
    }

    @media (max-width: 720px) {
        header {
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
        }

        .app-shell {
            padding: 14px 12px 20px;
        }

        .card {
            padding: 14px 12px;
        }

        th,
        td {
            font-size: 11px;
        }
    }

    @media screen and (max-width: 768px) {
        #btn-open-toollog {
            display: none;
        }

        #tool-section {
            display: none;
        }
    }

    /* === Bigger overall UI overrides === */
    body {
        font-size: 15px;
    }

    .brand-text-main {
        font-size: 22px;
    }

    button {
        font-size: 15px;
        padding: 11px 18px;
    }

    button.small {
        font-size: 13px;
        padding: 8px 12px;
    }

    input,
    select,
    textarea {
        font-size: 14px;
        padding: 9px 12px;
    }

    th,
    td {
        font-size: 13px;
        padding: 8px 8px;
    }

.tag-box {
        margin-top: 6px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .tag {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 12px 10px;
        background: #1e6bff15;
        border: 1px solid #1e6bff;
        border-radius: 16px;
        font-size: 13px;
        color: #fff;
        font-weight: 600;
        box-shadow: 0 0 3px rgba(0, 0, 0, 0.08);
    }

    .tag button {
        background: #1e6bff;
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        line-height: 16px;
        font-size: 12px;
        cursor: pointer;
        padding: 0;
    }

    .tag button:hover {
        background: #0044bb;
    }

    #admin-leave-table th,
    #admin-leave-table td {
        padding: 6px 10px;
        font-size: 13px;
        border-bottom: 1px solid #ddd;
    }

    #admin-leave-table td button {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 6px;
    }

    .btn-approve {
        background: #28a745;
        color: white;
        border: none;
    }

    .btn-reject {
        background: #dc3545;
        color: white;
        border: none;
        margin-left: 5px;
    }

    .badge {
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
    }

    .badge-pending {
        background: #f7b500;
        color: #fff;
    }

    .badge-approved {
        background: #28a745;
        color: #fff;
    }

    .badge-rejected {
        background: #dc3545;
        color: #fff;
    }

    #tool-history-table th,
    #tool-history-table td {
        padding: 6px 8px;
        border-bottom: 1px solid #ddd;
        font-size: 13px;
    }

    #tool-select-table th,
    #tool-select-table td {
        border-bottom: 1px solid #ddd;
        padding: 4px;
        text-align: center;
        font-size: 13px;
    }

    .tool-qty-input {
        width: 50px;
        text-align: center;
    }

    .admin-tool-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 4px;
        border-bottom: 1px solid #ddd;
        font-size: 13px;
    }

    .admin-tool-row input {
        width: 140px;
        padding: 2px 6px;
        font-size: 12px;
    }

    .admin-tool-row .number-count {
        width: 60px;
        text-align: center;
        font-size: 12px;
    }

    .admin-tool-save {
        font-size: 11px;
        padding: 3px 8px;
        margin-left: 4px;
    }

    .btn-edit-unit,
    .btn-delete-unit {
        margin-right: 6px;
    }

    /* === Customer View Style Fix === */
    #customerView {
        background: #f2f7ff;
    }

    #cv-card {
        background: #ffffff !important;
        color: #003366 !important;
        border: 1px solid #bcd9ff;
    }

    #cv-title {
        color: #003366 !important;
        font-weight: 700;
    }

    #cv-summary {
        background: #e6f3ff !important;
        border: 1px solid #bcd9ff;
        border-radius: 6px;
        color: #003366 !important;
        font-size: 14px;
    }

    #cv-warranty-table th,
    #cv-service-table th {
        background: #dceeff !important;
        color: #003366 !important;
        font-weight: 700;
    }

    #cv-warranty-table td,
    #cv-service-table td {
        background: #ffffff;
        color: #003366 !important;
        border: 1px solid #cce0ff;
    }

    #cv-print-btn {
        background: #1e90ff !important;
        border: 0;
        color: white !important;
        font-weight: 600;
    }

    #cv-print-btn:hover {
        background: #0066cc !important;
    }

    .searchable-dropdown {
        position: relative;
    }

    .searchable-dropdown input[type="text"] {
        width: 100%;
    }

    .site-dropdown-list {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        background: #101a2b;
        border: 1px solid rgba(148, 163, 184, 0.45);
        border-radius: 12px;
        list-style: none;
        margin: 0;
        padding: 4px 0;
        z-index: 999;
        max-height: 200px;
        overflow-y: auto;
        display: none;
    }

    .site-dropdown-list.open {
        display: block;
    }

    .site-dropdown-list li {
        padding: 8px 14px;
        font-size: 13px;
        cursor: pointer;
        color: var(--text-main);
        border-radius: 8px;
        margin: 2px 4px;
    }

    .site-dropdown-list li:hover,
    .site-dropdown-list li.selected {
        background: var(--primary);
    }

    .site-dropdown-list li.no-match {
        color: var(--text-muted);
        cursor: default;
    }

    .site-dropdown-list li.no-match:hover {
        background: none;
    }

    #global-loader {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(5, 11, 22, 0.75);
        z-index: 9999;
        align-items: center;
        justify-content: center;
    }

    #global-loader.active {
        display: flex;
    }

    .loader-spinner {
        width: 44px;
        height: 44px;
        border: 4px solid rgba(255, 255, 255, 0.15);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
    }

    @keyframes spin {
        to { transform: rotate(360deg); }
    }