* {
    box-sizing: border-box;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: #f3f6fb;
    margin: 0;
    color: #1f2937;
}

a { word-break: break-word; }

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 220px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #e5eefc;
    padding: 24px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}

.brand span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-nav a {
    color: #dbeafe;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.side-nav a:hover {
    background: rgba(22, 119, 255, 0.18);
}

.main-panel {
    padding: 24px;
    min-width: 0;
    width: 100%;
}

@media (min-width: 961px) {
    .layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}

.topbar {
    margin-bottom: 18px;
}

.topbar-with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.topbar-heading {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mobile-menu-btn {
    display: none;
    border: none;
    background: #0f172a;
    color: #fff;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.topbar h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lang-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dbe1ea;
    border-radius: 999px;
    color: #475569;
    text-decoration: none;
    background: #fff;
}

.lang-chip.active {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid #dbe1ea;
    border-radius: 999px;
    color: #334155;
    font-size: 14px;
}

.page-subtitle,
.muted {
    color: #6b7280;
    margin: 0;
}

.panel {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    margin-bottom: 18px;
}

.stats-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.stats-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    min-width: 0;
}

.stat-card span {
    display: block;
    color: #6b7280;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.35;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
    word-break: break-word;
}

.accent-blue { border-top: 4px solid #1677ff; }
.accent-amber { border-top: 4px solid #faad14; }
.accent-cyan { border-top: 4px solid #13c2c2; }
.accent-green { border-top: 4px solid #52c41a; }
.accent-red { border-top: 4px solid #ff4d4f; }

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

.summary-box {
    background: #f7fbff;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 18px 22px;
    min-width: 0;
}

.summary-box span {
    display: block;
    color: #6b7280;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.35;
}

.summary-box strong {
    font-size: 24px;
    color: #0f172a;
    line-height: 1.15;
    word-break: break-word;
}

.overview-top-grid,
.overview-mid-grid,
.overview-summary-grid {
    display: grid;
    width: 100%;
    gap: 16px;
}

.overview-top-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-mid-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.overview-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body:not(.auth-page):not(.track-page):not(.invoice-page) .overview-top-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body:not(.auth-page):not(.track-page):not(.invoice-page) .overview-mid-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

body:not(.auth-page):not(.track-page):not(.invoice-page) .overview-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.toolbar,
.filter-form,
.order-form {
    margin-bottom: 10px;
}

.toolbar-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 220px) auto;
    gap: 12px;
    align-items: end;
}

.filter-grid-wide {
    grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 220px) minmax(160px, 220px) auto;
}

.finance-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

.form-grid textarea,
.form-grid .toolbar {
    grid-column: 1 / -1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #1677ff;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover { opacity: 0.95; }
.btn-secondary { background: #52c41a; }
.btn-danger { background: #ff4d4f; }
.btn-light { background: #e5e7eb; color: #111827; }

.filter-form input,
.filter-form select,
.order-form input,
.order-form select,
.order-form textarea {
    padding: 11px 12px;
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
}

.order-form textarea {
    min-height: 120px;
    resize: vertical;
}

.orders-overview-shell {
    padding: 16px 18px;
}

.mobile-only { display: none !important; }
.desktop-only { display: block !important; }
.mobile-card-list { display: grid; gap: 12px; }
.mobile-order-card { padding: 16px; }
.mobile-order-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.mobile-order-title {
    font-size: 18px;
    font-weight: 700;
}
.mobile-order-statuses {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
.mobile-order-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.mobile-order-grid span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}
.mobile-order-grid strong {
    display: block;
    font-size: 14px;
}
.mobile-actions {
    justify-content: flex-start;
    margin-top: 12px;
}

.orders-toolbar {
    margin-bottom: 14px;
}

.orders-toolbar .btn {
    min-height: 50px;
}

.orders-filter-bar {
    margin-bottom: 0;
    display: grid;
    grid-template-columns: minmax(420px, 1.8fr) minmax(180px, 220px) minmax(180px, 220px) auto;
    align-items: center;
}

.orders-filter-bar .btn {
    min-height: 48px;
    white-space: nowrap;
}

.clean-orders-table-panel {
    padding-top: 8px;
}

.mobile-order-tools {
    display: grid;
    gap: 12px;
}

.mobile-toolbar-stack {
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    body:not(.auth-page):not(.track-page):not(.invoice-page) .overview-mid-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body:not(.auth-page):not(.track-page):not(.invoice-page) .overview-top-grid,
    body:not(.auth-page):not(.track-page):not(.invoice-page) .overview-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .orders-filter-bar {
        grid-template-columns: minmax(280px, 1.4fr) minmax(160px, 200px) minmax(160px, 200px) auto;
    }
}

@media (max-width: 960px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    .overview-top-grid,
    .overview-mid-grid,
    .overview-summary-grid,
    .stats-grid,
    .summary-strip,
    .filter-grid,
    .filter-grid-wide,
    .finance-filter-grid,
    .form-grid,
    .detail-grid,
    .mobile-order-grid {
        grid-template-columns: 1fr !important;
    }

    .orders-overview-shell {
        padding: 16px;
    }

    .mobile-order-head {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-toolbar-stack .btn,
    .mobile-order-tools .btn {
        width: 100%;
    }
}

.table-wrap {
    overflow-x: auto;
}

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

.clean-orders-table-panel table {
    min-width: 1180px;
}

table th,
table td {
    border-bottom: 1px solid #eef2f7;
    padding: 12px 10px;
    text-align: center;
    white-space: nowrap;
}

table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
}

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

.text-link,
.table-actions a {
    color: #1677ff;
    text-decoration: none;
}

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

.table-actions-wrap {
    flex-direction: column;
    align-items: flex-start;
}

.inline-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    color: #1677ff;
    cursor: pointer;
    font-size: 14px;
}

.danger-link { color: #cf1322; }

.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}

.flash-messages li {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.auth-flashes {
    max-width: 420px;
    width: calc(100% - 32px);
}

.auth-flashes li {
    background: #fff7e6;
    border-color: #ffd591;
    color: #d46b08;
}

.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.status-待发货 { background: #fff7e6; color: #d48806; }
.status-已发出 { background: #e6f4ff; color: #1677ff; }
.status-已签收 { background: #f6ffed; color: #389e0d; }
.status-已取消 { background: #fff1f0; color: #cf1322; }
.pay-未收款 { background: #fff1f0; color: #cf1322; }
.pay-部分收款 { background: #fff7e6; color: #d48806; }
.pay-已收款 { background: #f6ffed; color: #389e0d; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.page-btn {
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #dbe1ea;
    color: #111827;
    text-decoration: none;
}

.page-btn.disabled {
    color: #9ca3af;
    background: #f3f4f6;
}

.page-current { color: #475569; }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.detail-header-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.detail-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
}

.detail-item span {
    display: block;
    color: #6b7280;
    margin-bottom: 8px;
    font-size: 13px;
}

.detail-item strong {
    font-size: 16px;
    color: #0f172a;
}

.detail-item-full { grid-column: 1 / -1; }
.top-gap { margin-top: 18px; }

.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at top, #fff7df 0%, #ffe7a8 42%, #fff8ea 100%);
}

.auth-page-simple {
    background: radial-gradient(circle at top, #fff7df 0%, #ffe7a8 42%, #fff8ea 100%);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-scene,
.login-scene-simple {
    width: min(1320px, 100%);
    display: grid;
    grid-template-columns: minmax(680px, 1.18fr) minmax(420px, 0.82fr);
    gap: 30px;
    align-items: center;
}

.login-art,
.login-art-simple {
    background: linear-gradient(180deg, #ffc600 0%, #ffd84a 56%, #ffe379 100%);
    border-radius: 34px;
    padding: 36px 34px;
    min-height: 605px;
    box-shadow: 0 26px 70px rgba(212, 163, 0, 0.22);
    position: relative;
    overflow: hidden;
}

.login-art-simple::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -26px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.auth-brand,
.auth-brand-simple {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.auth-logo,
.auth-logo-simple {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
    flex: 0 0 auto;
}

.auth-brand h1,
.auth-brand-simple h1 {
    margin: 0 0 8px;
    font-size: 38px;
    line-height: 1.1;
    color: #0f2e63;
    font-weight: 800;
}

.auth-brand p,
.auth-brand-simple p {
    margin: 0;
    color: #1f3d72;
    font-size: 18px;
    line-height: 1.6;
}

.mascot-row,
.mascot-row-simple {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 28px;
    min-height: 250px;
    margin: 72px 0 36px;
}

.simple-mascot {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform .22s ease;
}

.simple-mascot-main {
    transform-origin: center bottom;
}

.simple-mascot-neck {
    width: 22px;
    height: 28px;
    background: #f5d9bc;
    border-radius: 999px;
    margin-bottom: -10px;
    transition: transform .22s ease, opacity .22s ease;
}

.simple-mascot-head {
    width: 110px;
    height: 110px;
    background: radial-gradient(circle at 38% 34%, #ffe9d2 0%, #fbe1c4 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 -5px 0 rgba(221, 180, 135, 0.18);
}

.simple-mascot-main .simple-mascot-head {
    width: 118px;
    height: 118px;
}

.simple-eye {
    position: absolute;
    top: 40px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-eye.left { left: 25px; }
.simple-eye.right { right: 25px; }
.simple-mascot-main .simple-eye { top: 43px; }
.simple-mascot-main .simple-eye.left { left: 28px; }
.simple-mascot-main .simple-eye.right { right: 28px; }

.simple-pupil {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #111827;
    transition: transform .08s linear, opacity .2s ease;
}

.simple-mascot-body {
    width: 116px;
    height: 96px;
    margin-top: -8px;
    background: #e50012;
    border-radius: 30px 30px 22px 22px;
}

.simple-mascot-main .simple-mascot-body {
    width: 122px;
    height: 100px;
}

#mascot-row[data-mode="username"] .simple-mascot-main {
    transform: translateY(-4px);
}

#mascot-row[data-mode="username"] .simple-mascot-main .simple-mascot-neck {
    transform: translateY(2px);
    height: 34px;
}

#mascot-row[data-mode="password"] .simple-mascot {
    transform: rotateY(180deg);
}

#mascot-row[data-mode="password"] .simple-mascot-main {
    transform: rotateY(180deg) translateY(-2px);
}

#mascot-row[data-mode="password"] .simple-pupil {
    opacity: 0;
}

.auth-copy-box,
.auth-copy-box-simple {
    position: relative;
    z-index: 1;
    background: rgba(255, 248, 224, 0.76);
    border: 1px solid rgba(255,255,255,0.62);
    border-radius: 24px;
    padding: 20px 24px;
    min-height: 142px;
}

.auth-copy-box strong,
.auth-copy-box p,
.auth-copy-box-simple strong,
.auth-copy-box-simple p {
    display: block;
    margin: 0 0 8px;
}

.auth-copy-box strong,
.auth-copy-box-simple strong {
    color: #111827;
    font-size: 24px;
}

.auth-copy-box p,
.auth-copy-box-simple p {
    color: #111827;
    font-size: 18px;
    line-height: 1.65;
}

.auth-card,
.auth-card-simple {
    width: 100%;
    max-width: 580px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #dfe7f3;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
    border-radius: 28px;
    padding: 30px;
}

.auth-form,
.auth-form-simple {
    display: grid;
    gap: 20px;
}

.auth-form label > span,
.auth-form-simple label > span {
    display: block;
    margin-bottom: 10px;
    color: #163a71;
    font-size: 17px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form-simple input[type="text"],
.auth-form-simple input[type="password"] {
    height: 54px;
    width: 100%;
    border-radius: 16px;
    border: 1px solid #cfd8e6;
    padding: 0 16px;
    font-size: 17px;
    background: #fff;
    box-shadow: none;
}

.password-toggle,
.password-toggle-simple {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    color: #23457f;
    font-size: 16px;
}

.password-toggle input,
.password-toggle-simple input {
    width: 18px;
    height: 18px;
}

.auth-btn,
.auth-btn-simple {
    width: 100%;
    height: 54px;
    margin-right: 0;
    background: #e50012;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
}

.auth-tips,
.auth-tips-simple {
    margin-top: 22px;
    padding: 18px 20px;
    background: #f6f9ff;
    border: 1px solid #dfe7f3;
    border-radius: 20px;
}

.auth-tips strong,
.auth-tips p,
.auth-tips-simple strong,
.auth-tips-simple p {
    display: block;
    margin: 0 0 10px;
}

.auth-tips strong,
.auth-tips-simple strong {
    color: #0f2e63;
    font-size: 22px;
}

.auth-tips p,
.auth-tips-simple p {
    color: #1f2f4d;
    font-size: 17px;
    line-height: 1.65;
}

@media (max-width: 1100px) {
    .login-scene,
    .login-scene-simple {
        grid-template-columns: 1fr;
    }

    .login-art,
    .login-art-simple {
        min-height: auto;
    }

    .auth-card,
    .auth-card-simple {
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .login-art,
    .login-art-simple {
        padding: 22px;
        border-radius: 24px;
    }

    .auth-card,
    .auth-card-simple {
        padding: 22px;
        border-radius: 22px;
    }

    .auth-logo,
    .auth-logo-simple {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .auth-brand h1,
    .auth-brand-simple h1 {
        font-size: 28px;
    }

    .auth-brand p,
    .auth-brand-simple p,
    .auth-copy-box p,
    .auth-copy-box-simple p,
    .auth-tips p,
    .auth-tips-simple p {
        font-size: 15px;
    }

    .mascot-row,
    .mascot-row-simple {
        gap: 14px;
        min-height: 170px;
        margin: 42px 0 26px;
    }

    .simple-mascot-head {
        width: 70px;
        height: 70px;
    }

    .simple-mascot-main .simple-mascot-head {
        width: 78px;
        height: 78px;
    }

    .simple-eye {
        top: 25px;
        width: 15px;
        height: 15px;
    }

    .simple-eye.left { left: 16px; }
    .simple-eye.right { right: 16px; }
    .simple-mascot-main .simple-eye { top: 28px; }
    .simple-mascot-main .simple-eye.left { left: 18px; }
    .simple-mascot-main .simple-eye.right { right: 18px; }

    .simple-pupil {
        width: 6px;
        height: 6px;
    }

    .simple-mascot-neck {
        width: 14px;
        height: 18px;
    }

    .simple-mascot-body {
        width: 74px;
        height: 62px;
    }

    .simple-mascot-main .simple-mascot-body {
        width: 80px;
        height: 66px;
    }
}

.track-page {
    background: linear-gradient(180deg, #fff5cf 0%, #fffbee 100%);
}

.track-shell {
    max-width: 1160px;
    margin: 0 auto;
    padding: 52px 20px 72px;
}

.track-hero {
    background: linear-gradient(135deg, #ffcc00, #ffe079);
    border-radius: 32px;
    padding: 36px;
    box-shadow: 0 28px 65px rgba(212, 163, 0, 0.18);
    margin-bottom: 26px;
}

.track-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 28px;
}

.track-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 0;
}

.track-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 14px 28px rgba(0,0,0,0.14);
}

.track-brand h1 {
    margin: 0 0 8px;
    font-size: 40px;
    line-height: 1.1;
    color: #0f2e63;
}

.track-brand p {
    margin: 0;
    color: #3b4b63;
    font-size: 18px;
    line-height: 1.6;
}

.track-form-card,
.track-result-card {
    background: rgba(255,255,255,0.97);
    border: 1px solid #f3e6b4;
    border-radius: 26px;
    padding: 32px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.09);
}

.track-form-card {
    display: grid;
    gap: 22px;
    align-items: stretch;
}

.track-form-copy strong {
    display: block;
    margin-bottom: 10px;
    font-size: 24px;
    color: #0f2e63;
}

.track-form-copy p {
    margin: 0;
    color: #475569;
    font-size: 16px;
    line-height: 1.7;
}

.track-search-bar {
    display: block;
}

.track-search-field {
    display: block;
}

.track-search-field span {
    display: block;
    margin-bottom: 12px;
    color: #334155;
    font-size: 18px;
    font-weight: 700;
}

.track-search-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 250px);
    gap: 16px;
    align-items: center;
}

.track-search-field input {
    display: block;
    height: 72px;
    font-size: 20px;
    line-height: 72px;
    border-radius: 20px;
    border: 1px solid #d8dee8;
    padding: 0 22px;
    background: #fff;
    width: 100%;
    box-shadow: none;
}

.track-btn {
    margin-right: 0;
    background: #d40511;
    min-width: 220px;
    width: 100%;
    height: 72px;
    border-radius: 20px;
    font-size: 20px;
    font-weight: 800;
}

.track-result-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.track-result-head h2 {
    margin: 0 0 8px;
    font-size: 30px;
}

.track-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.track-empty {
    text-align: center;
    padding: 32px 18px;
}

.track-empty h2 {
    margin-top: 0;
}

@media (max-width: 720px) {
    .login-art {
        padding: 20px;
        border-radius: 24px;
    }

    .mascot-row {
        min-height: 150px;
        gap: 12px;
    }

    .mascot-head {
        width: 64px;
        height: 64px;
    }

    .mascot-body {
        width: 72px;
        height: 62px;
    }

    .eye {
        top: 24px;
        width: 14px;
        height: 14px;
    }

    .eye.left { left: 15px; }
    .eye.right { right: 15px; }

    .pupil {
        width: 6px;
        height: 6px;
    }

    .auth-logo,
    .track-logo {
        width: 48px;
        height: 48px;
    }

    .auth-card-playful {
        max-width: 100%;
    }

    .track-hero,
    .track-form-card,
    .track-result-card {
        padding: 18px;
        border-radius: 20px;
    }

    .track-form-card,
    .track-result-grid,
    .track-search-input-row {
        grid-template-columns: 1fr;
    }

    .track-brand h1 {
        font-size: 26px;
    }
}

.invoice-page {
    background: #f4f4f5;
}

.invoice-toolbar {
    margin-bottom: 12px;
}

.invoice-toolbar-actions {
    justify-content: flex-end;
}

.invoice-sheet-wrap {
    overflow-x: auto;
    padding-bottom: 16px;
}

.invoice-sheet {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
    padding: 16px 18px;
    margin: 0 auto 16px;
    color: #111827;
}

.landscape-invoice {
    width: 1280px;
    min-height: auto;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 3px solid #c1121f;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.invoice-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1.2;
}

.invoice-logo {
    width: 124px;
    height: 124px;
    object-fit: contain;
    background: #fff;
    border-radius: 18px;
    padding: 8px;
    border: 1px solid #e5e7eb;
}

.invoice-brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #111827;
}

.invoice-brand-sub {
    margin-top: 4px;
    color: #c1121f;
    font-size: 16px;
    font-weight: 700;
}

.invoice-title-block {
    min-width: 320px;
    flex: 0.95;
    text-align: right;
}

.invoice-title-block h2 {
    margin: 0;
    font-size: 26px;
    color: #111827;
}

.invoice-title-block p {
    margin: 2px 0 8px;
    color: #6b7280;
    font-size: 13px;
}

.invoice-meta-list {
    display: grid;
    gap: 4px;
}

.invoice-meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px dashed #d1d5db;
}

.invoice-meta-list span {
    color: #6b7280;
}

.invoice-meta-list strong {
    color: #111827;
}

.invoice-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.invoice-info-card {
    border: 1px solid #e5e7eb;
    border-top: 4px solid #c1121f;
    border-radius: 16px;
    padding: 8px 10px;
    background: #fff;
}

.invoice-info-wide {
    grid-column: span 2;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.invoice-table-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 10px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: fixed;
}

.invoice-table col.col-order-no { width: 14%; }
.invoice-table col.col-tracking-no { width: 18%; }
.invoice-table col.col-item { width: 17%; }
.invoice-table col.col-qty { width: 8%; }
.invoice-table col.col-weight { width: 11%; }
.invoice-table col.col-amount { width: 12%; }
.invoice-table col.col-remark { width: 20%; }

.invoice-table th,
.invoice-table td {
    padding: 7px 7px;
    border-bottom: 1px solid #eceff3;
    text-align: left;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.3;
}

.invoice-table th {
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.invoice-table th span {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

.invoice-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.invoice-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.invoice-summary-box {
    border-radius: 18px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.invoice-summary-box span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
}

.invoice-summary-box strong {
    font-size: 16px;
    color: #111827;
}

.accent-red-fill {
    background: #c1121f;
    border-color: #c1121f;
}

.accent-red-fill span,
.accent-red-fill strong {
    color: #fff;
}

.invoice-summary-box-dark {
    background: #111827;
    border-color: #111827;
}

.invoice-summary-box-dark span,
.invoice-summary-box-dark strong {
    color: #fff;
}

.invoice-footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 10px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.invoice-remarks-card,
.invoice-signature-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    break-inside: avoid;
    page-break-inside: avoid;
}

.invoice-remarks-body {
    min-height: 58px;
    line-height: 1.45;
    color: #374151;
    font-size: 13px;
}

.invoice-signature-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: end;
}

.signature-line-group span {
    display: block;
    color: #6b7280;
    margin-bottom: 8px;
    font-size: 12px;
}

.signature-line {
    border-bottom: 2px solid #111827;
    height: 28px;
}

.signature-stamp-box {
    border: 2px dashed #c1121f;
    border-radius: 14px;
    height: 52px;
}

@media print {
    body.invoice-page {
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .topbar,
    .flash-messages,
    .invoice-toolbar {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .main-panel {
        padding: 0;
    }

    .invoice-sheet {
        box-shadow: none;
        margin: 0;
        border-radius: 0;
        width: 100%;
        min-height: auto;
        padding: 6mm;
    }

    @page {
        size: A4 landscape;
        margin: 6mm;
    }
}


.invoice-header,
.invoice-info-card,
.invoice-table-card,
.invoice-summary-box,
.invoice-remarks-card,
.invoice-signature-card,
.signature-stamp-box,
.invoice-table th,
.accent-red-fill,
.invoice-summary-box-dark {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.auth-page-playful {
    background: radial-gradient(circle at top, #fff1a8 0%, #ffe066 30%, #fff7dd 100%);
}

.login-scene {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(560px, 1.15fr) minmax(360px, 0.85fr);
    gap: 28px;
    align-items: center;
}

.login-art {
    background: linear-gradient(180deg, #ffd54f 0%, #ffdf70 55%, #ffe792 100%);
    border-radius: 32px;
    padding: 34px 34px 28px;
    min-height: 640px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 26px 65px rgba(212, 163, 0, 0.20);
}

.login-art::before,
.login-art::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
}

.login-art::before {
    width: 280px;
    height: 280px;
    top: -90px;
    left: -70px;
}

.login-art::after {
    width: 340px;
    height: 340px;
    right: -120px;
    bottom: -120px;
}

.auth-brand-large {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.auth-brand-large h1 {
    margin: 0 0 8px;
    font-size: 34px;
    color: #0f172a;
}

.auth-brand-large p {
    margin: 0;
    color: #334155;
    font-size: 18px;
    line-height: 1.6;
}

.mascot-row {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 28px;
    margin: 64px 0 34px;
}

.mascot {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform .2s ease;
}

.mascot-main {
    transform: scale(1.08);
}

.mascot-head {
    width: 112px;
    height: 102px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 36px;
    position: relative;
    border: 4px solid #111827;
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.10);
}

.mascot-main .mascot-head {
    width: 126px;
    height: 114px;
}

.mascot-neck {
    width: 28px;
    height: 24px;
    background: #f8fafc;
    border-left: 4px solid #111827;
    border-right: 4px solid #111827;
    margin-bottom: -2px;
}

.eye {
    position: absolute;
    top: 38px;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 4px solid #111827;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.eye.left { left: 26px; }
.eye.right { right: 26px; }
.mascot-main .eye { top: 42px; }
.mascot-main .eye.left { left: 30px; }
.mascot-main .eye.right { right: 30px; }

.pupil {
    width: 8px;
    height: 8px;
    background: #111827;
    border-radius: 999px;
    transition: transform .08s linear;
}

.mascot-body {
    width: 86px;
    height: 90px;
    margin-top: 12px;
    border: 4px solid #111827;
    border-radius: 24px 24px 28px 28px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
}

.mascot-body::before,
.mascot-body::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 54px;
    border: 4px solid #111827;
    border-top: none;
    background: #fff;
    bottom: -48px;
    border-radius: 0 0 16px 16px;
}

.mascot-body::before { left: 10px; }
.mascot-body::after { right: 10px; }

.mascot-main .mascot-body {
    width: 94px;
    height: 98px;
}

#mascot-row[data-mode="password"] .mascot {
    transform: rotate(8deg);
}

#mascot-row[data-mode="password"] .mascot-main {
    transform: scale(1.08) rotate(-8deg);
}

#mascot-row[data-mode="password"] .pupil {
    opacity: 0;
}

.auth-copy-box {
    position: relative;
    z-index: 1;
    background: rgba(255, 251, 235, 0.86);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 24px;
    padding: 22px 24px;
    box-shadow: 0 16px 36px rgba(255, 205, 86, 0.16);
}

.auth-copy-box strong {
    display: block;
    margin-bottom: 12px;
    font-size: 22px;
    color: #111827;
}

.auth-copy-box p {
    margin: 0;
    font-size: 16px;
    line-height: 1.75;
    color: #1f2937;
}

.auth-card-playful {
    width: 100%;
    max-width: 460px;
    background: rgba(255,255,255,0.96);
    border-radius: 28px;
    padding: 30px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form label > span {
    display: block;
    margin-bottom: 10px;
    color: #334155;
    font-size: 17px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
    height: 58px;
    width: 100%;
    border-radius: 16px;
    border: 1px solid #d1d5db;
    padding: 0 16px;
    font-size: 16px;
    background: #fff;
}

.password-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 15px;
}

.password-toggle input {
    width: 18px;
    height: 18px;
}

.auth-btn {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    background: #d40511;
    font-size: 24px;
    font-weight: 700;
}

.auth-tips {
    margin-top: 24px;
    background: #f8fafc;
    border: 1px solid #dbe1ea;
    border-radius: 22px;
    padding: 22px 20px;
}

.auth-tips strong {
    display: block;
    margin-bottom: 12px;
    color: #0f172a;
    font-size: 22px;
}

.auth-tips p {
    margin: 0 0 8px;
    color: #334155;
    font-size: 16px;
    line-height: 1.8;
}

@media (max-width: 1100px) {
    .login-scene {
        grid-template-columns: 1fr;
    }

    .login-art {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .login-art {
        padding: 20px;
        border-radius: 24px;
    }

    .mascot-row {
        min-height: 150px;
        gap: 12px;
        margin: 36px 0 24px;
    }

    .mascot-head {
        width: 64px;
        height: 64px;
        border-width: 3px;
        border-radius: 22px;
    }

    .mascot-main .mascot-head {
        width: 74px;
        height: 72px;
    }

    .mascot-neck {
        width: 18px;
        height: 18px;
        border-left-width: 3px;
        border-right-width: 3px;
    }

    .mascot-body {
        width: 56px;
        height: 60px;
        border-width: 3px;
        margin-top: 8px;
    }

    .mascot-main .mascot-body {
        width: 64px;
        height: 68px;
    }

    .mascot-body::before,
    .mascot-body::after {
        width: 10px;
        height: 34px;
        border-width: 3px;
        bottom: -31px;
    }

    .eye {
        top: 22px;
        width: 14px;
        height: 14px;
        border-width: 3px;
    }

    .eye.left { left: 14px; }
    .eye.right { right: 14px; }
    .mascot-main .eye { top: 24px; }
    .mascot-main .eye.left { left: 17px; }
    .mascot-main .eye.right { right: 17px; }

    .pupil {
        width: 5px;
        height: 5px;
    }

    .auth-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .auth-brand-large h1 {
        font-size: 26px;
    }

    .auth-brand-large p,
    .auth-copy-box p,
    .auth-tips p,
    .auth-form label > span {
        font-size: 15px;
    }

    .auth-copy-box strong,
    .auth-tips strong {
        font-size: 20px;
    }

    .auth-card-playful {
        max-width: 100%;
        padding: 22px;
        border-radius: 22px;
    }
}

@media (max-width: 960px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    .mobile-order-head {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-overview-shell {
        padding: 16px;
    }

    .mobile-toolbar-stack .btn {
        width: 100%;
    }

    .summary-strip,
    .stats-grid,
    .mobile-order-grid,
    .filter-grid,
    .detail-grid,
    .form-grid,
    .track-result-grid,
    .track-form-card,
    .finance-filter-grid,
    .track-topbar,
    .login-scene,
    .login-scene-simple {
        grid-template-columns: 1fr;
    }

    .topbar-with-actions,
    .topbar-actions,
    .track-topbar,
    .detail-header,
    .mobile-order-head {
        flex-direction: column;
        align-items: stretch;
    }

    .main-panel {
        padding: 16px;
    }

    .sidebar {
        padding-bottom: 12px;
    }
}


.sidebar-backdrop {
    display: none;
}

@media (max-width: 960px) {
    body {
        overflow-x: hidden;
    }

    .layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 280px);
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 40;
        overflow-y: auto;
        padding-bottom: 24px;
    }

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

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 35;
    }

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

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .main-panel {
        width: 100%;
        padding: 16px;
    }

    .topbar-with-actions,
    .topbar-actions,
    .detail-header,
    .mobile-order-head,
    .topbar-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .language-switcher,
    .topbar-actions,
    .user-chip,
    .btn,
    .lang-chip {
        width: 100%;
    }

    .stats-grid,
    .summary-strip,
    .overview-top-grid,
    .overview-mid-grid,
    .overview-summary-grid,
    .filter-grid,
    .filter-grid-wide,
    .finance-filter-grid,
    .form-grid,
    .detail-grid,
    .mobile-order-grid,
    .track-result-grid,
    .track-form-card,
    .login-scene,
    .login-scene-simple {
        grid-template-columns: 1fr !important;
    }


    .orders-overview-shell,
    .panel,
    .track-hero,
    .track-form-card,
    .track-result-card,
    .invoice-sheet {
        padding: 16px;
        border-radius: 18px;
    }

    .mobile-toolbar-stack .btn,
    .mobile-order-tools .btn {
        width: 100%;
    }

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

    .table-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}


.dashboard-stats-grid {
    display: grid !important;
    gap: 16px;
    width: 100%;
}

.dashboard-stats-grid-top {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.dashboard-stats-grid-mid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.dashboard-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px;
    width: 100%;
}

@media (max-width: 1200px) {
    .dashboard-stats-grid-top,
    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .dashboard-stats-grid-mid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 960px) {
    .dashboard-stats-grid,
    .dashboard-summary-grid {
        grid-template-columns: 1fr !important;
    }
}


/* Admin layout stabilization */
.topbar-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.page-url {
    word-break: break-all;
}

@media (min-width: 961px) {
    .orders-toolbar.desktop-only,
    .orders-filter-bar.desktop-only {
        display: grid !important;
        width: 100%;
    }

    .orders-toolbar.desktop-only {
        grid-template-columns: repeat(6, max-content);
        justify-content: start;
        gap: 10px;
    }

    .orders-filter-bar.desktop-only {
        grid-template-columns: minmax(360px, 1.8fr) minmax(170px, 220px) minmax(170px, 220px) 120px;
        gap: 12px;
        align-items: center;
    }

    .mobile-menu-btn {
        display: none !important;
    }
}

@media (max-width: 960px) {
    .topbar-title-row {
        align-items: center;
    }

    .topbar-heading > div:last-child {
        width: 100%;
    }

    .language-switcher {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .language-switcher > span {
        grid-column: 1 / -1;
        font-size: 13px;
        color: #64748b;
    }

    .lang-chip,
    .user-chip,
    .topbar-actions form,
    .topbar-actions .btn {
        width: 100%;
    }

    .page-url {
        display: none;
    }

    .orders-overview-shell {
        padding: 14px;
    }

    .mobile-order-tools {
        gap: 10px;
    }

    .mobile-order-card {
        border-radius: 18px;
        padding: 14px;
    }
}

.finance-action-panel {
    padding-top: 20px;
}

.finance-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.finance-mode-tabs {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 6px;
}

.finance-mode-tab {
    border: none;
    background: transparent;
    color: #475569;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.finance-mode-tab.active {
    background: #1677ff;
    color: #fff;
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.18);
}

.finance-mode-section {
    display: none;
}

.finance-mode-section.active {
    display: block;
}

@media (max-width: 960px) {
    .finance-panel-head {
        flex-direction: column;
    }

    .finance-mode-tabs {
        width: 100%;
    }
}
