/* ============================================
   GLOBAL & BODY STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #FFD700;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

img,
video,
iframe {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

/* ============================================
   TYPOGRAPHY & TEXT UTILITIES
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: #FFD700;
    margin: 15px 0;
}

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

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

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

.gold-link {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s, text-shadow 0.3s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.gold-link:hover {
    color: #FFC107;
    text-decoration: underline;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Ensure gold-links on gold backgrounds are visible */
.footer .gold-link,
.header .gold-link {
    color: #111;
    text-shadow: none;
}

.footer .gold-link:hover,
.header .gold-link:hover {
    color: #333;
    text-shadow: none;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
.mt-5 {
    margin-top: 5px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.ml-10 {
    margin-left: 10px;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    display: block;
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    background-color: #222;
    color: #FFD700;
    border: 1px solid #444;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
}

.detail-section {
    margin: 24px 0;
    overflow: hidden;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
}

.detail-section h3 {
    margin: 0;
    padding: 14px 16px;
    background-color: #333;
    border-left: 4px solid #FFD700;
    border-bottom: 1px solid #444;
}

.detail-grid {
    display: block;
    margin: 0;
}

.detail-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(180px, 32%) minmax(0, 1fr);
    padding: 0;
    border: 0;
    border-bottom: 1px solid #444;
}

.detail-item:nth-child(even) {
    background-color: #272727;
}

.detail-item:last-child {
    border-bottom: 0;
}

.detail-item dt {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 12px 16px;
    color: #eee;
    font-weight: bold;
    background-color: rgba(255, 215, 0, 0.06);
    border-right: 1px solid #444;
}

.detail-item dd {
    margin: 0;
    padding: 12px 16px;
    color: #f5f5f5;
    overflow-wrap: anywhere;
}

.detail-title {
    overflow-wrap: anywhere;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 24px 0;
}

.detail-actions form {
    display: inline-flex;
    margin: 0;
}

.detail-actions form .btn {
    margin: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.log-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 18px 0;
    border-bottom: 1px solid #444;
}

.log-tabs a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 8px 14px;
    color: #ccc;
    border-bottom: 3px solid transparent;
    font-weight: 700;
    text-decoration: none;
}

.log-tabs a:hover,
.log-tabs a.active {
    color: #FFD700;
    border-bottom-color: #FFD700;
}

.log-pagination {
    margin: 18px 0 28px;
    color: #ccc;
}

.log-pagination a {
    color: #FFD700;
    border-color: #555;
    text-decoration: none;
}

.log-pagination a:hover {
    color: #111;
    background: #FFD700;
}

.dashboard-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin: 28px 0 30px;
    padding: 26px 28px;
    color: #f5f5f5;
    background: linear-gradient(115deg, #292929 0%, #222 62%, #27271f 100%);
    border: 1px solid #444;
    border-left: 5px solid #FFD700;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}

.dashboard-summary-card {
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    background: #fff;
    padding: 13px 15px;
}

.dashboard-summary-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dashboard-summary-heading h2 {
    color: #12304a;
    font-size: 1rem;
    margin: 0;
}

.dashboard-summary-heading a {
    color: #9a6b22;
    font-size: .78rem;
    text-decoration: none;
}

.dashboard-summary-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.dashboard-summary-values a {
    color: inherit;
    border-left: 2px solid #dfe7ef;
    display: block;
    padding-left: 8px;
    text-decoration: none;
}

.dashboard-summary-values a:hover,
.dashboard-summary-values a:focus-visible {
    background: #f5f8fa;
    outline: none;
}

.dashboard-summary-values strong {
    color: #12304a;
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
}

.dashboard-summary-values span {
    color: #64748b;
    display: block;
    font-size: .72rem;
    margin-top: 3px;
}

.dashboard-summary-warning { border-left-color: #d97706 !important; }
.dashboard-summary-warning strong { color: #b45309; }
.dashboard-summary-danger { border-left-color: #dc2626 !important; }
.dashboard-summary-danger strong { color: #b91c1c; }
.dashboard-summary-success { border-left-color: #16a34a !important; }
.dashboard-summary-success strong { color: #15803d; }
.active-filter {
    margin: -8px 0 18px;
    color: #52636a;
}
.active-filter a {
    margin-left: 8px;
    color: #9a6b22;
    font-weight: 700;
}
.dashboard-alert-panel {
    margin: 0 0 24px;
    padding: 18px 20px;
    border: 1px solid #f3d19c;
    border-radius: 10px;
    background: #fffaf0;
}
.dashboard-alert-panel h2 { margin-top: 0; }
.dashboard-alert-panel li { margin: 7px 0; }
.form-success { color: #166534; font-weight: 600; }
.form-error { color: #b91c1c; font-weight: 600; }

@media (max-width: 700px) {
    .dashboard-summary-grid { grid-template-columns: 1fr; }
    .dashboard-summary-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.dashboard-eyebrow {
    margin: 0 0 8px;
    color: #FFD700;
    font-size: 0.76em;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.dashboard-heading h1 {
    margin: 0;
    color: #f5f5f5;
    font-size: 2em;
}

.dashboard-subtitle {
    margin: 8px 0 0;
    color: #bbb;
}

.dashboard-account {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.role-label {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    color: #f5f5f5;
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 700;
}

.dashboard-logout {
    color: #ddd;
    font-size: 0.9em;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-logout:hover {
    color: #FFD700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    margin-bottom: 34px;
}

.dashboard-module {
    min-width: 0;
    padding: 20px;
    background: #222;
    border: 1px solid #444;
    border-top: 3px solid #777;
    border-radius: 4px;
}

.dashboard-module:nth-child(3n + 2) {
    border-top-color: #FFD700;
}

.dashboard-module:nth-child(3n) {
    border-top-color: #78aeb1;
}

.dashboard-module-admin {
    grid-column: 1 / -1;
}

.dashboard-module-admin .dashboard-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-module-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-height: 76px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #444;
}

.module-index {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #111;
    background: #FFD700;
    border-radius: 3px;
    font-size: 0.78em;
    font-weight: 800;
}

.dashboard-module-heading h2 {
    margin: 0;
    color: #f5f5f5;
    font-size: 1.15em;
}

.dashboard-module-heading p {
    margin: 5px 0 0;
    color: #aaa;
    font-size: 0.86em;
    line-height: 1.4;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

.manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 18px;
}

.manage-actions .dashboard-action {
    width: auto;
    min-width: 190px;
}

.dashboard-action {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    width: 100%;
    padding: 10px 13px;
    color: #f3f3f3;
    background: #303030;
    border: 1px solid #4a4a4a;
    border-radius: 3px;
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.dashboard-action span {
    display: inline-flex;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: #FFD700;
    border: 1px solid #655a20;
    border-radius: 3px;
    font-size: 1.1em;
}

.dashboard-action:hover {
    color: #fff;
    background: #3a3a3a;
    border-color: #FFD700;
}

.dashboard-action:focus-visible,
.dashboard-logout:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        margin: 16px 0 20px;
        padding: 18px 16px;
    }

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

    .log-tabs a {
        justify-content: center;
        padding: 8px 6px;
        text-align: center;
    }

    .log-pagination {
        gap: 8px;
    }

    .dashboard-heading h1 {
        font-size: 1.55em;
        overflow-wrap: anywhere;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .dashboard-module {
        padding: 16px;
    }

    .dashboard-module-admin {
        grid-column: auto;
    }

    .dashboard-module-admin .dashboard-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-module-heading {
        min-height: 0;
    }

    .dashboard-action {
        min-height: 50px;
        font-size: 0.95em;
    }

    .detail-section {
        margin: 16px 0;
    }

    .detail-section h3 {
        padding: 12px;
    }

    .detail-item {
        grid-template-columns: minmax(112px, 40%) minmax(0, 1fr);
    }

    .detail-item dt,
    .detail-item dd {
        padding: 10px 9px;
    }

    .detail-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-actions .btn {
        width: 100%;
        margin: 0;
    }

    .detail-actions form,
    .detail-actions form .btn {
        width: 100%;
    }
}

table {
    border-collapse: collapse;
    width: 100%;
    background-color: #222;
    color: #FFD700;
    border: 1px solid #444;
    margin: 15px 0;
    min-width: 600px;
}

table th {
    background-color: #333;
    color: #FFD700;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #444;
}

table td {
    padding: 10px 12px;
    border: 1px solid #444;
}

table tr:hover {
    background-color: #2a2a2a;
}

/* ============================================
   ACTION LINKS & COLUMNS
   ============================================ */
td.action-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    text-align: center;
}

/* Generic link styles to ensure visibility */
a {
    color: #FFD700;
    transition: color 0.3s;
}

a:hover {
    color: #FFC107;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 10px;
    margin: 0;
    background-color: #FFD700;
    color: #111;
    font-weight: 600;
    font-size: 0.85em;
    border: 1px solid #FFD700;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    white-space: nowrap;
    line-height: 1.2;
    font-family: inherit;
    vertical-align: middle;
}

.btn:hover {
    background-color: #FFC107;
    color: #000;
    box-shadow: 0 0 6px #FFD700;
}

.btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.btn-danger {
    background-color: #C0392B;
    border-color: #C0392B;
    color: #fff;
}

.btn-danger:hover {
    background-color: #E74C3C;
    border-color: #E74C3C;
    color: #fff;
}

.btn-danger:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.8em;
}

/* In-site user guide */
.documentation-page {
    max-width: 1180px;
}

.documentation-hero {
    padding: 26px 28px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #285b62);
    border-radius: 7px;
    box-shadow: 0 5px 18px rgba(23, 53, 58, 0.12);
}

.documentation-hero h1 {
    margin: 4px 0 8px;
    color: #fff;
}

.documentation-hero p:not(.dashboard-eyebrow) {
    max-width: 760px;
    margin: 0;
    color: #e8f1ef;
}

.documentation-contents {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.documentation-contents a {
    padding: 7px 10px;
    color: #17353a;
    background: var(--amber);
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.documentation-section {
    margin: 24px 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.documentation-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.documentation-section-heading h2 {
    margin: 0;
    color: var(--brand);
    font-size: 1.18rem;
}

.documentation-section-heading .module-index {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    color: #17353a;
    background: var(--amber);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
}

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

.documentation-card {
    padding: 15px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-top: 3px solid var(--teal);
    border-radius: 5px;
}

.documentation-card h3,
.documentation-prose h3 {
    margin: 0 0 7px;
    color: var(--brand);
    font-size: 0.98rem;
}

.documentation-card p,
.documentation-prose p {
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.55;
}

.documentation-prose {
    color: var(--ink-muted);
}

.documentation-prose h3:not(:first-child) {
    margin-top: 20px;
}

.documentation-prose ol,
.documentation-prose ul {
    margin: 8px 0 0;
    padding-left: 22px;
    line-height: 1.7;
}

.documentation-prose code {
    padding: 2px 5px;
    color: var(--brand);
    background: var(--surface-tint);
    border-radius: 3px;
    font-family: Consolas, monospace;
    font-size: 0.9em;
}

.documentation-table-wrapper {
    margin: 0;
}

.documentation-table-wrapper table {
    min-width: 720px;
    margin: 0;
}

.version-history {
    display: grid;
    gap: 14px;
}

.version-entry {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
}

.version-label {
    color: var(--teal);
    font-weight: 800;
}

.version-entry h3 {
    margin: 0 0 6px;
    color: var(--brand);
    font-size: 1rem;
}

.version-entry ul {
    margin: 0;
    padding-left: 20px;
    color: var(--ink-muted);
    line-height: 1.55;
}

.documentation-note {
    margin: 16px 0 0;
    color: var(--ink-muted);
    font-size: 0.88rem;
    font-style: italic;
}

.documentation-footer-link {
    margin: 24px 0;
    text-align: center;
}

.certificate-view-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.certificate-view-heading h1 {
    margin: 4px 0 8px;
    color: var(--brand);
}

.certificate-view-heading p:not(.dashboard-eyebrow) {
    margin: 0;
    color: var(--ink-muted);
}

.certificate-viewer {
    max-width: 920px;
    margin: 0 auto 28px;
    padding: 48px 56px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 5px 18px rgba(23, 53, 58, 0.08);
}

.certificate-viewer p {
    min-height: 1em;
    margin: 0 0 10px;
    color: #202b2d;
    line-height: 1.5;
}

.certificate-viewer table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}

.certificate-viewer td,
.certificate-viewer th {
    padding: 7px 9px;
    border: 1px solid #aebdb9;
    color: #202b2d;
    vertical-align: top;
}

.certificate-viewer td p,
.certificate-viewer th p {
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .documentation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .documentation-hero,
    .documentation-section {
        padding: 16px;
    }

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

    .version-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .certificate-view-heading {
        display: block;
    }

    .certificate-view-heading .btn {
        display: inline-block;
        margin-top: 14px;
    }

    .certificate-viewer {
        padding: 24px 18px;
    }
}

/* Product management layout */
.product-management-page .entry-section {
    padding: 18px 20px;
}

.product-management-page .entry-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.product-management-page .form-field {
    grid-column: span 2;
}

.product-management-page .form-field-wide {
    grid-column: 1 / -1;
}

.product-management-page .form-field input,
.product-management-page .form-field select,
.product-management-page .form-field textarea {
    min-height: 38px;
    padding: 8px 10px;
}

.product-management-page .form-field textarea {
    min-height: 88px;
}

.product-management-page .entry-actions {
    justify-content: flex-start;
}

.product-management-page .entry-actions .btn {
    min-width: 0;
    min-height: 36px;
    padding: 8px 16px;
}

.product-management-page .table-wrapper {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.product-management-page table {
    min-width: 980px;
    margin: 0;
    table-layout: auto;
}

.product-management-page table th,
.product-management-page table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.product-management-page table th:first-child,
.product-management-page table td:first-child {
    width: 56px;
    text-align: center;
}

.product-management-page table th:nth-child(3),
.product-management-page table td:nth-child(3),
.product-management-page table th:nth-child(4),
.product-management-page table td:nth-child(4) {
    white-space: nowrap;
}

.product-management-page table td:nth-child(6) {
    max-width: 220px;
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

.product-management-page td.action-links {
    width: 150px;
    justify-content: flex-start;
    white-space: nowrap;
}

.product-management-page td.action-links .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .product-management-page .entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-management-page .form-field {
        grid-column: span 1;
    }

    .product-management-page .form-field-wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .product-management-page .entry-section {
        padding: 14px;
    }

    .product-management-page .entry-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-management-page .form-field,
    .product-management-page .form-field-wide {
        grid-column: 1;
    }
}

/* Category field editor */
.category-management-page .dynamic-fields-editor {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-soft);
}

.category-template-dropzone {
    display: grid;
    gap: 6px;
    padding: 20px;
    color: var(--ink-muted);
    background: var(--surface-soft);
    border: 2px dashed var(--teal);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.category-template-dropzone:hover,
.category-template-dropzone.is-dragging,
.category-template-dropzone:focus-within {
    background: var(--surface-tint);
    border-color: var(--amber);
}

.category-template-dropzone strong {
    color: var(--brand);
}

.category-template-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.category-template-file-name {
    color: var(--brand);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.template-upload-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.template-upload-messages {
    margin-top: 6px;
    color: var(--ink-muted);
    font-size: 0.86rem;
}

.template-preview-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 29, 32, 0.72);
}

.template-preview-modal[hidden] {
    display: none;
}

.template-preview-dialog {
    display: flex;
    width: min(100%, 980px);
    max-height: 92vh;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.template-preview-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface-tint);
    border-bottom: 1px solid var(--line);
}

.template-preview-dialog-header h3 {
    margin: 0;
}

.template-preview-messages {
    padding: 0 18px;
}

.template-preview-content {
    max-width: none;
    margin: 0;
    overflow: auto;
    box-shadow: none;
}

.category-management-page .entry-grid > .form-field > input,
.category-management-page .entry-grid > .form-field > select {
    min-height: 40px;
}

.category-management-page .entry-grid > .form-field > input[type="file"] {
    padding: 8px 10px;
}

.category-management-page .dynamic-fields-header,
.category-management-page .dynamic-field-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.15fr) minmax(180px, 1.45fr) minmax(120px, 0.9fr) minmax(110px, 0.8fr) 92px;
    gap: 10px;
    align-items: center;
    min-width: 760px;
    padding: 8px 10px;
}

.category-management-page .dynamic-fields-header {
    color: var(--ink-muted);
    background: var(--surface-tint);
    border-bottom: 1px solid var(--line);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.category-management-page .dynamic-field-row {
    border-bottom: 1px solid var(--line);
}

.category-management-page .dynamic-field-row:last-child {
    border-bottom: 0;
}

.category-management-page .dynamic-field-row input,
.category-management-page .dynamic-field-row select {
    width: 100%;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 7px 9px;
    font-size: 0.86rem;
}

.category-management-page .dynamic-field-row .btn-compact,
.category-management-page .dynamic-fields-footer .btn-compact {
    width: auto;
    min-width: 0;
    height: 32px;
    min-height: 32px;
    margin: 0;
    padding: 5px 9px;
    font-size: 0.76rem;
    line-height: 1;
}

.category-management-page .dynamic-fields-footer {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 10px;
    background: var(--surface);
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert-success {
    padding: 20px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

.alert-warning {
    padding: 20px;
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

.alert-error {
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
}

.message {
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-weight: bold;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: #FFD700;
    color: #111;
    padding: 15px;
    text-align: center;
    margin-top: 30px;
}

.footer a {
    color: #111;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: #333;
}

/* ============================================
   RESPONSIVE DESIGN - TABLET & MOBILE
   ============================================ */

/* Tablet screens (768px and below) */
@media (max-width: 768px) {
    body {
        font-size: 0.95em;
    }

    .container {
        padding: 0 10px;
        margin: 15px auto;
    }

    h1, h2 {
        font-size: 1.5em;
        margin: 10px 0;
    }

    h3 {
        font-size: 1.2em;
        margin: 8px 0;
    }

    /* Forms on tablet */
    form {
        gap: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 8px;
    }

    /* Buttons on tablet */
    .btn {
        font-size: 0.85em;
    }

    /* Tables on tablet - ensure scrolling */
    .table-wrapper {
        margin: 10px 0;
        border: 1px solid #444;
        border-radius: 4px;
    }

    table {
        font-size: 0.9em;
        min-width: 700px;
    }

    table th {
        padding: 10px 8px;
    }

    table td {
        padding: 8px 6px;
    }

    /* Footer on tablet */
    .footer {
        padding: 12px;
        font-size: 0.9em;
    }

    .footer p {
        margin: 5px 0;
    }
}

/* Mobile screens (480px and below) */
@media (max-width: 480px) {
    body {
        font-size: 0.9em;
    }

    .container {
        padding: 0 8px;
        margin: 10px auto;
    }

    h1 {
        font-size: 1.3em;
        margin: 8px 0;
    }

    h2 {
        font-size: 1.2em;
        margin: 8px 0;
    }

    h3 {
        font-size: 1em;
        margin: 6px 0;
    }

    /* Forms on mobile */
    form {
        gap: 8px;
    }

    label {
        font-size: 0.9em;
        margin-bottom: 3px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 10px;
        width: 100%;
    }

    /* Buttons stack on mobile */
    .btn {
        font-size: 0.8em;
        width: 100%;
        justify-content: center;
    }

    /* Tables with improved mobile scrolling */
    .table-wrapper {
        margin: 10px 0;
        border: 1px solid #444;
        border-radius: 0;
        padding: 0;
        overflow-x: auto;
    }

    .table-wrapper.stacked-wrapper {
        overflow-x: hidden;
    }

    .stacked-table,
    .stacked-table tbody {
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .stacked-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .stacked-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 10px 0;
        background-color: #222;
        border: 1px solid #444;
        border-radius: 4px;
        overflow: hidden;
    }

    .stacked-table tbody tr:hover {
        background-color: #222;
    }

    .stacked-table td {
        display: block;
        min-width: 0;
        padding: 9px 10px;
        border: 0;
        border-bottom: 1px solid #444;
        font-size: 0.9em;
        overflow-wrap: anywhere;
    }

    .stacked-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: #ccc;
        font-size: 0.75em;
        font-weight: bold;
    }

    .stacked-table td:nth-child(odd) {
        border-right: 1px solid #444;
    }

    .stacked-table td.action-links {
        grid-column: 1 / -1;
        border-right: 0;
        border-bottom: 0;
        text-align: left;
    }

    .stacked-table td.action-links a {
        width: 100%;
    }

    table {
        font-size: 0.8em;
        min-width: 500px;
    }

    table th {
        padding: 8px 4px;
        font-size: 0.85em;
    }

    table td {
        padding: 6px 4px;
        font-size: 0.85em;
    }

    /* Compact action links */
    td.action-links {
        white-space: normal;
    }

    /* Link spacing on mobile */
    a.gold-link {
        display: inline-block;
        margin: 3px 3px 3px 0;
    }

    /* Footer on mobile */
    .footer {
        padding: 10px 8px;
        font-size: 0.85em;
    }

    .footer p {
        margin: 3px 0;
        line-height: 1.4;
    }

    /* Alerts on mobile */
    .alert-success,
    .alert-warning,
    .alert-error {
        padding: 15px 10px;
        margin: 10px -8px;
        border-radius: 0;
        font-size: 0.9em;
    }

    /* Spacing utilities for mobile */
    .mt-20,
    .mt-30 {
        margin-top: 10px !important;
    }

    .mb-20,
    .mb-15 {
        margin-bottom: 10px !important;
    }
}

/* Extra small screens (320px and below) */
@media (max-width: 320px) {
    .container {
        padding: 0 5px;
    }

    h2 {
        font-size: 1.1em;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
        padding: 12px 8px;
    }

    table {
        min-width: 300px;
        font-size: 0.75em;
    }

    table th,
    table td {
        padding: 4px 2px;
    }

}

.pagination {
    margin-top: 15px;
    text-align: center;
}

.pagination a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid #555;
    border-radius: 3px;
    color: #FFD700;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
}

.pagination a:hover {
    color: #111;
    background: #FFD700;
    border-color: #FFD700;
}

.pagination a.active {
    color: #111;
    background: #FFD700;
    border-color: #FFD700;
}

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

.log-filter-actions .gold-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.log-page-size {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.log-page-size label {
    margin: 0;
}

.log-page-size select {
    min-width: 100px;
}

.form-note {
    margin: -8px 0 4px;
    color: #aaa;
    font-size: 0.9em;
}

.shipment-editor {
    width: 100%;
    margin: 12px 0;
}

.shipment-editor-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.shipment-editor-heading h3 {
    margin: 0;
}

.shipment-editor-heading p,
.shipment-empty {
    margin: 6px 0 0;
    color: #aaa;
}

.shipment-batch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    min-width: 0;
    margin: 12px 0;
    padding: 16px;
    border: 1px solid #555;
    border-radius: 4px;
}

.shipment-batch legend {
    padding: 0 8px;
    color: #FFD700;
    font-weight: 700;
}

.shipment-batch label,
.shipment-batch input,
.shipment-batch .remove-shipment {
    grid-column: 1 / -1;
}

.shipment-batch .remove-shipment {
    justify-self: start;
}

.shipment-empty {
    padding: 14px 16px;
}

.shipment-details .table-wrapper {
    margin: 0;
}

.shipment-details table {
    margin: 0;
}

.document-section-heading {
    width: 100%;
}

.document-section-heading h3 {
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    background-color: #333;
    border-left: 4px solid #FFD700;
    border-bottom: 1px solid #444;
}

.document-section-heading p {
    margin: 0;
    padding: 12px 16px 0;
    color: #aaa;
}

.document-upload-form {
    display: grid;
    gap: 8px;
    margin: 16px 16px 20px;
}

.document-dropzone {
    display: grid;
    gap: 6px;
    padding: 24px;
    border: 2px dashed #777;
    border-radius: 4px;
    color: #ccc;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.document-dropzone:hover,
.document-dropzone.is-dragging {
    border-color: #FFD700;
    background-color: #292500;
}

.document-dropzone strong {
    color: #FFD700;
}

.document-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.document-file-list {
    color: #aaa;
    overflow-wrap: anywhere;
}

.document-table-wrapper {
    margin: 0 16px 16px;
}

.document-table {
    min-width: 0;
}

.document-upload-form #document_type {
    width: min(100%, 280px);
}

.document-actions {
    gap: 6px;
}

.email-compose-page > .detail-section {
    max-width: 900px;
}

.email-compose-form {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.email-recipient-list {
    display: grid;
    gap: 8px;
    margin: 0 0 6px;
    padding: 14px;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
}

.email-recipient-list legend {
    padding: 0 6px;
    color: #FFD700;
    font-weight: 700;
}

.email-recipient {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 10px;
    color: #eee;
    background: #292929;
    border: 1px solid #444;
    border-radius: 3px;
    font-weight: 400;
}

.email-recipient input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #FFD700;
}

.email-recipient span,
.email-recipient small {
    display: block;
    min-width: 0;
}

.email-recipient small {
    margin-top: 3px;
    color: #aaa;
    overflow-wrap: anywhere;
}

.email-compose-form textarea {
    min-height: 140px;
}

.email-summary-preview {
    overflow: hidden;
    border: 1px solid #444;
    border-radius: 4px;
}

.email-summary-preview h4 {
    margin: 0;
    padding: 11px 14px;
    color: #eee;
    background: #333;
    border-bottom: 1px solid #444;
}

.email-summary-preview .detail-item {
    grid-template-columns: minmax(160px, 30%) minmax(0, 1fr);
}

.email-summary-preview .detail-item dt,
.email-summary-preview .detail-item dd {
    padding: 9px 12px;
}

.email-no-reply-note {
    margin: 0;
    color: #aaa;
    font-size: 0.9em;
}

.email-compose-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.email-compose-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 480px) {
    .email-compose-form {
        padding: 12px;
    }

    .email-summary-preview .detail-item {
        grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
    }

    .email-compose-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
}


/* Chrome, Edge, Safari */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(74%) sepia(95%) saturate(748%) hue-rotate(360deg) brightness(100%) contrast(100%);
    cursor: pointer;
}

/* Firefox */
input[type="date"]::-moz-calendar-picker-indicator {
    filter: invert(74%) sepia(95%) saturate(748%) hue-rotate(360deg) brightness(100%) contrast(100%);
    cursor: pointer;
}

@media (min-width: 481px) and (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-module-admin .dashboard-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Shared customer and operations portal theme */
:root {
    color-scheme: light;
    --page-bg: #f2f5f3;
    --surface: #ffffff;
    --surface-soft: #f7f9f7;
    --surface-tint: #edf3f1;
    --ink: #1b2a2d;
    --ink-muted: #5c6b6d;
    --line: #d9e1de;
    --brand: #17353a;
    --brand-hover: #234a4f;
    --amber: #e8a832;
    --amber-deep: #946000;
    --teal: #28747a;
}

body {
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--ink);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

.container {
    max-width: 1280px;
    margin-top: 28px;
    margin-bottom: 36px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--brand);
    line-height: 1.25;
}

h2 {
    font-size: 1.65rem;
    font-weight: 800;
}

h3 {
    font-size: 1.15rem;
    font-weight: 750;
}

a {
    color: var(--amber-deep);
}

a:hover {
    color: var(--brand-hover);
}

.gold-link {
    color: var(--amber-deep);
    text-shadow: none;
}

.gold-link:hover {
    color: var(--brand-hover);
    text-shadow: none;
}

.site-header {
    position: relative;
    z-index: 20;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px max(24px, calc((100vw - 1280px) / 2));
    background: var(--brand);
    border-bottom: 3px solid var(--amber);
    box-shadow: 0 3px 14px rgba(23, 53, 58, 0.12);
}

.site-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
}

.site-brand:hover {
    color: #fff;
}

.site-brand-mark {
    display: block;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    object-fit: contain;
    padding: 4px;
    background: #fff;
    border-radius: 4px;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.site-nav a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 8px 12px;
    color: #e5edeb;
    border-radius: 4px;
    font-size: 0.87rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.site-nav a:last-child {
    margin-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding-left: 18px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    font-size: 1.3rem;
    cursor: pointer;
}

.menu-toggle:focus-visible,
.site-nav a:focus-visible,
.site-brand:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

.footer {
    margin-top: 44px;
    padding: 22px 16px;
    color: #d7e2df;
    background: var(--brand);
    border-top: 3px solid var(--amber);
    text-align: center;
}

.footer p {
    margin: 5px 0;
}

.footer a,
.footer .gold-link {
    color: #f3c56c;
    text-shadow: none;
}

.footer a:hover,
.footer .gold-link:hover {
    color: #fff;
}

form {
    color: var(--ink);
}

label,
.shipment-batch legend,
.email-recipient-list legend {
    color: var(--brand);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #bccac5;
    border-radius: 4px;
}

input::placeholder,
textarea::placeholder {
    color: #778583;
    opacity: 1;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(40, 116, 122, 0.14);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--teal);
}

.btn {
    min-height: 40px;
    padding: 8px 14px;
    color: #1a2a2d;
    background: var(--amber);
    border: 1px solid var(--amber);
    border-radius: 4px;
    box-shadow: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
}

.btn:hover {
    color: #142629;
    background: #f0bd59;
    border-color: #f0bd59;
    box-shadow: 0 2px 8px rgba(148, 96, 0, 0.18);
}

.btn:focus-visible {
    outline: 3px solid rgba(40, 116, 122, 0.35);
    outline-offset: 2px;
}

.btn-secondary {
    color: var(--brand);
    background: #fff;
    border-color: #b7c8c3;
}

.btn-secondary:hover {
    color: var(--brand);
    background: var(--surface-tint);
    border-color: var(--teal);
}

.btn-danger {
    color: #fff;
    background: #a93e35;
    border-color: #a93e35;
}

.btn-danger:hover {
    color: #fff;
    background: #8d3029;
    border-color: #8d3029;
}

.table-wrapper {
    border-radius: 5px;
}

table {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

table th {
    color: #fff;
    background: var(--brand);
    border-color: #315258;
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

table td {
    border-color: var(--line);
}

table tbody tr:nth-child(even) {
    background: #f7f9f8;
}

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

.stacked-table tbody tr:hover {
    background: #fff8e8;
}

.detail-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 3px 12px rgba(23, 53, 58, 0.04);
}

.detail-section h3,
.document-section-heading h3 {
    color: var(--brand);
    background: var(--surface-tint);
    border-left-color: var(--amber);
    border-bottom-color: var(--line);
}

.detail-item {
    border-bottom-color: var(--line);
}

.detail-item:nth-child(even) {
    background: var(--surface-soft);
}

.detail-item dt {
    color: var(--ink-muted);
    background: #f3f6f5;
    border-right-color: var(--line);
}

.detail-item dd {
    color: var(--ink);
}

.dashboard-heading {
    background: var(--brand);
    border-color: #315258;
    border-left-color: var(--amber);
    border-radius: 5px;
    box-shadow: 0 5px 18px rgba(23, 53, 58, 0.1);
}

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

.dashboard-eyebrow {
    color: #f3c56c;
    letter-spacing: 0.08em;
}

.dashboard-heading h1 {
    color: #fff;
}

.dashboard-subtitle {
    color: #d0dcda;
}

.role-label {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
}

.dashboard-logout {
    color: #f3c56c;
}

.dashboard-logout:hover {
    color: #fff;
}

.dashboard-module {
    background: var(--surface);
    border-color: var(--line);
    border-top-color: #83a9a4;
    border-radius: 5px;
    box-shadow: 0 3px 12px rgba(23, 53, 58, 0.045);
}

.dashboard-module:nth-child(3n + 2) {
    border-top-color: var(--amber);
}

.dashboard-module:nth-child(3n) {
    border-top-color: var(--teal);
}

.dashboard-module-heading {
    border-bottom-color: var(--line);
}

.module-index {
    color: #fff;
    background: var(--teal);
    border-radius: 4px;
}

.dashboard-module:nth-child(3n + 2) .module-index {
    color: #1b2a2d;
    background: var(--amber);
}

.dashboard-module-heading h2 {
    color: var(--brand);
}

.dashboard-module-heading p {
    color: var(--ink-muted);
}

.dashboard-action {
    color: var(--brand);
    background: var(--surface-soft);
    border-color: var(--line);
    border-radius: 4px;
}

.dashboard-action span {
    color: var(--teal);
    background: #e5f0ed;
    border-color: #c2d8d2;
    border-radius: 4px;
}

.dashboard-action:hover {
    color: var(--brand);
    background: #fff8e8;
    border-color: var(--amber);
}

.dashboard-action:focus-visible,
.dashboard-logout:focus-visible {
    outline-color: var(--amber);
}

.pagination a {
    color: var(--brand);
    background: var(--surface);
    border-color: #c4d0cc;
    border-radius: 4px;
    text-decoration: none;
}

.pagination a:hover,
.pagination a.active {
    color: #1b2a2d;
    background: #f3c56c;
    border-color: var(--amber);
}

.page-info,
.form-note,
.document-section-heading p,
.shipment-empty,
.email-no-reply-note {
    color: var(--ink-muted);
}

.shipment-batch,
.email-recipient-list {
    background: var(--surface-soft);
    border-color: var(--line);
    border-radius: 5px;
}

.email-recipient {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

.email-recipient small,
.email-recipient-list legend,
.email-summary-preview h4 {
    color: var(--ink-muted);
}

.email-summary-preview {
    border-color: var(--line);
}

.email-summary-preview h4 {
    background: var(--surface-tint);
    border-bottom-color: var(--line);
}

.document-dropzone {
    color: var(--ink-muted);
    background: var(--surface-soft);
    border-color: #a7bbb5;
}

.document-dropzone:hover,
.document-dropzone.is-dragging {
    background: #fff8e8;
    border-color: var(--amber-deep);
}

.document-dropzone strong {
    color: var(--brand);
}

.document-file-list {
    color: var(--ink-muted);
}

.status-badge {
    display: inline-flex;
    max-width: 100%;
    min-height: 26px;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.77rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.status-dispatched {
    color: #17613b;
    background: #e3f3e9;
    border-color: #b7dfc5;
}

.status-cancelled {
    color: #8e302a;
    background: #fae9e7;
    border-color: #e9c2be;
}

.status-active {
    color: #155c65;
    background: #e2f1f2;
    border-color: #b7d9dc;
}

.status-pending,
.status-hold {
    color: #78500b;
    background: #fff3d9;
    border-color: #ecd69f;
}

.status-neutral {
    color: var(--ink-muted);
    background: #edf1ef;
    border-color: #d5ddda;
}

.public-home {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    align-items: center;
    gap: 48px;
    min-height: min(620px, calc(100vh - 160px));
    padding-top: 48px;
    padding-bottom: 48px;
}

.public-home-copy {
    max-width: 740px;
}

.public-home-eyebrow {
    margin: 0 0 16px;
    color: var(--amber-deep);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.public-home h1 {
    max-width: 700px;
    margin: 0;
    color: var(--brand);
    font-size: 3.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.public-home-copy > p:not(.public-home-eyebrow) {
    max-width: 620px;
    margin: 20px 0 0;
    color: var(--ink-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.public-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.public-home-brand {
    display: grid;
    justify-items: center;
    gap: 20px;
    padding: 30px 20px;
    border-left: 1px solid var(--line);
    text-align: center;
}

.public-home-brand img {
    display: block;
    width: min(100%, 280px);
    max-height: 200px;
    object-fit: contain;
}

.public-home-brand div {
    display: grid;
    gap: 4px;
}

.public-home-brand span {
    color: var(--ink-muted);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.public-home-brand strong {
    color: var(--brand);
    font-size: 1rem;
}

.auth-container {
    max-width: 520px;
    margin-top: 52px;
    margin-bottom: 56px;
}

.auth-container h2 {
    margin-bottom: 20px;
}

.auth-container form {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 6px 24px rgba(23, 53, 58, 0.06);
}

.auth-container .text-center {
    color: var(--ink-muted);
}

.auth-container .alert-success,
.auth-container .alert-error {
    text-align: left;
}

.log-tabs {
    border-bottom-color: var(--line);
}

.log-tabs a {
    color: var(--ink-muted);
}

.log-tabs a:hover,
.log-tabs a.active {
    color: var(--brand);
    border-bottom-color: var(--amber);
}

.log-pagination,
.log-pagination a {
    color: var(--ink-muted);
}

.log-pagination a:hover {
    color: var(--brand);
    background: #f3c56c;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
}

.view-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: end;
    gap: 10px;
}

.view-filter-form > input:not([type="hidden"]),
.view-filter-form > select,
.view-filter-date input {
    width: 100%;
    min-width: 0;
}

.filter-suggest {
    position: relative;
    min-width: 0;
}

.view-filter-form datalist {
    display: none;
}

.filter-suggest > input {
    width: 100%;
}

.filter-suggest-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid #c8d5d9;
    border-radius: 6px;
    box-shadow: 0 8px 18px rgba(23, 53, 58, .16);
}

.filter-suggest-menu[hidden] {
    display: none;
}

.filter-suggest-option {
    display: block;
    width: 100%;
    padding: 9px 10px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 4px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.filter-suggest-option:hover,
.filter-suggest-option:focus-visible {
    color: var(--brand);
    background: #eef4f3;
    outline: none;
}

.view-filter-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.view-filter-date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    grid-column: span 2;
    min-width: 0;
}

.view-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
    margin-top: 2px;
}

.view-filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    grid-column: 1 / -1;
    min-width: 0;
    padding-top: 4px;
}

.view-filter-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    width: auto;
}

.view-filter-form .view-filter-actions .btn-secondary {
    margin-left: 2px;
}

.log-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ink-muted);
    white-space: nowrap;
}

.log-page-size select {
    width: auto;
    min-width: 76px;
}

@media (max-width: 640px) {
    .view-filter-date-range {
        grid-column: 1 / -1;
    }

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

    .view-filter-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .view-filter-toolbar .view-filter-actions {
        width: 100%;
    }
}

.entry-form {
    gap: 20px;
    margin: 18px 0 24px;
    color: var(--ink);
}

.entry-section {
    width: 100%;
    min-width: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 2px solid #83a9a4;
    border-radius: 5px;
    box-shadow: 0 3px 12px rgba(23, 53, 58, 0.045);
}

.entry-section:nth-of-type(3n + 2) {
    border-top-color: var(--amber);
}

.entry-section:nth-of-type(3n) {
    border-top-color: var(--teal);
}

.entry-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.entry-section-heading h3 {
    margin: 0;
    color: var(--brand);
    font-size: 1rem;
}

.entry-section-heading .module-index {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-width: 0;
}

.form-value {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 10px;
    color: var(--ink-muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.field-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    margin: 0;
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 700;
}

.field-info {
    position: static;
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--teal);
    border-radius: 50%;
    color: var(--teal);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    cursor: help;
}

.field-info::after {
    position: absolute;
    z-index: 10;
    top: calc(100% + 7px);
    left: 50%;
    width: max-content;
    max-width: min(260px, calc(100vw - 36px));
    padding: 8px 10px;
    border-radius: 4px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(23, 53, 58, 0.18);
    content: attr(data-tooltip);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    visibility: hidden;
}

.field-info:hover::after,
.field-info:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.field-info:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.entry-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.entry-actions .btn {
    width: auto;
    min-width: 150px;
    margin: 0;
}

@media (min-width: 481px) and (max-width: 900px) {
    .entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .manage-actions .dashboard-action {
        width: 100%;
    }

    .view-filter-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .entry-form {
        gap: 16px;
    }

    .entry-section {
        padding: 12px;
    }

    .entry-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .shipment-batch {
        grid-template-columns: minmax(0, 1fr);
    }

    .entry-actions .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .site-header {
        min-height: 64px;
        padding: 8px 14px;
    }

    .site-brand {
        font-size: 1.05rem;
    }

    .site-brand-mark {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: calc(100% + 3px);
        right: 12px;
        left: 12px;
        max-height: calc(100vh - 84px);
        align-items: stretch;
        flex-direction: column;
        gap: 2px;
        overflow-y: auto;
        padding: 8px;
        background: var(--brand);
        border: 1px solid #315258;
        border-radius: 4px;
        box-shadow: 0 12px 24px rgba(16, 38, 41, 0.2);
    }

    .site-nav.show {
        display: flex;
    }

    .site-nav a {
        width: 100%;
        min-height: 46px;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .site-nav a:last-child {
        margin-left: 0;
        border-left: 0;
        padding-left: 12px;
    }

    .dashboard-grid-customer {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-home {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        min-height: auto;
        padding-top: 40px;
        padding-bottom: 36px;
    }

    .public-home-brand {
        grid-template-columns: 100px minmax(0, 1fr);
        justify-items: start;
        align-items: center;
        gap: 16px;
        padding: 20px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
        text-align: left;
    }

    .public-home-brand img {
        width: 100px;
        max-height: 88px;
    }
}

@media (max-width: 480px) {
    .container {
        margin-top: 18px;
        margin-bottom: 24px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .public-home {
        gap: 24px;
        padding-top: 26px;
    }

    .public-home h1 {
        font-size: 2.2rem;
    }

    .public-home-copy > p:not(.public-home-eyebrow) {
        font-size: 1rem;
    }

    .public-home-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .public-home-actions .btn {
        width: 100%;
    }

    .public-home-brand {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .public-home-brand img {
        width: 76px;
        max-height: 70px;
    }

    .auth-container {
        margin-top: 28px;
    }

    .auth-container form {
        padding: 18px;
    }

    .footer {
        margin-top: 30px;
    }
}