:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --ink: #111827;
    --muted: #64748b;
    --line: #e3e8f0;
    --blue: #2563eb;
    --green: #16a34a;
    --orange: #f59e0b;
    --purple: #7c3aed;
    --teal: #0f9f8f;
    --red: #dc2626;
    --shadow: 0 10px 28px rgba(15, 23, 42, .08);
    font-family: "IBM Plex Sans Thai", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--bs-body-font-family);
}

a {
    text-decoration: none;
}

.form-label {
    font-size: 0.8rem;
    color: #675d5d;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
    background: linear-gradient(135deg, rgba(37, 99, 235, .10), transparent 34rem), var(--bg);
}



.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 36px;
    min-height: 100vh;
    padding: 36px clamp(28px, 5vw, 72px);
    color: #fff;
    background: linear-gradient(rgba(15, 23, 42, .70), rgba(15, 23, 42, .60)), url("https://images.unsplash.com/photo-1553413077-190dd305871c?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.login-brand {
    color: #fff;
}

    .login-brand .brand-logo {
        border-color: rgba(255, 255, 255, .86);
        color: #fff;
        background: rgba(255, 255, 255, .12);
    }

    .login-brand small,
    .login-copy p {
        color: rgba(255, 255, 255, .74);
    }

.login-copy {
    max-width: 620px;
}

    .login-copy span {
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 4px 12px;
        margin-bottom: 18px;
        border: 1px solid rgba(255, 255, 255, .28);
        border-radius: 99px;
        color: rgba(255, 255, 255, .86);
        font-size: 13px;
        font-weight: 700;
    }

    .login-copy h1 {
        margin: 0 0 18px;
        max-width: 660px;
        font-size: clamp(34px, 5vw, 60px);
        line-height: 1.08;
        font-weight: 700;
    }

    .login-copy p {
        max-width: 520px;
        margin: 0;
        font-size: 18px;
        line-height: 1.7;
    }

.login-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
}

    .login-metrics article {
        min-height: 96px;
        display: grid;
        align-content: center;
        gap: 4px;
        padding: 16px;
        border: 1px solid rgba(255, 255, 255, .22);
        border-radius: 8px;
        background: rgba(255, 255, 255, .12);
        backdrop-filter: blur(8px);
    }

    .login-metrics strong {
        font-size: 30px;
        line-height: 1;
    }

    .login-metrics span {
        color: rgba(255, 255, 255, .76);
        font-size: 13px;
        font-weight: 600;
    }

.login-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(100%, 440px);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .12);
}

.login-card-head {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.login-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--blue);
    background: #eef5ff;
    font-size: 24px;
}

.login-card h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.login-card p {
    margin: 4px 0 0;
    color: var(--muted);
}

.login-alert {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    background: #fef2f2;
    font-size: 13px;
    font-weight: 600;
}

    .login-alert.show {
        display: block;
    }

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 20px;
    color: var(--muted);
    font-size: 13px;
}

    .login-options label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

.login-submit {
    width: 100%;
    min-height: 44px;
    font-weight: 700;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 16px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 24px rgba(15, 23, 42, .04);
    overflow-y: auto;
    z-index: 20;
}

.brand {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 3px solid #0e78b7;
    border-radius: 8px;
    color: #0e78b7;
    font-size: 24px;
}

.brand strong,
.brand small {
    display: block;
    white-space: nowrap;
}

.brand strong {
    font-size: 18px;
    font-weight: 700;
}

.brand small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.side-nav {
    display: grid;
    gap: 4px;
    padding-bottom: 20px;
}

.nav-link,
.nav-sublink {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    font-weight: 600;
    text-align: left;
}

.nav-link {
    padding: 10px 14px;
}

    .nav-link i:first-child {
        width: 18px;
        color: #64748b;
        text-align: center;
    }

    .nav-link:hover,
    .nav-sublink:hover {
        background: #eef5ff;
        color: var(--blue);
    }

    .nav-link.active {
        color: #fff;
        background: linear-gradient(135deg, #2f7df4, #145ee8);
        box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
    }

        .nav-link.active i {
            color: #fff;
        }

.nav-sublink {
    min-height: 31px;
    margin-left: 24px;
    padding: 6px 14px 6px 30px;
    border-left: 1px solid var(--line);
    color: #475569;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.collapse-btn,
.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: #334155;
    background: transparent;
}

.collapse-btn {
    background: #f8fafc;
    border: 1px solid var(--line);
}

    .icon-btn:hover,
    .collapse-btn:hover {
        color: var(--blue);
        background: #eef5ff;
    }

.main-panel {
    min-width: 0;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, .07), transparent 28rem), var(--bg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

    .topbar h1 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
    }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.has-badge {
    position: relative;
}

    .has-badge span {
        position: absolute;
        top: 4px;
        right: 4px;
        min-width: 16px;
        height: 16px;
        display: grid;
        place-items: center;
        border-radius: 99px;
        color: #fff;
        background: var(--red);
        border: 2px solid #fff;
        font-size: 9px;
        font-weight: 700;
    }

.user-dropdown {
    min-width: 190px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding-left: 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

    .user-menu:hover,
    .user-menu[aria-expanded="true"] {
        color: var(--blue);
    }

    .user-menu img {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: #dbeafe;
    }

    .user-menu strong,
    .user-menu small {
        display: block;
    }

    .user-menu strong {
        font-size: 14px;
    }

    .user-menu small {
        color: var(--muted);
        font-size: 12px;
    }

.user-dropdown-menu {
    min-width: 240px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

    .user-dropdown-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 40px;
        border-radius: 6px;
        font-weight: 600;
    }

        .user-dropdown-menu .dropdown-item i {
            width: 18px;
            text-align: center;
        }

.content {
    padding: 20px 28px 26px;
}

.page-view {
    display: none;
}

    .page-view.active {
        display: block;
    }

.stat-card,
.panel,
.style-guide {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    min-height: 150px;
    padding: 20px 22px;
    overflow: hidden;
}

    .stat-card span {
        display: block;
        margin-bottom: 10px;
        color: var(--blue);
        font-weight: 700;
    }

    .stat-card strong {
        display: block;
        color: #172033;
        font-size: clamp(30px, 3vw, 38px);
        line-height: 1;
    }

    .stat-card small {
        display: block;
        margin-top: 8px;
        color: #475569;
        font-size: 13px;
    }

    .stat-card em {
        display: block;
        margin-top: 18px;
        color: var(--green);
        font-size: 12px;
        font-style: normal;
        font-weight: 600;
    }

.stat-icon {
    position: absolute;
    top: 48px;
    right: 20px;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 30px;
    color: var(--blue);
    background: #e8f0ff;
}

.accent-orange span,
.accent-orange .stat-icon {
    color: var(--orange);
}

.accent-orange .stat-icon {
    background: #fff4e2;
}

.accent-green span,
.accent-green .stat-icon {
    color: var(--green);
}

.accent-green .stat-icon {
    background: #e8f8ed;
}

.accent-purple span,
.accent-purple .stat-icon {
    color: var(--purple);
}

.accent-purple .stat-icon {
    background: #f1ebff;
}

.accent-teal span {
    color: var(--teal);
}

.panel {
    padding: 20px;
}

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

    .panel-title h2 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
    }

    .panel-title a {
        color: var(--blue);
        font-size: 13px;
        font-weight: 600;
    }

    .panel-title .form-select {
        width: 132px;
        border-color: var(--line);
        font-size: 12px;
    }

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

    .page-heading h2 {
        margin: 2px 0 4px;
        font-size: 26px;
        font-weight: 700;
    }

    .page-heading p {
        margin: 0;
        color: var(--muted);
    }

.page-kicker {
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}

.heading-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.return-form-panel {
    min-height: 100%;
}

.return-entry-form .form-label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.return-entry-form .form-control,
.return-entry-form .form-select {
    border-color: var(--line);
}

.form-section {
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

    .form-section:first-of-type {
        padding-top: 0;
        border-top: 0;
    }

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

    .section-title h3 {
        margin: 0;
        font-size: 15px;
        font-weight: 700;
    }

.choice-group {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

    .choice-group label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #334155;
        font-size: 13px;
        font-weight: 600;
    }

.return-item-table {
    min-width: 980px;
}

.return-summary {
    display: grid;
    gap: 10px;
}

    .return-summary div {
        min-height: 76px;
        display: grid;
        align-content: center;
        gap: 4px;
        padding: 14px;
        border-radius: 8px;
        background: #f6f9fd;
    }

    .return-summary span {
        color: var(--blue);
        font-size: 26px;
        font-weight: 700;
        line-height: 1;
    }

    .return-summary small {
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
    }

.return-record-list {
    display: grid;
    gap: 10px;
}

.return-record {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

    .return-record strong {
        color: #172033;
    }

    .return-record small {
        color: var(--muted);
        line-height: 1.5;
    }

.return-record-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.return-list-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

    .return-list-summary article {
        min-height: 96px;
        display: grid;
        align-content: center;
        gap: 6px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .return-list-summary span {
        color: var(--blue);
        font-size: 30px;
        font-weight: 700;
        line-height: 1;
    }

    .return-list-summary small {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
    }

.list-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 180px 160px 160px auto;
    gap: 10px;
    margin-bottom: 16px;
}

    .list-toolbar .form-control,
    .list-toolbar .form-select,
    .list-toolbar .input-group-text {
        border-color: var(--line);
    }

.return-list-table {
    min-width: 1120px;
}

    .return-list-table td:nth-child(2),
    .return-list-table td:nth-child(6),
    .return-list-table td:nth-child(7) {
        text-align: center;
    }

.return-list-products {
    max-width: 280px;
    color: #334155;
    white-space: normal;
}

    .return-list-products small {
        color: var(--muted);
    }

.user-form-panel {
    min-height: 100%;
}

.user-form .form-label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.user-form .form-control,
.user-form .form-select,
.user-toolbar .form-control,
.user-toolbar .form-select,
.user-toolbar .input-group-text {
    border-color: var(--line);
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

    .permission-grid label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #334155;
        font-size: 13px;
        font-weight: 600;
    }

.user-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

    .user-summary article {
        min-height: 90px;
        display: grid;
        align-content: center;
        gap: 6px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .user-summary span {
        color: var(--blue);
        font-size: 30px;
        font-weight: 700;
        line-height: 1;
    }

    .user-summary small {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
    }

.user-toolbar {
    grid-template-columns: minmax(280px, 1fr) 170px 170px;
}

.user-table {
    min-width: 920px;
}

.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 260px;
}

    .permission-tags span {
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        padding: 2px 8px;
        border-radius: 99px;
        color: #1d4ed8;
        background: #e8f1ff;
        font-size: 11px;
        font-weight: 700;
    }

.report-filter-panel {
    margin-bottom: 16px;
    color: #fff;
    background: linear-gradient(135deg, #fefffa, #c4c7cdd9) !important;
    border-color: #174aa5;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: 150px repeat(3, auto);
    gap: 12px 18px;
    align-items: end;
}

    .report-filter-grid .form-label {
        color: #595f67;
        font-size: 13px;
        font-weight: 700;
    }

    .report-filter-grid .form-select {
        border-color: #93c5fd;
    }

.report-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    font-weight: 700;
    white-space: nowrap;
    color: #333;
}

.report-wide {
    grid-column: span 2;
}

.report-actions {
    display: flex;
    gap: 10px;
}

.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

    .report-summary-cards article {
        min-height: 90px;
        display: grid;
        align-content: center;
        gap: 6px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        box-shadow: var(--shadow);
    }

    .report-summary-cards span {
        color: var(--blue);
        font-size: 30px;
        font-weight: 700;
        line-height: 1;
    }

    .report-summary-cards small {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
    }

.report-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

    .report-title-row h3 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
    }

    .report-title-row span {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
    }

.report-table {
    min-width: 1120px;
    margin: 0;
    border-collapse: collapse;
}

    .report-table th,
    .report-table td {
        border: 1px solid #cbd5e1;
        text-align: center;
    }

        .report-table th:first-child,
        .report-table td:first-child {
            min-width: 210px;
            text-align: left;
            font-weight: 700;
        }

    .report-table th {
        background: #eef5ff;
    }

        .report-table td:last-child,
        .report-table th:last-child {
            background: #fee2e2;
            font-weight: 800;
        }

.report-total-row td {
    background: #f8fafc;
    font-weight: 800;
}

.print-control-panel {
    margin-bottom: 16px;
}

    .print-control-panel .form-label {
        color: #334155;
        font-size: 13px;
        font-weight: 700;
    }

.print-meta {
    min-height: 52px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

    .print-meta span {
        color: var(--blue);
        font-weight: 700;
    }

    .print-meta small {
        color: var(--muted);
    }

.print-preview-wrap {
    overflow-x: auto;
    padding-bottom: 12px;
}

.print-sheet {
    width: 1120px;
    min-height: 720px;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 24px 28px;
    color: #111827;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: var(--shadow); 
}

.print-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed #cbd5e1;
}

.print-document {
    min-height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.print-header {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
}

.print-title {
    text-align: center;
}

    .print-title h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
    }

    .print-title small,
    .print-page-no {
        color: #475569;
        font-size: 12px;
    }

.print-page-no {
    text-align: right;
}

.print-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
}

.print-field {
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: center;
    min-height: 28px;
    font-size: 13px;
}

    .print-field span {
        color: #334155;
        font-weight: 600;
    }

    .print-field strong {
        min-height: 24px;
        display: block;
        padding: 2px 8px;
        border: 1px solid #64748b;
        font-weight: 500;
    }

.print-return-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .print-return-table th,
    .print-return-table td {
        padding: 5px 6px;
        border: 1px solid #64748b;
        vertical-align: top;
    }

    .print-return-table th {
        text-align: center;
        background: #eef2f7;
        font-weight: 700;
    }

    .print-return-table td:first-child,
    .print-return-table td:nth-child(7) {
        text-align: center;
    }

.print-footer {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: end;
    margin-top: auto;
    padding-top: 18px;
}

.print-audit {
    display: grid;
    gap: 4px;
    color: #334155;
    font-size: 12px;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #64748b;
}

.signature-box {
    min-height: 70px;
    display: grid;
    align-content: space-between;
    padding: 8px;
    text-align: center;
    border-right: 1px solid #64748b;
    font-size: 13px;
}

    .signature-box:last-child {
        border-right: 0;
    }

.signature-line {
    display: block;
    height: 24px;
    border-bottom: 1px solid #111827;
}

.print-company {
    text-align: center;
    color: #475569;
    font-size: 12px;
    letter-spacing: 0;
}


.product-form-panel {
    min-height: 100%;
}

.product-type-form .form-label {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.product-type-form .form-control,
.product-type-form .form-select,
.table-tools .form-control,
.table-tools .input-group-text {
    border-color: var(--line);
}

.product-type-form textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.table-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(100%, 430px);
}

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

    .product-summary div {
        min-height: 72px;
        display: grid;
        align-content: center;
        gap: 3px;
        padding: 12px 14px;
        border-radius: 8px;
        background: #f6f9fd;
    }

    .product-summary span {
        color: var(--blue);
        font-size: 24px;
        font-weight: 700;
        line-height: 1;
    }

    .product-summary small {
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
    }

.product-type-table td {
    vertical-align: middle;
}

.type-description {
    max-width: 260px;
    color: var(--muted);
    white-space: normal;
}

.row-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 4px;
}

    .row-actions .btn {
        width: 26px;
        height: 26px;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 4px;
        color: #64705d;
        background: transparent;
    }

        .row-actions .btn:hover {
            color: #1f5f32;
            background: #edf3df;
        }

    .row-actions .btn-outline-danger:hover {
        color: #b91c1c;
        background: #fbe8e8;
    }

.empty-state {
    padding: 34px 16px;
    color: var(--muted);
    text-align: center;
}

.line-chart {
    min-height: 286px;
}

    .line-chart svg {
        width: 100%;
        height: 100%;
        min-height: 286px;
    }

.grid-lines line {
    stroke: #e7edf5;
    stroke-width: 1;
}

.chart-area {
    fill: url(#chartFill);
}

.chart-line {
    fill: none;
    stroke: var(--blue);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: drawLine 1.2s ease forwards;
}

.chart-points circle {
    fill: var(--blue);
    stroke: #fff;
    stroke-width: 3;
}

.chart-labels text,
.axis-labels text {
    fill: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.axis-labels text {
    fill: #475569;
    font-size: 12px;
    font-weight: 500;
}

.table th,
.table td {
    white-space: nowrap;
}

    .table td.company {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }


.data-table {
    margin: 0;
    min-width: 620px;
    overflow: hidden;
    border-collapse: collapse;
    border: 1px solid #dfe4d2;
    color: #2f352b;
    font-size: 12px;
    line-height: 1.3;
}

    .data-table > :not(caption) > * > * {
        padding: 6px 10px;
        border-color: #dbe6ff;
        border-width: 0 1px 1px 0;
    }

    .data-table thead th {
        color: #1964ea;
        font-size: 12px;
        font-weight: 700;
        background: #e9effd;
        white-space: nowrap;
    }

        .data-table thead th:last-child,
        .data-table tbody td:last-child {
            border-right: 0;
        }

    .data-table td {
        color: #476598;
        font-size: 13px;
        background: #f4f7fb;
        vertical-align: middle;
    }

    .data-table tbody tr:nth-child(even) td {
        background: #e7ecf3;
    }

    .data-table tbody tr:hover td {
        background: #eef3df;
    }

    .data-table td strong {
        color: #1f241d;
        font-weight: 700;
    }

    .data-table td small,
    .data-table .text-muted {
        color: #737b68 !important;
        font-size: 11px;
    }

.table-responsive:has(.data-table) {
    border: 1px solid #dbe6ff;
    border-radius: 6px;
    background: #f4f7fb;
}

    .table-responsive:has(.data-table) .data-table {
        border: 0;
    }

        .table-responsive:has(.data-table) .data-table tr:last-child td {
            border-bottom: 0;
        }

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

    .status.waiting {
        color: #8a6a00;
        background: #f7efc8;
        border-color: #e5d98d;
    }

    .status.claimed {
        color: #4e7d1f;
        background: #e8f1d4;
        border-color: #c8dda5;
    }

    .status.done {
        color: #357220;
        background: #e3efd3;
        border-color: #bdd59a;
    }

    .status.cancelled {
        color: #a33a32;
        background: #f4dddd;
        border-color: #e8b9b5;
    }

.notification-list {
    display: grid;
    gap: 16px;
}

    .notification-list > div {
        display: grid;
        grid-template-columns: 36px 1fr;
        gap: 12px;
    }

    .notification-list p {
        margin: 0;
        color: #273549;
        font-size: 13px;
        font-weight: 600;
    }

    .notification-list small {
        display: block;
        margin-top: 2px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 400;
    }

.dot {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
}

    .dot.orange {
        background: var(--orange);
    }

    .dot.green {
        background: var(--green);
    }

    .dot.blue {
        background: #3b82f6;
    }

    .dot.purple {
        background: #8b5cf6;
    }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

    .quick-grid a {
        min-height: 70px;
        display: grid;
        place-items: center;
        gap: 4px;
        padding: 10px 6px;
        border-radius: 8px;
        color: #1f2937;
        background: #f3f7fc;
        font-size: 12px;
        font-weight: 700;
    }

        .quick-grid a:hover {
            color: var(--blue);
            background: #e8f1ff;
        }

    .quick-grid i {
        color: #2f7df4;
        font-size: 22px;
    }

.flow-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.mini-screen h3 {
    margin: 8px 0 10px;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.mock-card {
    min-height: 188px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.mock-toolbar,
.mock-grid,
.summary-mini,
.component-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .mock-toolbar span,
    .mock-search {
        flex: 1;
        height: 24px;
        border-radius: 5px;
        background: #eef3fa;
    }

    .mock-toolbar button {
        border: 0;
        border-radius: 5px;
        padding: 5px 8px;
        color: #fff;
        background: var(--blue);
        font-size: 10px;
    }

.mock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 14px;
}

    .mock-grid span {
        height: 24px;
        border-radius: 5px;
        background: #f3f6fb;
    }

.mock-table,
.bar-mini,
.mock-lines {
    margin-top: 14px;
    height: 72px;
    border-radius: 5px;
    background: linear-gradient(#e7edf5 1px, transparent 1px) 0 0 / 100% 24px, linear-gradient(90deg, #eef3fa 30%, transparent 30%) 0 0 / 100% 24px;
}

.mock-rows {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

    .mock-rows span {
        height: 16px;
        border-radius: 99px;
        background: linear-gradient(90deg, #dbeafe 28%, #eef3fa 28%);
    }

.print-mock {
    text-align: center;
}

.summary-mini span {
    flex: 1;
    display: grid;
    place-items: center;
    height: 42px;
    border-radius: 7px;
    color: var(--blue);
    background: #eef5ff;
    font-weight: 700;
}

.bar-mini {
    height: 90px;
    background: linear-gradient(90deg, transparent 8%, #2563eb 8% 14%, transparent 14% 25%, #2563eb 25% 31%, transparent 31% 42%, #2563eb 42% 48%, transparent 48% 59%, #2563eb 59% 65%, transparent 65% 76%, #2563eb 76% 82%, transparent 82%), linear-gradient(#e7edf5 1px, transparent 1px) 0 0 / 100% 22px;
}

.style-guide {
    display: grid;
    grid-template-columns: 1.1fr .8fr 1fr 1.8fr;
    gap: 18px;
    margin-top: 16px;
    padding: 18px 20px;
}

    .style-guide h2 {
        margin: 0 0 10px;
        color: #334155;
        font-size: 14px;
        font-weight: 700;
    }

    .style-guide p {
        margin: 0;
        color: #475569;
        font-size: 13px;
        line-height: 1.7;
    }

.swatches {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

    .swatches span {
        display: grid;
        gap: 6px;
        color: #475569;
        font-size: 11px;
    }

        .swatches span::before {
            content: "";
            width: 30px;
            height: 30px;
            display: block;
            border-radius: 50%;
            background: var(--swatch);
            border: 1px solid var(--line);
        }

.component-row {
    flex-wrap: wrap;
}

    .component-row .form-control,
    .component-row .form-select {
        width: 150px;
    }

body.sidebar-collapsed .admin-shell {
    grid-template-columns: 82px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
    padding-inline: 12px;
}

body.sidebar-collapsed .brand span:not(.brand-logo),
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .nav-link .ms-auto,
body.sidebar-collapsed .nav-sublink,
body.sidebar-collapsed .sidebar-footer span {
    display: none;
}

body.sidebar-collapsed .brand,
body.sidebar-collapsed .nav-link {
    justify-content: center;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

@media (max-width: 1399px) {
    .flow-preview,
    .style-guide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .report-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .report-wide {
        grid-column: span 1;
    }
}

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

    .login-visual {
        min-height: auto;
        padding: 28px;
    }

    .login-copy h1 {
        font-size: 34px;
    }

    .login-panel {
        min-height: auto;
        padding: 22px;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        width: min(86vw, 300px);
        transition: transform .2s ease;
    }

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

    .topbar {
        padding: 0 18px;
    }

    .content {
        padding: 18px;
    }

    body.sidebar-collapsed .admin-shell {
        grid-template-columns: 1fr;
    }

    body.sidebar-collapsed .brand span:not(.brand-logo),
    body.sidebar-collapsed .nav-link span,
    body.sidebar-collapsed .nav-link .ms-auto,
    body.sidebar-collapsed .nav-sublink,
    body.sidebar-collapsed .sidebar-footer span {
        display: initial;
    }

    body.sidebar-collapsed .nav-link {
        justify-content: flex-start;
    }
}

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

    .login-card {
        padding: 22px;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .topbar-actions {
        gap: 4px;
    }

    .user-dropdown {
        min-width: auto;
    }

    .user-menu {
        padding-left: 0;
    }

        .user-menu span,
        .user-menu .bi-chevron-down {
            display: none;
        }

    .stat-card {
        min-height: 132px;
    }

    .flow-preview,
    .style-guide {
        grid-template-columns: 1fr;
    }

    .page-heading {
        flex-direction: column;
    }

    .table-tools {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .product-summary {
        grid-template-columns: 1fr;
    }

    .return-list-summary {
        grid-template-columns: 1fr;
    }

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

    .user-summary,
    .permission-grid {
        grid-template-columns: 1fr;
    }

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

    .report-summary-cards,
    .report-filter-grid {
        grid-template-columns: 1fr;
    }

    .report-actions,
    .report-title-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .topbar {
        gap: 8px;
        padding-inline: 12px;
    }

    .content {
        padding-inline: 12px;
    }

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

@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }

    body {
        background: #fff;
    }

        body * {
            visibility: hidden;
        }

    .print-sheet,
    .print-sheet *,
    .report-print-area,
    .report-print-area * {
        visibility: visible;
    }

    .print-sheet,
    .report-print-area {
        position: absolute;
        inset: 0 auto auto 0;
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .print-sheet {
        min-height: calc(210mm - 16mm);
    }

    .print-document {
        min-height: calc(210mm - 16mm);
    }

    .report-print-area {
        padding: 0;
    }

    .report-table {
        min-width: 0;
        font-size: 10px;
    }

    .print-preview-wrap {
        overflow: visible;
        padding: 0;
    }

    .print-footer {
        margin-top: auto;
        padding-top: 8mm;
    }

    .no-print {
        display: none !important;
    }
}
