:root {
    --bg: #07111f;
    --bg-accent: #10233b;
    --surface: rgba(9, 19, 34, 0.9);
    --surface-soft: rgba(14, 27, 47, 0.72);
    --surface-strong: rgba(8, 17, 31, 0.94);
    --panel: rgba(246, 249, 253, 0.96);
    --panel-soft: rgba(255, 255, 255, 0.82);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(148, 163, 184, 0.28);
    --text: #dbe7f5;
    --text-muted: #95a9bf;
    --text-strong: #081222;
    --text-soft: #5f7289;
    --accent: #5db7ff;
    --accent-strong: #2189ff;
    --accent-soft: rgba(93, 183, 255, 0.16);
    --success: #21c57d;
    --warning: #ffbf47;
    --danger: #ff6b6b;
    --info: #6bd4ff;
    --shadow-lg: 0 32px 80px rgba(1, 8, 18, 0.45);
    --shadow-md: 0 20px 40px rgba(7, 17, 31, 0.16);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --mono: "JetBrains Mono", "SFMono-Regular", "Menlo", monospace;
    --sans: "Avenir Next", "Segoe UI Variable", "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overscroll-behavior-y: none;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(93, 183, 255, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(255, 191, 71, 0.14), transparent 26%),
        linear-gradient(145deg, #05101d 0%, #0a172a 42%, #112645 100%);
    font-family: var(--sans);
}

body.menu-open {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at center, black 32%, transparent 92%);
    pointer-events: none;
}

a {
    color: inherit;
}

body label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-strong);
    font-size: 0.9rem;
    font-weight: 600;
}

body small,
body .helper-text {
    display: block;
    margin-top: 6px;
    color: var(--text-soft);
    line-height: 1.5;
}

body .layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

body .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    padding: 28px 22px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(149, 169, 191, 0.72) rgba(255, 255, 255, 0.06);
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(11, 21, 37, 0.94) 0%, rgba(6, 14, 28, 0.94) 100%);
    backdrop-filter: blur(18px);
}

body .sidebar::-webkit-scrollbar {
    width: 10px;
}

body .sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

body .sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(184, 197, 214, 0.9), rgba(121, 138, 161, 0.96));
    border-radius: 999px;
    border: 2px solid rgba(7, 17, 31, 0.92);
}

body .sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(214, 223, 234, 0.96), rgba(148, 163, 184, 0.98));
}

body .sidebar::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}

body .brand-block {
    padding: 18px;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(145deg, rgba(93, 183, 255, 0.18), rgba(17, 38, 69, 0.12));
    border: 1px solid rgba(93, 183, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body .brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

body .brand-mark {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 241, 250, 0.92));
    box-shadow: 0 18px 32px rgba(1, 8, 18, 0.25);
}

body .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
}

body .brand-meta {
    min-width: 0;
}

body .suite-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 191, 71, 0.14);
    color: #ffe5ab;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body .brand-kicker {
    margin: 0 0 8px;
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

body .brand-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

body .brand-copy {
    margin: 8px 0 0;
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.92rem;
}

body .sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body .sidebar-group {
    display: grid;
    gap: 8px;
    padding: 8px 0 6px;
}

body .sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    color: inherit;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

body .sidebar-group-toggle:hover {
    transform: none;
    box-shadow: none;
}

body .sidebar-group-toggle::-webkit-details-marker {
    display: none;
}

body .sidebar-group-label {
    display: block;
    color: #7187a0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

body .sidebar-group.active .sidebar-group-label {
    color: #dfeeff;
}

body .sidebar-group-icon {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-right: 2px solid rgba(223, 238, 255, 0.72);
    border-bottom: 2px solid rgba(223, 238, 255, 0.72);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.72;
}

body .sidebar-disclosure[open] .sidebar-group-icon {
    transform: rotate(225deg) translateY(1px);
    opacity: 1;
}

body .sidebar-subnav {
    display: grid;
    gap: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(93, 183, 255, 0.12);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.24s ease, opacity 0.2s ease, transform 0.2s ease;
}

body .sidebar-disclosure[open] .sidebar-subnav {
    max-height: 1200px;
    opacity: 1;
    transform: translateY(0);
}

body .sidebar-subnav a {
    font-size: 0.95rem;
}

body .sidebar a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

body .sidebar a::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

body .sidebar a:hover,
body .sidebar a.active {
    color: #f8fbff;
    background: rgba(93, 183, 255, 0.1);
    border-color: rgba(93, 183, 255, 0.12);
    transform: translateX(2px);
}

body .sidebar a.active::after {
    background: var(--accent);
    box-shadow: 0 0 0 6px rgba(93, 183, 255, 0.12);
}

body .sidebar-footer {
    margin-top: auto;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

body .sidebar-footer p {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

body .status-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body .status-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #eef7ff;
    background: rgba(93, 183, 255, 0.12);
    border: 1px solid rgba(93, 183, 255, 0.15);
}

body .main {
    padding: 32px;
}

body .page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
}

body .page-hero-text {
    max-width: 780px;
}

body .page-eyebrow {
    margin: 0 0 12px;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--warning);
}

body .page-hero h1,
body .header h1,
body .main > h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
    letter-spacing: -0.05em;
    color: #f7fbff;
}

body .page-subtitle {
    margin: 14px 0 0;
    max-width: 780px;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

body .page-actions,
body .header > div:last-child {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

body .panel,
body .card,
body .card-mini,
body .form-box,
body .table-box,
body .import-box,
body .box {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 245, 251, 0.96));
    box-shadow: var(--shadow-md);
    color: var(--text-strong);
}

body .panel::before,
body .card::before,
body .card-mini::before,
body .form-box::before,
body .table-box::before,
body .import-box::before,
body .box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), rgba(93, 183, 255, 0.08));
    opacity: 0.9;
}

body .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

body .cards,
body .summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

body .card,
body .card-mini {
    padding: 20px;
}

body .card p,
body .card-mini p {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

body .card h2,
body .card-mini h3 {
    margin: 12px 0 0;
    font-size: clamp(1.8rem, 2.2vw, 2.35rem);
    letter-spacing: -0.05em;
    color: var(--text-strong);
}

body .card.warning {
    background: linear-gradient(180deg, rgba(255, 245, 220, 0.98), rgba(255, 238, 204, 0.95));
}

body .card-mini.warning {
    background: linear-gradient(180deg, rgba(255, 245, 220, 0.98), rgba(255, 238, 204, 0.95));
}

body .card.danger {
    background: linear-gradient(180deg, rgba(255, 233, 233, 0.98), rgba(255, 219, 219, 0.95));
}

body .card.success {
    background: linear-gradient(180deg, rgba(231, 255, 244, 0.98), rgba(216, 249, 233, 0.95));
}

body .alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    font-size: 0.94rem;
}

body .alert.danger {
    background: rgba(255, 107, 107, 0.12);
    color: #7c1d1d;
    border-color: rgba(255, 107, 107, 0.2);
}

body .alert.warning {
    background: rgba(255, 191, 71, 0.18);
    color: #6b4b0d;
    border-color: rgba(255, 191, 71, 0.22);
}

body .alert.info {
    background: rgba(107, 212, 255, 0.16);
    color: #0c4f74;
    border-color: rgba(107, 212, 255, 0.22);
}

body .form-box,
body .table-box,
body .import-box,
body .box {
    padding: 20px;
    margin-bottom: 20px;
}

body .table-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(93, 183, 255, 0.32) rgba(10, 24, 42, 0.08);
}

body table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

body th,
body td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(10, 24, 42, 0.08);
    font-size: 0.92rem;
    vertical-align: middle;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body th {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    background: rgba(12, 24, 43, 0.035);
    white-space: nowrap;
}

body th .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease;
}

body th .sort-link:hover,
body th .sort-link.active {
    color: #1d3f68;
}

body th .sort-indicator {
    font-size: 0.72rem;
    letter-spacing: 0;
}

body td {
    white-space: normal;
}

body .mono,
body .badge,
body .status-pill,
body button,
body .btn-link,
body a.btn-link,
body .money-input,
body input,
body select {
    overflow-wrap: normal;
    word-break: normal;
}

body tbody tr:hover {
    background: rgba(93, 183, 255, 0.06);
}

body input,
body select,
body textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(10, 24, 42, 0.12);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-strong);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    touch-action: manipulation;
}

body input[type="file"] {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.92);
}

body input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 24, 42, 0.08);
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

body input::placeholder,
body textarea::placeholder {
    color: #7b8ea5;
}

body input:focus,
body select:focus,
body textarea:focus {
    outline: none;
    border-color: rgba(33, 137, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(33, 137, 255, 0.12);
    background: #fff;
}

body input[readonly] {
    background: rgba(10, 24, 42, 0.05);
}

body input:disabled,
body select:disabled,
body textarea:disabled {
    opacity: 1;
    cursor: not-allowed;
}

body .money-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(10, 24, 42, 0.12);
    background: rgba(255, 255, 255, 0.86);
    min-width: 150px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body .money-input span {
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: 0.06em;
}

body .money-input input {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 12px 0;
    min-width: 0;
}

body .money-input input:focus {
    box-shadow: none;
    background: transparent;
}

body .money-input:focus-within {
    border-color: rgba(33, 137, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(33, 137, 255, 0.12);
    background: #fff;
}

body button,
body .btn-link,
body a.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: #f7fbff;
    background: linear-gradient(135deg, #16375f, #0f5ec7);
    box-shadow: 0 18px 32px rgba(15, 94, 199, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    touch-action: manipulation;
}

body button:hover,
body .btn-link:hover,
body a.btn-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 36px rgba(15, 94, 199, 0.26);
}

body button:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: saturate(0.8);
}

body .danger-button,
body .danger {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    color: #fff;
}

body .ghost-button {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 242, 248, 0.94));
    color: #10233b;
    border-color: rgba(10, 24, 42, 0.14);
    box-shadow: 0 10px 22px rgba(7, 17, 31, 0.08);
}

body .ghost-button:hover {
    color: #081222;
    border-color: rgba(33, 137, 255, 0.28);
    box-shadow: 0 14px 24px rgba(7, 17, 31, 0.12);
}

body .ghost-button:disabled {
    background: linear-gradient(180deg, rgba(247, 250, 253, 0.94), rgba(234, 240, 246, 0.92));
    color: #576b82;
    border-color: rgba(10, 24, 42, 0.1);
}

body .sidebar .ghost-button,
body .mobile-nav .ghost-button {
    background: rgba(255, 255, 255, 0.04);
    color: #f7fbff;
    border-color: rgba(255, 255, 255, 0.1);
}

body .admin-local-nav-box {
    display: grid;
    gap: 12px;
}

body .admin-local-nav {
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body .admin-local-nav .ghost-button {
    min-width: 190px;
}

body .admin-local-nav .ghost-button.active {
    background: linear-gradient(135deg, #123d74, #0f5ec7);
    color: #f7fbff;
    border-color: transparent;
    box-shadow: 0 16px 28px rgba(15, 94, 199, 0.28);
}

body .admin-role-guide-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body .admin-role-card {
    display: grid;
    gap: 14px;
    min-height: 100%;
}

body .admin-role-card p {
    margin: 0;
}

body .admin-role-card h2 {
    margin: 0;
    font-size: clamp(1.35rem, 1.9vw, 1.7rem);
}

body .admin-role-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body .admin-role-copy {
    color: var(--text-soft);
    line-height: 1.65;
}

body .crm-local-nav-box {
    display: grid;
    gap: 12px;
}

body .crm-local-nav {
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body .crm-local-nav .ghost-button {
    min-width: 160px;
}

body .crm-local-nav .ghost-button.active {
    background: linear-gradient(135deg, #123d74, #0f5ec7);
    color: #f7fbff;
    border-color: transparent;
    box-shadow: 0 16px 28px rgba(15, 94, 199, 0.28);
}

body .crm-members-grid {
    align-items: start;
}

body .crm-long-text {
    min-width: 220px;
    color: var(--text-strong);
    line-height: 1.6;
}

body .crm-purchase-entry-grid {
    grid-template-columns: minmax(260px, 1.7fr) minmax(180px, 0.8fr) minmax(120px, 0.7fr) minmax(160px, 0.8fr) auto;
}

body .crm-purchase-queue-table {
    min-width: 980px;
}

body .crm-purchase-queue-table th:nth-child(1),
body .crm-purchase-queue-table td:nth-child(1) {
    width: 6%;
}

body .crm-purchase-queue-table th:nth-child(2),
body .crm-purchase-queue-table td:nth-child(2) {
    width: 38%;
}

body .crm-purchase-queue-table th:nth-child(3),
body .crm-purchase-queue-table td:nth-child(3),
body .crm-purchase-queue-table th:nth-child(4),
body .crm-purchase-queue-table td:nth-child(4),
body .crm-purchase-queue-table th:nth-child(5),
body .crm-purchase-queue-table td:nth-child(5) {
    width: 16%;
}

body .crm-purchase-queue-table th:nth-child(6),
body .crm-purchase-queue-table td:nth-child(6) {
    width: 10%;
}

body .sidebar-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #26a3ff, #0f5ec7);
    color: #f7fbff;
    font-size: 0.76rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(15, 94, 199, 0.24);
}

body .chat-shell {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 0;
    padding: 0;
    min-height: 760px;
    overflow: hidden;
}

body .chat-sidebar-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.9), rgba(240, 245, 251, 0.86));
    border-right: 1px solid rgba(10, 24, 42, 0.08);
    min-height: 100%;
}

body .chat-main-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(93, 183, 255, 0.12), transparent 22%),
        linear-gradient(180deg, rgba(232, 239, 247, 0.88), rgba(220, 231, 242, 0.82));
}

body .chat-sidebar-head,
body .chat-search-row,
body .chat-tab-row,
body .chat-main-head,
body .chat-composer {
    padding: 18px 20px;
}

body .chat-sidebar-head,
body .chat-search-row,
body .chat-tab-row,
body .chat-main-head {
    border-bottom: 1px solid rgba(10, 24, 42, 0.08);
}

body .chat-sidebar-head,
body .chat-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

body .chat-self-card,
body .chat-thread-focus {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

body .chat-self-card strong,
body .chat-thread-focus strong,
body .chat-list-caption strong {
    display: block;
    font-size: 1rem;
    color: var(--text-strong);
}

body .chat-self-card span:not(.chat-avatar),
body .chat-thread-focus span:not(.chat-avatar) {
    display: block;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

body .chat-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #123d74, #0f5ec7);
    color: #f7fbff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 14px 30px rgba(15, 94, 199, 0.2);
}

body .chat-avatar.mini {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 0.8rem;
    box-shadow: 0 10px 18px rgba(15, 94, 199, 0.14);
}

body .chat-tab-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body .chat-tab-row .ghost-button.active {
    background: linear-gradient(135deg, #123d74, #0f5ec7);
    color: #f7fbff;
    border-color: transparent;
    box-shadow: 0 16px 28px rgba(15, 94, 199, 0.28);
}

body .chat-list-stack {
    min-height: 0;
    display: grid;
}

body .chat-tab-panel {
    display: none;
    min-height: 0;
}

body .chat-tab-panel.active {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

body .chat-list-caption {
    display: grid;
    gap: 4px;
    padding: 16px 20px 12px;
}

body .chat-thread-list,
body .chat-contact-list {
    min-height: 0;
    overflow-y: auto;
    padding: 0 12px 14px;
    display: grid;
    gap: 8px;
}

body .chat-thread-card,
body .chat-contact-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(10, 24, 42, 0.08);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text-strong);
    text-align: left;
    box-shadow: 0 14px 28px rgba(7, 17, 31, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body .chat-thread-card:hover,
body .chat-contact-card:hover,
body .chat-thread-card.active {
    transform: translateY(-1px);
    border-color: rgba(33, 137, 255, 0.24);
    box-shadow: 0 18px 30px rgba(7, 17, 31, 0.12);
}

body .chat-thread-card.active {
    background: linear-gradient(135deg, rgba(18, 61, 116, 0.14), rgba(15, 94, 199, 0.08));
}

body .chat-thread-body,
body .chat-contact-body {
    min-width: 0;
}

body .chat-thread-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

body .chat-thread-topline strong {
    color: var(--text-strong);
    font-size: 0.96rem;
}

body .chat-thread-meta {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
}

body .chat-thread-body p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

body .chat-thread-side {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: 54px;
}

body .chat-thread-side time {
    color: var(--text-soft);
    font-size: 0.76rem;
}

body .chat-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    padding: 4px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #25b66d, #169557);
    color: #f7fbff;
    font-size: 0.76rem;
    font-weight: 800;
}

body .chat-list-empty {
    margin: 0 8px 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed rgba(10, 24, 42, 0.16);
    background: rgba(255, 255, 255, 0.58);
    color: var(--text-soft);
    line-height: 1.6;
}

body .chat-message-board {
    min-height: 0;
    overflow-y: auto;
    padding: 24px 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 18%),
        linear-gradient(180deg, rgba(240, 245, 251, 0.42), rgba(228, 236, 246, 0.24));
}

body .chat-message-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(72%, 720px);
}

body .chat-message-row.mine {
    margin-left: auto;
    align-items: flex-end;
}

body .chat-message-row.other {
    margin-right: auto;
    align-items: flex-start;
}

body .chat-message-sender {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

body .chat-message-bubble {
    min-width: 110px;
    padding: 14px 16px 12px;
    border-radius: 22px;
    box-shadow: 0 18px 28px rgba(7, 17, 31, 0.1);
}

body .chat-message-row.other .chat-message-bubble {
    background: rgba(255, 255, 255, 0.96);
    border-top-left-radius: 12px;
}

body .chat-message-row.mine .chat-message-bubble {
    background: linear-gradient(135deg, rgba(18, 61, 116, 0.96), rgba(15, 94, 199, 0.94));
    color: #f7fbff;
    border-top-right-radius: 12px;
}

body .chat-message-bubble p {
    margin: 0;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

body .chat-message-bubble time {
    display: block;
    margin-top: 10px;
    font-size: 0.74rem;
    color: inherit;
    opacity: 0.72;
}

body .chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    border-top: 1px solid rgba(10, 24, 42, 0.08);
    background: rgba(247, 250, 253, 0.92);
}

body .chat-composer textarea {
    min-height: 52px;
    max-height: 160px;
    resize: none;
}

body .chat-empty-state {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 14px;
    padding: 48px 24px;
    text-align: center;
}

body .chat-empty-art {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: linear-gradient(135deg, #123d74, #0f5ec7);
    color: #f7fbff;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 22px 38px rgba(15, 94, 199, 0.24);
}

body .chat-empty-state h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.5rem, 2vw, 2rem);
}

body .chat-empty-state p {
    margin: 0;
    max-width: 520px;
    color: var(--text-soft);
    line-height: 1.7;
}

body .badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--mono);
    background: rgba(10, 24, 42, 0.08);
    color: var(--text-soft);
}

body .pending,
body .orange {
    background: rgba(255, 191, 71, 0.18);
    color: #7d5500;
}

body .approved,
body .green {
    background: rgba(33, 197, 125, 0.16);
    color: #0d6b43;
}

body .rejected,
body .red {
    background: rgba(255, 107, 107, 0.16);
    color: #8d1e1e;
}

body .INBOUND,
body .stock-ok {
    color: #0d6b43;
}

body .OUTBOUND,
body .stock-empty,
body .low {
    color: #9b1c1c;
}

body .TRANSFER,
body .TRANSFER_IN,
body .TRANSFER_OUT,
body .stock-low {
    color: #155e75;
}

body .flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

body .flash,
body .msg {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.94rem;
    border: 1px solid transparent;
}

body .flash.error,
body .msg.error {
    background: rgba(255, 107, 107, 0.12);
    color: #7c1d1d;
    border-color: rgba(255, 107, 107, 0.18);
}

body .flash.success,
body .msg.success {
    background: rgba(33, 197, 125, 0.12);
    color: #0f6a43;
    border-color: rgba(33, 197, 125, 0.18);
}

body .form-grid,
body .top-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

body .top-bar {
    margin-bottom: 16px;
}

body .top-bar > * {
    margin: 0;
}

body .alerts {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

body .stock-table {
    min-width: 1840px;
    table-layout: fixed;
}

body .stock-table th:nth-child(1),
body .stock-table td:nth-child(1) {
    width: 52px;
}

body .stock-table th:nth-child(2),
body .stock-table td:nth-child(2) {
    width: 150px;
}

body .stock-table th:nth-child(3),
body .stock-table td:nth-child(3) {
    width: 280px;
}

body .stock-table th:nth-child(4),
body .stock-table td:nth-child(4) {
    width: 180px;
}

body .stock-table th:nth-child(5),
body .stock-table td:nth-child(5) {
    width: 90px;
}

body .stock-table th:nth-child(6),
body .stock-table td:nth-child(6),
body .stock-table th:nth-child(11),
body .stock-table td:nth-child(11) {
    width: 110px;
}

body .stock-table th:nth-child(7),
body .stock-table td:nth-child(7) {
    width: 260px;
}

body .stock-table th:nth-child(8),
body .stock-table td:nth-child(8),
body .stock-table th:nth-child(9),
body .stock-table td:nth-child(9),
body .stock-table th:nth-child(10),
body .stock-table td:nth-child(10) {
    width: 160px;
}

body .stock-table th:nth-child(12),
body .stock-table td:nth-child(12) {
    width: 130px;
}

body .stock-table .edit-field {
    width: 100%;
    min-width: 0;
}

body .stock-table td:nth-child(3) .edit-field,
body .stock-table td:nth-child(4) .edit-field {
    text-overflow: clip;
}

body .stock-table .split-actions {
    min-width: 170px;
}

body .stock-adjust-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

body .stock-table .adjust-input {
    min-width: 0;
}

body .stock-adjust-actions .adjust-input {
    width: 100%;
}

body .stock-adjust-button {
    min-width: 100px;
    padding-inline: 18px;
    justify-self: end;
    white-space: nowrap;
}

body .stock-table .money-input {
    min-width: 150px;
}

body .stock-mobile-hint {
    margin-bottom: 14px;
}

body .variant-builder {
    padding: 0;
    margin-bottom: 14px;
    border-radius: 22px;
    border-color: rgba(10, 24, 42, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 252, 0.98));
}

body .variant-builder::before {
    display: none;
}

body .variant-builder table {
    min-width: 1020px;
    background: #fff;
}

body .variant-builder th,
body .variant-builder td {
    border-right: 1px solid rgba(10, 24, 42, 0.08);
}

body .variant-builder th:last-child,
body .variant-builder td:last-child {
    border-right: 0;
}

body .variant-builder th {
    background: #f4f5f7;
    color: #6d7683;
    text-align: center;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    padding: 14px 12px;
}

body .variant-builder td {
    vertical-align: top;
    padding: 12px 12px;
    background: rgba(255, 255, 255, 0.98);
}

body .variant-builder tbody tr:nth-child(even) td {
    background: #fcfcfd;
}

body .variant-builder td:first-child {
    background: #f9fafb;
}

body .variant-builder th:nth-child(1),
body .variant-builder td:nth-child(1) {
    width: 96px;
}

body .variant-builder th:nth-child(2),
body .variant-builder td:nth-child(2) {
    width: 320px;
}

body .variant-builder th:nth-child(3),
body .variant-builder td:nth-child(3) {
    width: 170px;
}

body .variant-builder th:nth-child(4),
body .variant-builder td:nth-child(4),
body .variant-builder th:nth-child(5),
body .variant-builder td:nth-child(5) {
    width: 180px;
}

body .variant-builder th:nth-child(6),
body .variant-builder td:nth-child(6) {
    width: 110px;
}

body .variant-builder input[type="text"],
body .variant-builder input[type="number"] {
    min-width: 0;
    background: #fff;
    border-color: rgba(148, 163, 184, 0.26);
    min-height: 38px;
    padding: 10px 12px;
    font-size: 0.92rem;
    box-shadow: none;
}

body .variant-builder input[type="text"]::placeholder,
body .variant-builder input[type="number"]::placeholder {
    color: #b0bac8;
}

body .variant-builder input:focus {
    border-color: rgba(33, 137, 255, 0.28);
    box-shadow: 0 0 0 3px rgba(33, 137, 255, 0.08);
}

body .variant-size-input {
    max-width: 64px;
    margin-inline: auto;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}

body .variant-size-cell {
    vertical-align: middle;
}

body .variant-size-shell {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 126px;
    align-content: center;
}

body .variant-size-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #97a1af;
}

body .variant-price-card,
body .variant-stock-card,
body .variant-meta-stack {
    display: grid;
    gap: 10px;
    min-height: 126px;
    align-content: start;
}

body .variant-field-stack {
    display: grid;
    gap: 10px;
    min-width: 190px;
}

body .variant-field-stack > div {
    display: grid;
    gap: 5px;
}

body .variant-currency-input {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: #fff;
}

body .variant-currency-input span {
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    color: #98a4b3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body .variant-currency-input input {
    border: 0;
    padding: 0;
    min-height: 0;
    background: transparent;
}

body .variant-currency-input input:focus {
    border: 0;
    box-shadow: none;
    background: transparent;
}

body .variant-currency-input:focus-within {
    border-color: rgba(33, 137, 255, 0.28);
    box-shadow: 0 0 0 3px rgba(33, 137, 255, 0.08);
}

body .variant-mini-label {
    display: inline-block;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body .variant-price-summary,
body .variant-stock-hint {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #68778a;
}

body .variant-stock-card input {
    max-width: 132px;
}

body .variant-builder td:nth-child(1),
body .variant-builder td:nth-child(3),
body .variant-builder td:nth-child(6) {
    text-align: center;
}

body .variant-remove-button {
    min-width: 96px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(10, 24, 42, 0.04);
    color: var(--text-soft);
    border-color: rgba(10, 24, 42, 0.1);
}

body .ops-batch-box {
    padding: 24px;
}

body .ops-config-grid {
    grid-template-columns: minmax(240px, 1.2fr) minmax(240px, 0.8fr);
    align-items: stretch;
    margin-bottom: 12px;
}

body .ops-config-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(10, 24, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 252, 0.92));
}

body .ops-config-card strong {
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

body .ops-mobile-hint {
    margin-bottom: 14px;
}

body .ops-entry-box {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(10, 24, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 247, 252, 0.92));
}

body .ops-entry-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.7fr) minmax(180px, 0.8fr) repeat(4, minmax(140px, 0.8fr)) auto;
    gap: 12px;
    align-items: end;
}

body .ops-entry-grid.request-entry-grid {
    grid-template-columns: minmax(260px, 1.7fr) minmax(180px, 0.8fr) minmax(140px, 0.7fr) auto;
}

body .ops-entry-grid.outbound-entry-grid {
    grid-template-columns: minmax(260px, 1.7fr) minmax(180px, 0.8fr) minmax(140px, 0.7fr) minmax(220px, 1fr) auto;
}

body .ops-entry-grid > div {
    min-width: 0;
}

body .ops-entry-actions {
    display: flex;
    align-items: stretch;
}

body .ops-entry-actions button {
    width: 100%;
}

body .ops-entry-stock {
    display: grid;
    gap: 8px;
}

body .ops-entry-stock label,
body .ops-entry-item label {
    margin-bottom: 0;
}

body .ops-entry-box .helper-text {
    margin-top: 8px;
}

body .ops-queue-box {
    padding: 0;
}

body .ops-queue-table {
    min-width: 960px;
    table-layout: fixed;
    background: rgba(255, 255, 255, 0.98);
}

body .ops-queue-table th {
    padding: 16px 14px;
    background: #f4f7fb;
    color: #5f7289;
}

body .ops-queue-table td {
    padding: 14px;
    vertical-align: top;
}

body .ops-queue-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 253, 0.84);
}

body .ops-queue-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    color: var(--text-soft);
}

body .ops-lines-box {
    padding: 0;
}

body .ops-lines-table {
    min-width: 1120px;
    table-layout: fixed;
    background: rgba(255, 255, 255, 0.98);
}

body .ops-lines-table th {
    padding: 16px 14px;
    background: #f4f7fb;
    color: #5f7289;
}

body .ops-lines-table td {
    padding: 14px;
    vertical-align: top;
}

body .ops-lines-table tbody tr:nth-child(even) td {
    background: rgba(248, 250, 253, 0.84);
}

body .inbound-lines-table th:nth-child(1),
body .inbound-lines-table td:nth-child(1) {
    width: 32%;
}

body .inbound-lines-table th:nth-child(2),
body .inbound-lines-table td:nth-child(2) {
    width: 16%;
}

body .inbound-lines-table th:nth-child(3),
body .inbound-lines-table td:nth-child(3),
body .inbound-lines-table th:nth-child(4),
body .inbound-lines-table td:nth-child(4),
body .inbound-lines-table th:nth-child(5),
body .inbound-lines-table td:nth-child(5),
body .inbound-lines-table th:nth-child(6),
body .inbound-lines-table td:nth-child(6) {
    width: 12%;
}

body .inbound-lines-table th:nth-child(7),
body .inbound-lines-table td:nth-child(7) {
    width: 16%;
}

body .inbound-lines-table th:nth-child(8),
body .inbound-lines-table td:nth-child(8) {
    width: 12%;
}

body .outbound-lines-table {
    min-width: 980px;
}

body .outbound-lines-table th:nth-child(1),
body .outbound-lines-table td:nth-child(1) {
    width: 40%;
}

body .outbound-lines-table th:nth-child(2),
body .outbound-lines-table td:nth-child(2) {
    width: 18%;
}

body .outbound-lines-table th:nth-child(3),
body .outbound-lines-table td:nth-child(3) {
    width: 18%;
}

body .outbound-lines-table th:nth-child(4),
body .outbound-lines-table td:nth-child(4) {
    width: 16%;
}

body .outbound-lines-table th:nth-child(5),
body .outbound-lines-table td:nth-child(5) {
    width: 8%;
}

body .inbound-queue-table th:nth-child(1),
body .inbound-queue-table td:nth-child(1) {
    width: 5%;
}

body .inbound-queue-table th:nth-child(2),
body .inbound-queue-table td:nth-child(2) {
    width: 27%;
}

body .inbound-queue-table th:nth-child(3),
body .inbound-queue-table td:nth-child(3),
body .inbound-queue-table th:nth-child(4),
body .inbound-queue-table td:nth-child(4),
body .inbound-queue-table th:nth-child(5),
body .inbound-queue-table td:nth-child(5),
body .inbound-queue-table th:nth-child(6),
body .inbound-queue-table td:nth-child(6),
body .inbound-queue-table th:nth-child(8),
body .inbound-queue-table td:nth-child(8) {
    width: 11%;
}

body .inbound-queue-table th:nth-child(7),
body .inbound-queue-table td:nth-child(7) {
    width: 13%;
}

body .outbound-queue-table th:nth-child(1),
body .outbound-queue-table td:nth-child(1),
body .request-queue-table th:nth-child(1),
body .request-queue-table td:nth-child(1) {
    width: 6%;
}

body .outbound-queue-table th:nth-child(2),
body .outbound-queue-table td:nth-child(2),
body .request-queue-table th:nth-child(2),
body .request-queue-table td:nth-child(2) {
    width: 34%;
}

body .outbound-queue-table th:nth-child(3),
body .outbound-queue-table td:nth-child(3),
body .request-queue-table th:nth-child(3),
body .request-queue-table td:nth-child(3) {
    width: 14%;
}

body .outbound-queue-table th:nth-child(4),
body .outbound-queue-table td:nth-child(4),
body .request-queue-table th:nth-child(4),
body .request-queue-table td:nth-child(4) {
    width: 14%;
}

body .outbound-queue-table th:nth-child(5),
body .outbound-queue-table td:nth-child(5) {
    width: 22%;
}

body .outbound-queue-table th:nth-child(6),
body .outbound-queue-table td:nth-child(6),
body .request-queue-table th:nth-child(5),
body .request-queue-table td:nth-child(5) {
    width: 10%;
}

body .request-queue-table th:nth-child(6),
body .request-queue-table td:nth-child(6) {
    width: 10%;
}

body .ops-item-selector {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

body .ops-item-display {
    min-width: 0;
    font-weight: 600;
    color: var(--text-strong);
}

body .ops-picker-button {
    width: 46px;
    min-width: 46px;
    padding: 0;
    border-radius: 14px;
}

body .ops-picker-button svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body .ops-picker-button svg path:first-child {
    fill: currentColor;
    stroke: none;
    opacity: 0.9;
}

body .ops-item-meta {
    margin-top: 8px;
    font-size: 0.8rem;
}

body .ops-stock-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    min-height: 100%;
    border-radius: 16px;
    border: 1px solid rgba(10, 24, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 246, 251, 0.92));
}

body .ops-stock-value {
    font-family: var(--mono);
    font-size: 1.2rem;
    letter-spacing: -0.04em;
    color: var(--text-strong);
}

body .ops-stock-state,
body .ops-row-feedback {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
}

body .ops-qty-input,
body .ops-expiry-input,
body .ops-date-input,
body .ops-note-input {
    min-height: 46px;
}

body .ops-remove-button {
    min-width: 92px;
}

body .picker-modal[hidden] {
    display: none;
}

body .picker-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
}

body .picker-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 12, 24, 0.72);
    backdrop-filter: blur(4px);
}

body .picker-modal-panel {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 40px));
    max-height: min(820px, calc(100dvh - 40px));
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.99), rgba(238, 244, 250, 0.98));
    box-shadow: 0 28px 64px rgba(1, 8, 18, 0.35);
    overflow: hidden;
}

body .picker-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

body .picker-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body .picker-results-box {
    flex: 1 1 auto;
    min-height: 380px;
    margin-bottom: 0;
    padding: 0;
}

body .picker-results-table {
    min-width: 980px;
    table-layout: fixed;
}

body .picker-results-table th:nth-child(1),
body .picker-results-table td:nth-child(1) {
    width: 12%;
}

body .picker-results-table th:nth-child(2),
body .picker-results-table td:nth-child(2) {
    width: 14%;
}

body .picker-results-table th:nth-child(3),
body .picker-results-table td:nth-child(3) {
    width: 26%;
}

body .picker-results-table th:nth-child(4),
body .picker-results-table td:nth-child(4) {
    width: 14%;
}

body .picker-results-table th:nth-child(5),
body .picker-results-table td:nth-child(5) {
    width: 10%;
}

body .picker-results-table th:nth-child(6),
body .picker-results-table td:nth-child(6) {
    width: 16%;
}

body .picker-results-table th:nth-child(7),
body .picker-results-table td:nth-child(7) {
    width: 8%;
}

body .picker-choose-button,
body .ops-remove-button {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 12px;
}

body .picker-inline-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 24px;
}

body .picker-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.picker-open {
    overflow: hidden;
}

body .split-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

body .meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

body .meta-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.94));
    border: 1px solid rgba(10, 24, 42, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 12px 28px rgba(4, 12, 24, 0.14);
}

body .meta-card span {
    display: block;
    margin-bottom: 8px;
    color: #5a6f88;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

body .meta-card strong {
    font-size: 1.4rem;
    letter-spacing: -0.04em;
    line-height: 1.18;
    color: #0b1a2c;
    text-shadow: none;
    overflow-wrap: anywhere;
}

body .stock-filter-bar,
body .products-filter-bar,
body #soFilterForm {
    padding: 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(10, 24, 42, 0.28), rgba(17, 38, 69, 0.22));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    align-items: stretch;
}

body .stock-filter-bar > *,
body .products-filter-bar > *,
body #soFilterForm > * {
    align-self: stretch;
}

body .stock-filter-bar button,
body .products-filter-bar button,
body #soFilterForm button {
    min-width: 158px;
}

body .stock-filter-bar .ghost-button,
body .products-filter-bar .ghost-button,
body #soFilterForm .ghost-button {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 243, 249, 0.94));
    color: #0f223b;
    border-color: rgba(10, 24, 42, 0.16);
}

body .mobile-nav {
    display: none;
}

body .mobile-dock {
    display: none;
}

body .mobile-nav-leading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

body .mobile-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

body .mobile-menu-button {
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 16px;
    white-space: nowrap;
    flex: 0 0 auto;
}

body .mobile-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f7fbff;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body .mobile-user-chip {
    max-width: 148px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
}

body .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

body .mobile-brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 241, 250, 0.92));
    flex: 0 0 44px;
}

body .mobile-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

body .mobile-brand strong {
    display: block;
    font-size: 0.95rem;
    color: #f7fbff;
}

body .mobile-brand span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body .mobile-sidebar-backdrop {
    display: none;
}

body .empty-state {
    padding: 38px 24px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(148, 163, 184, 0.32);
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.72);
}

body .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

body .section-title h2,
body .section-title h3 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

body .section-title p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.92rem;
}

body .mono {
    font-family: var(--mono);
}

body .pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 18px;
}

body .pagination a {
    text-decoration: none;
}

body .so-save-bar {
    position: sticky;
    bottom: 18px;
    z-index: 18;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 17, 31, 0.92);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

body .so-save-bar strong {
    display: block;
    font-size: 1rem;
    color: #f7fbff;
}

body .so-save-bar .helper-text {
    margin-top: 4px;
    color: var(--text-muted);
}

body .so-save-bar[data-state="dirty"] {
    border-color: rgba(93, 183, 255, 0.32);
}

body .so-save-bar[data-state="invalid"] {
    border-color: rgba(255, 107, 107, 0.38);
}

body .pill-select {
    min-width: 220px;
}

body .floating-toast {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 9999;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(7, 17, 31, 0.92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

body .login-form-panel {
    color: var(--text-strong);
}

body .login-form-panel a {
    color: var(--accent-strong);
    font-weight: 600;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body .page-hero,
body .card,
body .card-mini,
body .table-box,
body .form-box,
body .import-box,
body .box {
    animation: fade-up 0.35s ease both;
}

@media (max-width: 1080px) {
    body .layout {
        grid-template-columns: 1fr;
    }

    body .chat-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body .chat-sidebar-panel {
        border-right: 0;
        border-bottom: 1px solid rgba(10, 24, 42, 0.08);
    }

    body .chat-main-panel {
        min-height: 680px;
    }

    body .sidebar {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 55;
        width: min(88vw, 360px);
        height: 100vh;
        height: 100dvh;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        box-shadow: var(--shadow-lg);
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    body .mobile-nav {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(6, 14, 28, 0.92);
        backdrop-filter: blur(18px);
    }

    body .mobile-nav button {
        box-shadow: none;
        min-height: 40px;
        padding: 10px 16px;
    }

    body .mobile-nav-leading {
        min-width: 0;
    }

    body .mobile-nav-actions {
        flex: 0 0 auto;
    }

    body .mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 50;
        opacity: 0;
        pointer-events: none;
        background: rgba(3, 10, 20, 0.58);
        backdrop-filter: blur(3px);
        transition: opacity 0.25s ease;
    }

    body.menu-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body .main {
        padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
    }

    body .table-box,
    body .form-box,
    body .import-box,
    body .box {
        padding: 18px;
    }

    body .summary,
    body .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .ops-config-grid {
        grid-template-columns: 1fr;
    }

    body .picker-modal {
        padding: 16px;
    }

    body .picker-modal-panel {
        width: min(100vw - 32px, 1024px);
        max-height: calc(100dvh - 32px);
        padding: 20px;
    }
}

@media (max-width: 768px) {
    body .chat-sidebar-head,
    body .chat-search-row,
    body .chat-tab-row,
    body .chat-main-head,
    body .chat-composer {
        padding: 16px;
    }

    body .chat-thread-list,
    body .chat-contact-list {
        padding: 0 10px 12px;
    }

    body .chat-thread-card,
    body .chat-contact-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    body .chat-thread-side {
        grid-column: 2;
        justify-items: start;
        grid-auto-flow: column;
        align-items: center;
    }

    body .chat-message-board {
        padding: 18px 14px 14px;
    }

    body .chat-message-row {
        max-width: 88%;
    }

    body .chat-composer {
        grid-template-columns: 1fr;
    }

    body .mobile-nav {
        flex-direction: column;
        align-items: stretch;
    }

    body .mobile-nav-leading,
    body .mobile-nav-actions {
        width: 100%;
    }

    body .mobile-nav-actions {
        justify-content: space-between;
    }

    body .page-hero,
    body .header,
    body .section-title {
        flex-direction: column;
        align-items: flex-start;
    }

    body .page-actions,
    body .header > div:last-child,
    body .split-actions {
        width: 100%;
    }

    body .page-actions > *,
    body .split-actions > *,
    body .split-actions > form,
    body .split-actions > form > * {
        flex: 1 1 100%;
        width: 100%;
    }

    body .page-actions button,
    body .page-actions .btn-link,
    body .stock-filter-bar button,
    body .products-filter-bar button,
    body .products-import-bar button {
        min-height: 46px;
        font-size: 0.94rem;
        letter-spacing: 0.01em;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
    }

    body .cards,
    body .summary,
    body .meta-grid {
        grid-template-columns: 1fr;
    }

    body table {
        min-width: 860px;
    }

    body .ops-batch-box {
        padding: 18px;
    }

    body .ops-entry-grid,
    body .ops-entry-grid.request-entry-grid,
    body .ops-entry-grid.outbound-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .ops-lines-table {
        min-width: 980px;
    }

    body .outbound-lines-table {
        min-width: 920px;
    }

    body .ops-queue-table {
        min-width: 920px;
    }

    body th,
    body td {
        padding: 12px 10px;
    }

    body .card,
    body .card-mini {
        padding: 18px;
    }

    body .money-input {
        min-width: 132px;
    }

    body .card h2,
    body .card-mini h3 {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }

    body .dashboard-cards,
    body .dashboard-aging-grid,
    body .stock-summary-grid,
    body .stock-meta-grid,
    body .products-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .stock-filter-bar,
    body .products-filter-bar,
    body .products-import-bar,
    body .products-manual-box .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body #warehouseSelect {
        min-width: 0;
        width: 100%;
    }

    body .stock-detail-box .section-title,
    body .products-list-box .section-title,
    body .dashboard-activity-box .section-title {
        gap: 12px;
    }

    body .status-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    body .stock-table {
        min-width: 1840px;
    }

    body .variant-builder table {
        min-width: 1040px;
    }

    body .picker-toolbar {
        grid-template-columns: 1fr;
    }

    body .picker-pagination {
        justify-content: space-between;
    }

    body .mobile-dock {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        border-radius: 24px;
        background: rgba(6, 14, 28, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 24px 40px rgba(1, 8, 18, 0.28);
        backdrop-filter: blur(18px);
    }

    body .so-save-bar {
        bottom: calc(92px + env(safe-area-inset-bottom));
        flex-direction: column;
        align-items: stretch;
    }

    body .mobile-dock a,
    body .mobile-dock button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 10px 8px;
        border-radius: 18px;
        border: 0;
        background: transparent;
        color: var(--text-muted);
        font: inherit;
        font-size: 0.76rem;
        text-decoration: none;
        letter-spacing: 0.02em;
        box-shadow: none;
    }

    body .mobile-dock a.active,
    body .mobile-dock button.active {
        background: rgba(93, 183, 255, 0.14);
        color: #f7fbff;
    }
}

@media (max-width: 540px) {
    body .mobile-brand strong {
        font-size: 0.9rem;
    }

    body .mobile-brand span {
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    body .mobile-chip {
        font-size: 0.7rem;
        padding: 6px 10px;
    }

    body .page-eyebrow {
        letter-spacing: 0.12em;
    }

    body .stock-filter-bar,
    body .products-filter-bar,
    body .products-import-bar,
    body .products-manual-box .form-grid {
        grid-template-columns: 1fr;
    }

    body .dashboard-cards,
    body .dashboard-aging-grid,
    body .stock-summary-grid,
    body .stock-meta-grid,
    body .products-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .meta-card strong {
        font-size: 1.18rem;
        line-height: 1.2;
    }

    body .dashboard-cards .card,
    body .dashboard-aging-grid .card-mini,
    body .stock-summary-grid .card-mini,
    body .stock-meta-grid .meta-card,
    body .products-meta-grid .meta-card {
        padding: 16px;
    }

    body .table-box,
    body .form-box,
    body .import-box,
    body .box {
        padding: 16px;
    }

    body .stock-detail-box,
    body .products-list-box,
    body .products-manual-box,
    body .dashboard-activity-box {
        padding: 14px;
    }

    body .mobile-dock {
        left: 10px;
        right: 10px;
        gap: 6px;
        padding: 8px;
    }

    body .mobile-dock a,
    body .mobile-dock button {
        min-height: 44px;
        font-size: 0.7rem;
        padding: 8px 6px;
    }

    body .money-input {
        padding: 0 10px;
    }

    body .stock-table {
        min-width: 1820px;
    }

    body .ops-batch-box {
        padding: 16px;
    }

    body .ops-entry-grid,
    body .ops-entry-grid.request-entry-grid,
    body .ops-entry-grid.outbound-entry-grid {
        grid-template-columns: 1fr;
    }

    body .ops-lines-table {
        min-width: 940px;
    }

    body .outbound-lines-table {
        min-width: 880px;
    }

    body .ops-queue-table {
        min-width: 860px;
    }

    body .picker-modal {
        padding: 10px;
    }

    body .picker-modal-panel {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        padding: 16px;
        border-radius: 22px;
    }
}

@media (max-width: 400px) {
    body .dashboard-cards,
    body .dashboard-aging-grid,
    body .stock-summary-grid,
    body .stock-meta-grid,
    body .products-meta-grid {
        grid-template-columns: 1fr;
    }
}

body .theme-switcher {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

body .theme-switcher-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

body .theme-toggle {
    width: 100%;
}

body .mobile-theme-toggle {
    min-height: 32px;
    padding: 8px 12px;
    box-shadow: none;
    flex: 0 0 auto;
}

body .hris-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body .hris-module-card {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body .hris-module-card.active {
    border-color: rgba(93, 183, 255, 0.28);
    box-shadow: 0 22px 42px rgba(15, 94, 199, 0.18);
}

body .hris-module-card:hover {
    transform: translateY(-2px);
}

html[data-theme="light"] {
    color-scheme: light;
    --text: #10233b;
    --text-muted: #556d86;
    --text-strong: #081222;
    --text-soft: #556b84;
    --line: rgba(116, 138, 165, 0.18);
    --line-strong: rgba(116, 138, 165, 0.28);
    --shadow-lg: 0 28px 70px rgba(28, 48, 72, 0.16);
    --shadow-md: 0 18px 34px rgba(36, 58, 84, 0.12);
    --theme-bg-left: rgba(93, 183, 255, 0.16);
    --theme-bg-right: rgba(255, 191, 71, 0.16);
    --theme-bg-start: #f4f8fc;
    --theme-bg-middle: #eef4fa;
    --theme-bg-end: #dfe9f4;
    --theme-grid-line: rgba(12, 24, 43, 0.05);
    --theme-sidebar-bg: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(232, 240, 249, 0.96) 100%);
    --theme-sidebar-scroll-track: rgba(10, 24, 42, 0.08);
    --theme-sidebar-scroll-thumb: linear-gradient(180deg, rgba(121, 138, 161, 0.82), rgba(84, 103, 129, 0.92));
    --theme-sidebar-scroll-thumb-border: rgba(234, 240, 246, 0.94);
    --theme-brand-bg: linear-gradient(145deg, rgba(93, 183, 255, 0.14), rgba(17, 38, 69, 0.04));
    --theme-brand-border: rgba(33, 137, 255, 0.12);
    --theme-brand-inset: rgba(255, 255, 255, 0.72);
    --theme-brand-mark-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 241, 250, 0.92));
    --theme-brand-mark-shadow: 0 18px 32px rgba(35, 55, 78, 0.12);
    --theme-suite-chip-bg: rgba(255, 191, 71, 0.16);
    --theme-suite-chip-color: #7a4f00;
    --theme-sidebar-link-color: #31465e;
    --theme-sidebar-link-active-color: #0a1a2d;
    --theme-sidebar-link-bg: rgba(33, 137, 255, 0.1);
    --theme-sidebar-link-border: rgba(33, 137, 255, 0.14);
    --theme-sidebar-label: #5b7390;
    --theme-sidebar-label-active: #0d2340;
    --theme-sidebar-icon: rgba(13, 35, 64, 0.6);
    --theme-subnav-border: rgba(33, 137, 255, 0.16);
    --theme-footer-bg: rgba(255, 255, 255, 0.62);
    --theme-footer-border: rgba(116, 138, 165, 0.16);
    --theme-status-pill-color: #0f2e50;
    --theme-status-pill-bg: rgba(33, 137, 255, 0.1);
    --theme-status-pill-border: rgba(33, 137, 255, 0.14);
    --theme-heading: #0c1a2e;
    --theme-subtitle: #4d657f;
    --theme-label-color: #10233b;
    --theme-helper-color: #495f77;
    --theme-card-kicker: #506882;
    --theme-card-value: #091a2e;
    --theme-page-eyebrow: #8b5a00;
    --theme-surface-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 249, 253, 0.95));
    --theme-surface-border: rgba(116, 138, 165, 0.14);
    --theme-surface-shadow: 0 18px 34px rgba(36, 58, 84, 0.12);
    --theme-surface-topline: rgba(93, 183, 255, 0.12);
    --theme-table-header-bg: rgba(12, 24, 43, 0.04);
    --theme-table-header-color: #43596f;
    --theme-table-border: rgba(10, 24, 42, 0.08);
    --theme-table-hover: rgba(93, 183, 255, 0.08);
    --theme-input-bg: rgba(255, 255, 255, 0.92);
    --theme-input-border: rgba(10, 24, 42, 0.12);
    --theme-input-color: #081222;
    --theme-input-placeholder: #7b8ea5;
    --theme-input-focus-bg: #ffffff;
    --theme-input-readonly-bg: rgba(10, 24, 42, 0.05);
    --theme-disabled-bg: rgba(231, 238, 246, 0.92);
    --theme-disabled-color: #3c5168;
    --theme-disabled-border: rgba(84, 103, 129, 0.18);
    --theme-money-span: #5f7289;
    --theme-filter-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 247, 252, 0.92));
    --theme-filter-border: rgba(116, 138, 165, 0.16);
    --theme-ghost-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 250, 0.94));
    --theme-ghost-color: #10233b;
    --theme-ghost-border: rgba(10, 24, 42, 0.12);
    --theme-ghost-shadow: 0 10px 22px rgba(7, 17, 31, 0.08);
    --theme-ghost-hover-border: rgba(33, 137, 255, 0.24);
    --theme-ghost-hover-shadow: 0 14px 24px rgba(7, 17, 31, 0.1);
    --theme-ghost-disabled-bg: linear-gradient(180deg, rgba(247, 250, 253, 0.94), rgba(234, 240, 246, 0.92));
    --theme-ghost-disabled-color: #576b82;
    --theme-ghost-disabled-border: rgba(10, 24, 42, 0.1);
    --theme-button-disabled-bg: linear-gradient(180deg, rgba(221, 229, 238, 0.98), rgba(206, 217, 229, 0.96));
    --theme-button-disabled-color: #3b5168;
    --theme-button-disabled-border: rgba(84, 103, 129, 0.18);
    --theme-file-button-bg: rgba(10, 24, 42, 0.08);
    --theme-file-button-color: #10233b;
    --theme-mobile-nav-bg: rgba(248, 251, 255, 0.9);
    --theme-mobile-nav-border: rgba(116, 138, 165, 0.18);
    --theme-mobile-chip-bg: rgba(33, 137, 255, 0.1);
    --theme-mobile-chip-color: #0f2846;
    --theme-mobile-chip-border: rgba(33, 137, 255, 0.12);
    --theme-mobile-dock-bg: rgba(248, 251, 255, 0.92);
    --theme-mobile-dock-border: rgba(116, 138, 165, 0.16);
    --theme-mobile-dock-link: #4f6681;
    --theme-mobile-dock-active-bg: rgba(33, 137, 255, 0.12);
    --theme-mobile-dock-active-color: #0d2340;
    --theme-empty-bg: rgba(255, 255, 255, 0.72);
    --theme-empty-border: rgba(116, 138, 165, 0.3);
    --theme-empty-color: #4b627b;
    --theme-picker-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 247, 252, 0.98));
    --theme-picker-shadow: 0 28px 64px rgba(44, 62, 84, 0.18);
    --theme-stock-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 252, 0.94));
    --theme-toast-bg: rgba(255, 255, 255, 0.96);
    --theme-toast-color: #10233b;
    --theme-toast-border: rgba(116, 138, 165, 0.18);
    --theme-badge-neutral-bg: rgba(10, 24, 42, 0.08);
    --theme-badge-neutral-color: #465b73;
    --theme-badge-neutral-border: rgba(10, 24, 42, 0.1);
    --theme-warning-card-bg: linear-gradient(180deg, rgba(255, 245, 220, 0.98), rgba(255, 238, 204, 0.95));
    --theme-danger-card-bg: linear-gradient(180deg, rgba(255, 233, 233, 0.98), rgba(255, 219, 219, 0.95));
    --theme-success-card-bg: linear-gradient(180deg, rgba(231, 255, 244, 0.98), rgba(216, 249, 233, 0.95));
    --theme-variant-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 252, 0.98));
    --theme-variant-table-bg: #ffffff;
    --theme-variant-head-bg: #f4f5f7;
    --theme-variant-head-color: #6d7683;
    --theme-variant-row-bg: rgba(255, 255, 255, 0.98);
    --theme-variant-row-alt: #fcfcfd;
    --theme-variant-row-side: #f9fafb;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --text: #dbe7f5;
    --text-muted: #a6b8cc;
    --text-strong: #ecf4ff;
    --text-soft: #a8bbd0;
    --line: rgba(148, 163, 184, 0.16);
    --line-strong: rgba(148, 163, 184, 0.28);
    --shadow-lg: 0 32px 80px rgba(1, 8, 18, 0.48);
    --shadow-md: 0 22px 42px rgba(1, 8, 18, 0.34);
    --theme-bg-left: rgba(93, 183, 255, 0.18);
    --theme-bg-right: rgba(255, 191, 71, 0.14);
    --theme-bg-start: #05101d;
    --theme-bg-middle: #0a172a;
    --theme-bg-end: #112645;
    --theme-grid-line: rgba(255, 255, 255, 0.03);
    --theme-sidebar-bg: linear-gradient(180deg, rgba(11, 21, 37, 0.96) 0%, rgba(6, 14, 28, 0.96) 100%);
    --theme-sidebar-scroll-track: rgba(255, 255, 255, 0.06);
    --theme-sidebar-scroll-thumb: linear-gradient(180deg, rgba(184, 197, 214, 0.9), rgba(121, 138, 161, 0.96));
    --theme-sidebar-scroll-thumb-border: rgba(7, 17, 31, 0.92);
    --theme-brand-bg: linear-gradient(145deg, rgba(93, 183, 255, 0.18), rgba(17, 38, 69, 0.12));
    --theme-brand-border: rgba(93, 183, 255, 0.18);
    --theme-brand-inset: rgba(255, 255, 255, 0.05);
    --theme-brand-mark-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 241, 250, 0.92));
    --theme-brand-mark-shadow: 0 18px 32px rgba(1, 8, 18, 0.25);
    --theme-suite-chip-bg: rgba(255, 191, 71, 0.14);
    --theme-suite-chip-color: #ffe5ab;
    --theme-sidebar-link-color: #95a9bf;
    --theme-sidebar-link-active-color: #f8fbff;
    --theme-sidebar-link-bg: rgba(93, 183, 255, 0.1);
    --theme-sidebar-link-border: rgba(93, 183, 255, 0.12);
    --theme-sidebar-label: #7187a0;
    --theme-sidebar-label-active: #dfeeff;
    --theme-sidebar-icon: rgba(223, 238, 255, 0.72);
    --theme-subnav-border: rgba(93, 183, 255, 0.12);
    --theme-footer-bg: rgba(255, 255, 255, 0.03);
    --theme-footer-border: rgba(148, 163, 184, 0.18);
    --theme-status-pill-color: #eef7ff;
    --theme-status-pill-bg: rgba(93, 183, 255, 0.12);
    --theme-status-pill-border: rgba(93, 183, 255, 0.15);
    --theme-heading: #f7fbff;
    --theme-subtitle: #aabacc;
    --theme-label-color: #e6f0fb;
    --theme-helper-color: #b8c7d9;
    --theme-card-kicker: #bacbdd;
    --theme-card-value: #f7fbff;
    --theme-page-eyebrow: #ffd27a;
    --theme-surface-bg: linear-gradient(180deg, rgba(14, 24, 42, 0.98), rgba(10, 19, 34, 0.96));
    --theme-surface-border: rgba(148, 163, 184, 0.14);
    --theme-surface-shadow: 0 22px 44px rgba(1, 8, 18, 0.34);
    --theme-surface-topline: rgba(93, 183, 255, 0.14);
    --theme-table-header-bg: rgba(255, 255, 255, 0.04);
    --theme-table-header-color: #b3c5d8;
    --theme-table-border: rgba(148, 163, 184, 0.12);
    --theme-table-hover: rgba(93, 183, 255, 0.09);
    --theme-input-bg: rgba(10, 18, 31, 0.88);
    --theme-input-border: rgba(148, 163, 184, 0.18);
    --theme-input-color: #ecf4ff;
    --theme-input-placeholder: #7f96b0;
    --theme-input-focus-bg: rgba(8, 17, 29, 0.96);
    --theme-input-readonly-bg: rgba(255, 255, 255, 0.06);
    --theme-disabled-bg: rgba(23, 36, 55, 0.96);
    --theme-disabled-color: #b7c7d9;
    --theme-disabled-border: rgba(148, 163, 184, 0.18);
    --theme-money-span: #9fb5cb;
    --theme-filter-bg: linear-gradient(180deg, rgba(10, 24, 42, 0.42), rgba(17, 38, 69, 0.3));
    --theme-filter-border: rgba(148, 163, 184, 0.14);
    --theme-ghost-bg: linear-gradient(180deg, rgba(19, 31, 50, 0.92), rgba(12, 22, 38, 0.94));
    --theme-ghost-color: #ecf4ff;
    --theme-ghost-border: rgba(148, 163, 184, 0.18);
    --theme-ghost-shadow: 0 14px 28px rgba(1, 8, 18, 0.22);
    --theme-ghost-hover-border: rgba(93, 183, 255, 0.24);
    --theme-ghost-hover-shadow: 0 18px 30px rgba(1, 8, 18, 0.28);
    --theme-ghost-disabled-bg: linear-gradient(180deg, rgba(17, 28, 45, 0.84), rgba(12, 21, 36, 0.9));
    --theme-ghost-disabled-color: #7e93ab;
    --theme-ghost-disabled-border: rgba(148, 163, 184, 0.12);
    --theme-button-disabled-bg: linear-gradient(180deg, rgba(27, 42, 63, 0.95), rgba(20, 31, 48, 0.98));
    --theme-button-disabled-color: #bdd0e5;
    --theme-button-disabled-border: rgba(148, 163, 184, 0.16);
    --theme-file-button-bg: rgba(255, 255, 255, 0.08);
    --theme-file-button-color: #ecf4ff;
    --theme-mobile-nav-bg: rgba(6, 14, 28, 0.92);
    --theme-mobile-nav-border: rgba(148, 163, 184, 0.16);
    --theme-mobile-chip-bg: rgba(255, 255, 255, 0.08);
    --theme-mobile-chip-color: #f7fbff;
    --theme-mobile-chip-border: rgba(255, 255, 255, 0.08);
    --theme-mobile-dock-bg: rgba(6, 14, 28, 0.9);
    --theme-mobile-dock-border: rgba(255, 255, 255, 0.08);
    --theme-mobile-dock-link: #98aec6;
    --theme-mobile-dock-active-bg: rgba(93, 183, 255, 0.14);
    --theme-mobile-dock-active-color: #f7fbff;
    --theme-empty-bg: rgba(255, 255, 255, 0.04);
    --theme-empty-border: rgba(148, 163, 184, 0.24);
    --theme-empty-color: #b1c3d6;
    --theme-picker-panel-bg: linear-gradient(180deg, rgba(12, 22, 38, 0.99), rgba(8, 16, 30, 0.98));
    --theme-picker-shadow: 0 28px 64px rgba(1, 8, 18, 0.42);
    --theme-stock-card-bg: linear-gradient(180deg, rgba(15, 25, 42, 0.96), rgba(10, 19, 33, 0.94));
    --theme-toast-bg: rgba(7, 17, 31, 0.94);
    --theme-toast-color: #eef7ff;
    --theme-toast-border: rgba(148, 163, 184, 0.16);
    --theme-badge-neutral-bg: rgba(255, 255, 255, 0.08);
    --theme-badge-neutral-color: #c5d4e4;
    --theme-badge-neutral-border: rgba(148, 163, 184, 0.14);
    --theme-warning-card-bg: linear-gradient(180deg, rgba(87, 60, 10, 0.64), rgba(62, 43, 7, 0.76));
    --theme-danger-card-bg: linear-gradient(180deg, rgba(89, 24, 24, 0.66), rgba(64, 16, 16, 0.78));
    --theme-success-card-bg: linear-gradient(180deg, rgba(12, 76, 49, 0.64), rgba(8, 54, 35, 0.78));
    --theme-variant-bg: linear-gradient(180deg, rgba(12, 21, 36, 0.98), rgba(10, 18, 32, 0.97));
    --theme-variant-table-bg: rgba(11, 20, 34, 0.98);
    --theme-variant-head-bg: rgba(255, 255, 255, 0.05);
    --theme-variant-head-color: #92a8bf;
    --theme-variant-row-bg: rgba(11, 20, 34, 0.98);
    --theme-variant-row-alt: rgba(255, 255, 255, 0.02);
    --theme-variant-row-side: rgba(255, 255, 255, 0.03);
}

html[data-theme] body {
    color: var(--text);
    background:
        radial-gradient(circle at top left, var(--theme-bg-left), transparent 34%),
        radial-gradient(circle at top right, var(--theme-bg-right), transparent 26%),
        linear-gradient(145deg, var(--theme-bg-start) 0%, var(--theme-bg-middle) 42%, var(--theme-bg-end) 100%);
}

html[data-theme] body::before {
    background-image:
        linear-gradient(var(--theme-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--theme-grid-line) 1px, transparent 1px);
}

html[data-theme] body .sidebar {
    background: var(--theme-sidebar-bg);
    scrollbar-color: var(--text-muted) var(--theme-sidebar-scroll-track);
}

html[data-theme] body .sidebar::-webkit-scrollbar-track {
    background: var(--theme-sidebar-scroll-track);
}

html[data-theme] body .sidebar::-webkit-scrollbar-thumb {
    background: var(--theme-sidebar-scroll-thumb);
    border-color: var(--theme-sidebar-scroll-thumb-border);
}

html[data-theme] body .brand-block {
    background: var(--theme-brand-bg);
    border-color: var(--theme-brand-border);
    box-shadow: inset 0 1px 0 var(--theme-brand-inset);
}

html[data-theme] body .brand-mark {
    background: var(--theme-brand-mark-bg);
    box-shadow: var(--theme-brand-mark-shadow);
}

html[data-theme] body .suite-chip {
    background: var(--theme-suite-chip-bg);
    color: var(--theme-suite-chip-color);
}

html[data-theme] body .sidebar-group-label {
    color: var(--theme-sidebar-label);
}

html[data-theme] body .sidebar-group.active .sidebar-group-label {
    color: var(--theme-sidebar-label-active);
}

html[data-theme] body .sidebar-group-icon {
    border-right-color: var(--theme-sidebar-icon);
    border-bottom-color: var(--theme-sidebar-icon);
}

html[data-theme] body .sidebar-subnav {
    border-left-color: var(--theme-subnav-border);
}

html[data-theme] body .sidebar a {
    color: var(--theme-sidebar-link-color);
}

html[data-theme] body .sidebar a:hover,
html[data-theme] body .sidebar a.active {
    color: var(--theme-sidebar-link-active-color);
    background: var(--theme-sidebar-link-bg);
    border-color: var(--theme-sidebar-link-border);
}

html[data-theme] body .sidebar-footer {
    background: var(--theme-footer-bg);
    border-color: var(--theme-footer-border);
}

html[data-theme] body .status-pill {
    color: var(--theme-status-pill-color);
    background: var(--theme-status-pill-bg);
    border-color: var(--theme-status-pill-border);
}

html[data-theme] body .page-hero h1,
html[data-theme] body .header h1,
html[data-theme] body .main > h1,
html[data-theme] body .mobile-brand strong {
    color: var(--theme-heading);
}

html[data-theme] body .page-subtitle {
    color: var(--theme-subtitle);
}

html[data-theme] body .page-eyebrow {
    color: var(--theme-page-eyebrow);
}

html[data-theme] body label {
    color: var(--theme-label-color);
}

html[data-theme] body small:not(.stock-empty):not(.stock-low):not(.stock-ok):not(.green):not(.red):not(.orange),
html[data-theme] body .helper-text:not(.stock-empty):not(.stock-low):not(.stock-ok):not(.green):not(.red):not(.orange),
html[data-theme] body .section-title p,
html[data-theme] body .brand-copy,
html[data-theme] body .mobile-brand span {
    color: var(--theme-helper-color);
}

html[data-theme] body .card p,
html[data-theme] body .card-mini p,
html[data-theme] body .variant-size-label,
html[data-theme] body .variant-price-summary,
html[data-theme] body .variant-stock-hint {
    color: var(--theme-card-kicker);
}

html[data-theme] body .card h2,
html[data-theme] body .card-mini h3 {
    color: var(--theme-card-value);
}

html[data-theme] body .panel,
html[data-theme] body .card,
html[data-theme] body .card-mini,
html[data-theme] body .form-box,
html[data-theme] body .table-box,
html[data-theme] body .import-box,
html[data-theme] body .box,
html[data-theme] body .meta-card,
html[data-theme] body .picker-modal-panel,
html[data-theme] body .ops-stock-card {
    background: var(--theme-surface-bg);
    border-color: var(--theme-surface-border);
    box-shadow: var(--theme-surface-shadow);
    color: var(--text-strong);
}

html[data-theme] body .panel::before,
html[data-theme] body .card::before,
html[data-theme] body .card-mini::before,
html[data-theme] body .form-box::before,
html[data-theme] body .table-box::before,
html[data-theme] body .import-box::before,
html[data-theme] body .box::before {
    background: linear-gradient(90deg, var(--accent), var(--theme-surface-topline));
}

html[data-theme] body th,
html[data-theme] body td {
    border-bottom-color: var(--theme-table-border);
}

html[data-theme] body th {
    color: var(--theme-table-header-color);
    background: var(--theme-table-header-bg);
}

html[data-theme] body tbody tr:hover {
    background: var(--theme-table-hover);
}

html[data-theme] body input,
html[data-theme] body select,
html[data-theme] body textarea {
    background: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-input-color);
}

html[data-theme] body input:disabled,
html[data-theme] body select:disabled,
html[data-theme] body textarea:disabled,
html[data-theme] body input[readonly] {
    background: var(--theme-disabled-bg);
    border-color: var(--theme-disabled-border);
    color: var(--theme-disabled-color);
    -webkit-text-fill-color: var(--theme-disabled-color);
}

html[data-theme] body input::placeholder,
html[data-theme] body textarea::placeholder {
    color: var(--theme-input-placeholder);
}

html[data-theme] body input:focus,
html[data-theme] body select:focus,
html[data-theme] body textarea:focus {
    background: var(--theme-input-focus-bg);
}

html[data-theme] body input[readonly] {
    background: var(--theme-input-readonly-bg);
}

html[data-theme] body input[type="file"]::file-selector-button {
    background: var(--theme-file-button-bg);
    color: var(--theme-file-button-color);
}

html[data-theme] body .money-input,
html[data-theme] body .variant-currency-input {
    background: var(--theme-input-bg);
    border-color: var(--theme-input-border);
}

html[data-theme] body .money-input span,
html[data-theme] body .variant-currency-input span {
    color: var(--theme-money-span);
}

html[data-theme] body .ghost-button {
    background: var(--theme-ghost-bg);
    color: var(--theme-ghost-color);
    border-color: var(--theme-ghost-border);
    box-shadow: var(--theme-ghost-shadow);
}

html[data-theme] body .ghost-button:hover {
    border-color: var(--theme-ghost-hover-border);
    box-shadow: var(--theme-ghost-hover-shadow);
}

html[data-theme] body .ghost-button:disabled {
    background: var(--theme-ghost-disabled-bg);
    color: var(--theme-ghost-disabled-color);
    border-color: var(--theme-ghost-disabled-border);
}

html[data-theme] body button:disabled:not(.ghost-button),
html[data-theme] body .btn-link:disabled,
html[data-theme] body a.btn-link[aria-disabled="true"] {
    opacity: 1;
    background: var(--theme-button-disabled-bg);
    color: var(--theme-button-disabled-color);
    border-color: var(--theme-button-disabled-border);
    box-shadow: none;
    filter: none;
}

html[data-theme] body .sidebar .ghost-button,
html[data-theme] body .mobile-nav .ghost-button {
    background: var(--theme-ghost-bg);
    color: var(--theme-ghost-color);
    border-color: var(--theme-ghost-border);
}

html[data-theme] body .stock-filter-bar,
html[data-theme] body .products-filter-bar,
html[data-theme] body #soFilterForm {
    background: var(--theme-filter-bg);
    border-color: var(--theme-filter-border);
}

html[data-theme] body .mobile-nav {
    background: var(--theme-mobile-nav-bg);
    border-bottom-color: var(--theme-mobile-nav-border);
}

html[data-theme] body .mobile-chip {
    background: var(--theme-mobile-chip-bg);
    color: var(--theme-mobile-chip-color);
    border-color: var(--theme-mobile-chip-border);
}

html[data-theme] body .mobile-dock {
    background: var(--theme-mobile-dock-bg);
    border-color: var(--theme-mobile-dock-border);
}

html[data-theme] body .mobile-dock a,
html[data-theme] body .mobile-dock button {
    color: var(--theme-mobile-dock-link);
}

html[data-theme] body .mobile-dock a.active,
html[data-theme] body .mobile-dock button.active {
    background: var(--theme-mobile-dock-active-bg);
    color: var(--theme-mobile-dock-active-color);
}

html[data-theme] body .meta-card span {
    color: var(--theme-table-header-color);
}

html[data-theme] body .meta-card strong {
    color: var(--text-strong);
}

html[data-theme] body .badge {
    background: var(--theme-badge-neutral-bg);
    color: var(--theme-badge-neutral-color);
    border: 1px solid var(--theme-badge-neutral-border);
}

html[data-theme] body th .sort-link:hover,
html[data-theme] body th .sort-link.active {
    color: var(--theme-sidebar-link-active-color);
}

html[data-theme] body .empty-state {
    background: var(--theme-empty-bg);
    border-color: var(--theme-empty-border);
    color: var(--theme-empty-color);
}

html[data-theme] body .picker-modal-panel {
    background: var(--theme-picker-panel-bg);
    box-shadow: var(--theme-picker-shadow);
}

html[data-theme] body .ops-stock-card {
    background: var(--theme-stock-card-bg);
}

html[data-theme] body .ops-config-card,
html[data-theme] body .ops-entry-box {
    background: var(--theme-surface-bg);
    border-color: var(--theme-surface-border);
    box-shadow: var(--theme-surface-shadow);
}

html[data-theme] body .floating-toast {
    background: var(--theme-toast-bg);
    color: var(--theme-toast-color);
    border-color: var(--theme-toast-border);
}

html[data-theme] body .sidebar-counter {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #f7fbff;
}

html[data-theme] body .chat-sidebar-panel,
html[data-theme] body .chat-main-panel,
html[data-theme] body .chat-composer {
    background: var(--theme-surface-bg);
    border-color: var(--theme-surface-border);
}

html[data-theme] body .chat-thread-card,
html[data-theme] body .chat-contact-card,
html[data-theme] body .chat-list-empty,
html[data-theme] body .chat-message-row.other .chat-message-bubble {
    background: var(--theme-surface-bg);
    border-color: var(--theme-surface-border);
    color: var(--text-strong);
}

html[data-theme] body .chat-thread-card.active {
    background: var(--theme-sidebar-link-bg);
    border-color: var(--theme-sidebar-link-border);
}

html[data-theme] body .chat-message-board {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 18%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

html[data-theme] body .chat-message-row.mine .chat-message-bubble {
    background: linear-gradient(135deg, var(--accent-strong), #123d74);
    color: #f7fbff;
}

html[data-theme] body .chat-thread-topline strong,
html[data-theme] body .chat-self-card strong,
html[data-theme] body .chat-thread-focus strong,
html[data-theme] body .chat-empty-state h2,
html[data-theme] body .chat-list-caption strong {
    color: var(--text-strong);
}

html[data-theme] body .chat-thread-meta,
html[data-theme] body .chat-thread-body p,
html[data-theme] body .chat-self-card span:not(.chat-avatar),
html[data-theme] body .chat-thread-focus span:not(.chat-avatar),
html[data-theme] body .chat-empty-state p,
html[data-theme] body .chat-list-empty {
    color: var(--theme-helper-color);
}

html[data-theme] body .card.warning,
html[data-theme] body .card-mini.warning {
    background: var(--theme-warning-card-bg);
}

html[data-theme] body .card.danger {
    background: var(--theme-danger-card-bg);
}

html[data-theme] body .card.success {
    background: var(--theme-success-card-bg);
}

html[data-theme] body .variant-builder {
    background: var(--theme-variant-bg);
    border-color: var(--theme-input-border);
}

html[data-theme] body .variant-builder table {
    background: var(--theme-variant-table-bg);
}

html[data-theme] body .variant-builder th,
html[data-theme] body .variant-builder td {
    border-right-color: var(--theme-table-border);
}

html[data-theme] body .variant-builder th {
    background: var(--theme-variant-head-bg);
    color: var(--theme-variant-head-color);
}

html[data-theme] body .variant-builder td {
    background: var(--theme-variant-row-bg);
}

html[data-theme] body .variant-builder tbody tr:nth-child(even) td {
    background: var(--theme-variant-row-alt);
}

html[data-theme] body .variant-builder td:first-child {
    background: var(--theme-variant-row-side);
}

html[data-theme] body .variant-builder input[type="text"],
html[data-theme] body .variant-builder input[type="number"] {
    background: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-input-color);
}

html[data-theme] body .variant-builder input[type="text"]::placeholder,
html[data-theme] body .variant-builder input[type="number"]::placeholder {
    color: var(--theme-input-placeholder);
}

html[data-theme] body .variant-price-summary,
html[data-theme] body .variant-stock-hint {
    color: var(--theme-subtitle);
}

html[data-theme] body .variant-remove-button {
    background: var(--theme-ghost-bg);
    color: var(--theme-ghost-color);
    border-color: var(--theme-ghost-border);
}

body .schedule-filter-bar {
    align-items: stretch;
}

body .schedule-legend-box {
    margin-bottom: 20px;
}

body .schedule-legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body .schedule-control-grid {
    align-items: stretch;
}

body .schedule-master-new-form {
    margin-bottom: 18px;
}

body .schedule-shift-list,
body .schedule-profile-list {
    display: grid;
    gap: 16px;
}

body .schedule-shift-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body .schedule-shift-card,
body .schedule-profile-card {
    margin-bottom: 0;
}

body .schedule-shift-card-top,
body .schedule-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

body .schedule-profile-head strong {
    display: block;
    font-size: 1rem;
    color: var(--text-strong);
}

body .schedule-profile-head p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

body .schedule-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

body .schedule-checkbox-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

body .schedule-checkline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(10, 24, 42, 0.12);
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-strong);
}

body .schedule-checkline input {
    width: auto;
    margin: 0;
    accent-color: #0f5ec7;
}

body .schedule-checkline span {
    font-size: 0.92rem;
    font-weight: 500;
}

body .schedule-master-new-form input[type="color"],
body .schedule-shift-card input[type="color"] {
    min-height: 48px;
    padding: 6px;
    cursor: pointer;
}

body .schedule-board-shell {
    padding: 20px;
}

body .schedule-board-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(10, 24, 42, 0.1);
    background: rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
    -webkit-overflow-scrolling: touch;
}

body .schedule-board {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.9rem;
}

body .schedule-board th,
body .schedule-board td {
    min-width: 92px;
    padding: 0;
    text-align: center;
    border-right: 1px solid rgba(10, 24, 42, 0.12);
    border-bottom: 1px solid rgba(10, 24, 42, 0.12);
    overflow: visible;
}

body .schedule-board thead th {
    color: #f7fbff;
    background: linear-gradient(180deg, #123d74, #0e56aa);
    border-bottom-color: rgba(255, 255, 255, 0.14);
}

body .schedule-axis-cell {
    min-width: 240px;
    max-width: 240px;
    padding: 14px 16px;
    text-align: left;
    background: linear-gradient(180deg, #7a1846, #5f1234) !important;
    color: #fff3fb !important;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

body .schedule-group-header {
    padding: 14px 10px;
    background: linear-gradient(180deg, #173e79, #2151a8) !important;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}

body .schedule-location-header {
    padding: 10px 8px;
    background: linear-gradient(180deg, #1a66d4, #0d56be) !important;
    font-size: 0.76rem;
}

body .schedule-name-header {
    padding: 12px 8px;
    background: linear-gradient(180deg, #4d85d7, #2f6fcb) !important;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

body .schedule-note-header {
    min-width: 240px;
    padding: 14px 12px;
    background: linear-gradient(180deg, #204d8d, #294f93) !important;
    font-size: 1rem;
    text-transform: none;
}

body .schedule-sticky {
    position: sticky;
    left: 0;
    z-index: 3;
}

body .schedule-day-header {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 240px;
    max-width: 240px;
    padding: 12px 14px;
    text-align: left;
    color: var(--text-strong) !important;
    background: linear-gradient(180deg, rgba(242, 245, 249, 0.98), rgba(229, 235, 242, 0.96)) !important;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

body .schedule-row-weekend .schedule-day-header {
    background: linear-gradient(180deg, rgba(224, 242, 255, 0.98), rgba(206, 229, 248, 0.96)) !important;
}

body .schedule-board-cell,
body .schedule-note-cell {
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.84);
}

body .schedule-row-weekend .schedule-board-cell,
body .schedule-row-weekend .schedule-note-cell {
    background: rgba(247, 249, 252, 0.94);
}

body .schedule-chip {
    --schedule-chip-bg: #dce7f3;
    --schedule-chip-color: #27394f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--schedule-chip-bg);
    color: var(--schedule-chip-color);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

body .schedule-chip-auto {
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.34),
        0 0 0 2px rgba(7, 17, 31, 0.04);
}

body .schedule-empty {
    color: rgba(68, 88, 111, 0.68);
    font-weight: 600;
}

body .schedule-note-text {
    min-width: 220px;
    text-align: left;
    color: var(--text-strong);
    line-height: 1.55;
}

body .hris-dashboard-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
}

body .hris-dashboard-panel {
    display: grid;
    gap: 18px;
}

body .hris-dashboard-announcement-list {
    display: grid;
    gap: 14px;
}

body .hris-dashboard-announcement-card {
    display: grid;
    gap: 12px;
    margin-bottom: 0;
}

body .hris-dashboard-announcement-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body .hris-dashboard-announcement-head h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--theme-heading);
}

body .hris-dashboard-announcement-head p,
body .hris-dashboard-announcement-meta,
body .hris-dashboard-announcement-body {
    margin: 0;
    color: var(--theme-helper-color);
}

body .hris-dashboard-announcement-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.84rem;
}

body .hris-dashboard-announcement-body {
    line-height: 1.6;
}

body .hris-dashboard-schedule-meta {
    margin-top: 0;
}

body .hris-dashboard-schedule-wrap {
    max-height: 780px;
}

body .hris-dashboard-schedule .schedule-name-header small {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--theme-helper-color);
}

body .hris-dashboard-day-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body .hris-dashboard-day-highlights span {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--theme-badge-neutral-bg);
    border: 1px solid var(--theme-badge-neutral-border);
    color: var(--theme-badge-neutral-color);
    font-size: 0.74rem;
    font-weight: 700;
}

@media (min-width: 1180px) {
    body .hris-dashboard-grid {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
    }
}

@media (max-width: 1080px) {
    body .schedule-axis-cell,
    body .schedule-day-header {
        min-width: 180px;
        max-width: 180px;
    }

    body .schedule-note-header,
    body .schedule-note-text {
        min-width: 180px;
    }

    body .hris-dashboard-announcement-head {
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    body .schedule-shift-list,
    body .schedule-profile-list {
        grid-template-columns: 1fr;
    }

    body .schedule-checkline {
        min-height: 44px;
    }

    body .schedule-board-shell {
        padding: 16px;
    }

    body .schedule-board th,
    body .schedule-board td {
        min-width: 82px;
    }

    body .schedule-axis-cell,
    body .schedule-day-header {
        min-width: 150px;
        max-width: 150px;
        font-size: 0.82rem;
    }

    body .schedule-note-header,
    body .schedule-note-text {
        min-width: 150px;
    }
}

body .attendance-portal-shell {
    display: grid;
    gap: 18px;
}

body .attendance-identity-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body .attendance-capture-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    align-items: start;
}

body .attendance-camera-panel,
body .attendance-form-panel {
    min-width: 0;
}

body .attendance-camera-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 58%),
        linear-gradient(180deg, rgba(7, 17, 31, 0.96), rgba(12, 22, 39, 0.94));
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .attendance-camera-frame video,
body .attendance-camera-frame img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: cover;
    display: block;
}

body .attendance-camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

body .attendance-submit-row {
    justify-content: flex-end;
}

body .attendance-history-list {
    display: grid;
    gap: 14px;
}

body .attendance-history-item {
    display: grid;
    gap: 14px;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    background: var(--panel);
}

body .attendance-history-photo {
    width: 104px;
    height: 104px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(148, 163, 184, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

body .attendance-history-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body .attendance-history-meta {
    min-width: 0;
    display: grid;
    gap: 6px;
}

body .attendance-history-meta p {
    margin: 0;
}

body .attendance-history-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

body .biometric-photo-link {
    display: inline-flex;
    width: min(220px, 100%);
}

body .biometric-photo-preview {
    width: 100%;
    max-height: 220px;
    border-radius: 18px;
    border: 1px solid var(--line);
    object-fit: cover;
    display: block;
}

body .biometric-photo-empty {
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 18px;
    color: var(--text-soft);
    background: rgba(148, 163, 184, 0.08);
}

body .biometric-photo-inline-link {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

body .biometric-photo-inline-link:hover {
    text-decoration: underline;
}

@media (max-width: 1080px) {
    body .attendance-capture-grid {
        grid-template-columns: 1fr;
    }

    body .attendance-camera-frame,
    body .attendance-camera-frame video,
    body .attendance-camera-frame img {
        min-height: 280px;
    }
}

@media (max-width: 720px) {
    body .attendance-history-item {
        grid-template-columns: 1fr;
    }

    body .attendance-history-photo {
        width: 100%;
        height: 180px;
    }

    body .attendance-submit-row {
        justify-content: stretch;
    }

    body .attendance-submit-row button {
        width: 100%;
    }
}
