/* ================================================
   WebOrder SaaS - Design System
   Rich Gold Sidebar + Bold Dark Navy Accents
   ================================================ */

/* --- Variables --- */
:root {
    --gold: #BDA631;
    --gold-hover: #A89228;
    --navy: #082C4E;
    --bg: #F0F1F5;
    --white: #FFFFFF;
    --card-bg: #FFFFFF;
    --text: #1A202C;
    --text-muted: #718096;
    --border: #E2E8F0;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --radius: 4px;
    --radius-sm: 4px;
    --radius-lg: 4px;
    --shadow: none;
    --shadow-md: none;
    --shadow-lg: none;
    --transition: all 0.1s linear;
}

/* --- Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================================================
   LAYOUT
   ================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 230px;
    background: #B6A132;
    /* More accurate mustard from Image 2 */
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: none;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-brand {
    padding: 20px 24px 10px;
    text-align: left;
}

.brand-logo-img {
    max-width: 100px;
    margin-bottom: 12px;
    display: block;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.brand-role {
    font-size: 11px;
    color: var(--white);
    font-weight: 600;
    padding: 0 24px;
    margin-bottom: 20px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    /* Add horizontal padding for the pill effect */
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    gap: 12px;
    margin: 2px 0;
    border-radius: 6px;
    text-decoration: none;
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.7;
    /* Thinner look from Image 2 */
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: var(--navy);
    color: var(--white);
    box-shadow: none;
}

.nav-link.active i {
    opacity: 1;
}

.nav-link.sub {
    padding: 6px 14px 6px 44px;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    margin: 0;
}

.nav-link.sub:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-section-label {
    padding: 12px 14px 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
    color: var(--white);
    margin-top: 8px;
}

.nav-section-toggle {
    width: 100%;
    border: none;
    background: transparent;
    padding-bottom: 8px;
}

.nav-section-toggle .chevron {
    transition: transform 0.15s linear;
}

.nav-section-toggle.expanded .chevron {
    transform: rotate(180deg);
}

.settings-submenu {
    display: none;
}

.settings-submenu.open {
    display: block;
}

.nav-section-label i:first-child {
    font-size: 15px;
    width: 18px;
    text-align: center;
    opacity: 0.7;
}

.nav-section-label .chevron {
    font-size: 9px;
    opacity: 0.6;
}

/* --- Main Area --- */
.main-area {
    margin-left: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #F4F6F8;
}

/* --- Topbar --- */
.topbar {
    height: 64px;
    background: var(--white);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-username {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

.topbar-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topbar-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topbar-bell {
    position: relative;
    font-size: 20px;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
}

.bell-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--white);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
    padding: 28px 32px;
    flex: 1;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
}

.content-body {
    min-height: 200px;
}

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #FAFBFC;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.card-body {
    padding: 24px;
}

/* ================================================
   TABLES
   ================================================ */
.table-wrapper {
    overflow-x: auto;
}

.table-wrapper table,
table.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper thead th,
table.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--white);
    background: var(--navy);
    border-bottom: 2px solid var(--navy);
}

.table-wrapper thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.table-wrapper thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.table-wrapper tbody td,
table.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.table-wrapper tbody tr:hover,
table.data-table tbody tr:hover {
    background: #F7F9FC;
}

.table-wrapper tbody tr:last-child td,
table.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
}

.btn-primary:hover {
    background: #06213e;
    color: var(--white);
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
}

.btn-gold:hover {
    background: var(--gold-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #247A4F;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #B71C1C;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.action-btns {
    display: flex;
    gap: 6px;
}

.link-btn {
    color: var(--navy);
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
}

.link-btn:hover {
    color: var(--gold);
}

/* ================================================
   FORMS
   ================================================ */
.form-container {
    max-width: 700px;
}

.form-container.wide {
    max-width: 100%;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(203, 161, 53, 0.2);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ================================================
   BADGES
   ================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-primary {
    background: var(--info-bg);
    color: var(--info);
}

.badge-secondary {
    background: #EDF2F7;
    color: #2D3748;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-bg);
    color: #8D6208;
}

/* ================================================
   ALERTS
   ================================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-bg);
    color: #8D6208;
    border-left: 4px solid var(--warning);
}

/* ================================================
   SEARCH / FILTER BAR
   ================================================ */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box .form-control {
    width: auto;
    min-width: 200px;
}

.search-box label {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 600;
}

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ================================================
   ORDER TABLE (Home page)
   ================================================ */
.order-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.order-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.order-row {
    background: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.order-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.order-row td {
    padding: 16px;
    font-size: 14px;
}

.order-row td:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.order-row td:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.station-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.station-logo {
    width: 42px;
    height: 42px;
    background: #EEE;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: var(--navy);
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    display: inline-block;
    min-width: 100px;
}

.status-created {
    background: #FFF3CD;
    color: #856404;
}

.status-approved {
    background: #D4EDDA;
    color: #155724;
}

.status-received {
    background: #FFE0B2;
    color: #E65100;
}

.status-processing {
    background: #DDFBE6;
    color: #166534;
}

.status-consolidated {
    background: #DDEBFF;
    color: #1D4ED8;
}

.status-not-approved {
    background: #F8D7DA;
    color: #721C24;
}

.status-invoice {
    background: #D1ECF1;
    color: #0C5460;
}

.priority-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.priority-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Arrow button next to priority -> goes to order detail */
.order-arrow-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}

.order-arrow-btn:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* ================================================
   FILTER BAR (Orders page)
   ================================================ */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.order-filter-toggles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.order-filter-toggle:hover {
    border-color: var(--gold);
    background: #FFFBF0;
}

.order-filter-toggle.is-active {
    border-color: rgba(8, 44, 78, 0.2);
    background: rgba(8, 44, 78, 0.06);
    color: var(--navy);
}

.order-filter-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--navy);
}

.filter-select {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-family: inherit;
    min-width: 140px;
    max-height: 200px;
}

.search-input {
    padding: 8px 14px 8px 36px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-size: 13px;
    font-family: inherit;
    width: 220px;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
}

/* ================================================
   ORDER DETAIL PAGE
   ================================================ */
.order-detail-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-company-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-company-logo {
    width: 56px;
    height: 56px;
    background: #EEE;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: var(--navy);
}

.order-company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.order-company-name {
    font-size: 16px;
    font-weight: 700;
}

.order-company-station {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.order-id-block {
    text-align: right;
}

.order-id-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
}

.order-id-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Actions bar */
.order-actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 24px;
}

.order-actions-panel {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 0 10px;
}

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

.order-actions-secondary {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.order-status-select {
    width: 200px;
}

.order-action-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
}

.order-note-toggle {
    min-width: 110px;
    min-height: 40px;
    justify-content: center;
}

.order-note-toggle.is-active,
.order-note-toggle.is-required {
    background: var(--navy);
    color: var(--white);
}

.status-note-panel {
    width: min(300px, 100%);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow);
}

.status-note-hint {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--danger);
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab-link {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.tab-link:hover {
    color: var(--text);
}

.tab-link.active {
    color: var(--text);
    border-bottom-color: var(--navy);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Details grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.detail-item label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.detail-item p {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.detail-subfield {
    margin-top: 10px;
}

.detail-subfield-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.detail-subfield-input {
    max-width: 150px;
    background: #FAFBFC;
}

.detail-item .detail-box {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    min-height: 70px;
    background: #FAFBFC;
}

/* Order product table */
.order-product-table {
    width: 100%;
    border-collapse: collapse;
}

.order-product-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--white);
    background: var(--navy);
}

.order-product-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.order-product-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.order-product-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.order-product-table .product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-summary-trigger {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--navy);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.product-summary-trigger:hover {
    color: var(--gold);
    text-decoration: underline;
}

.order-product-table .product-thumb {
    width: 40px;
    height: 40px;
    background: #F0F0F0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-product-table .product-thumb i {
    color: #AAA;
    font-size: 16px;
}

/* Totals row */
.totals-row {
    background: var(--success);
    color: var(--white);
}

.totals-row td {
    padding: 10px 16px;
    font-weight: 700;
    border-bottom: none !important;
}

.totals-row td:first-child {
    border-radius: 0 0 0 var(--radius-sm);
}

.totals-row td:last-child {
    border-radius: 0 0 var(--radius-sm) 0;
}

/* Bottom fields */
.order-bottom-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.order-bottom-fields-single {
    grid-template-columns: minmax(280px, 420px);
    width: fit-content;
    max-width: 100%;
    padding: 20px 24px;
}

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

.parcel-row-action {
    min-width: 84px;
    justify-content: center;
}

.parcel-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(8, 44, 78, 0.08);
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
}

.parcel-actions-footer {
    margin-bottom: 16px;
}

.parcel-draft-card,
.parcel-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    overflow: hidden;
}

.parcel-card-summary {
    width: 100%;
    border: none;
    background: #F8FAFC;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    text-align: left;
}

.parcel-card-summary-static {
    cursor: default;
}

.parcel-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.parcel-arrow-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(8, 44, 78, 0.08);
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.parcel-card.is-open .parcel-arrow-icon i {
    transform: rotate(90deg);
}

.parcel-arrow-icon i {
    transition: var(--transition);
}

.parcel-summary-text,
.parcel-summary-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parcel-number-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    font-weight: 700;
    color: var(--text);
}

.parcel-summary-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.parcel-status-pill {
    min-width: 110px;
}

.parcel-draft-meta,
.parcel-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
}

.parcel-card-body {
    padding: 0 18px 18px;
}

.parcel-meta-field--invoice {
    min-width: 0;
}

.parcel-draft-empty {
    padding: 0 18px 18px;
    color: var(--text-muted);
    font-size: 14px;
}

.parcel-items-table {
    margin-top: 4px;
}

.parcel-items-table thead th:last-child,
.parcel-aware-table thead th:last-child {
    border-radius: 0;
}

.parcel-submit-btn {
    margin: 18px;
}

.parcel-qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.parcel-qty-control .form-control {
    width: 92px;
    text-align: center;
}

.parcel-status-update-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 16px;
}

.parcel-status-update-row .form-control {
    max-width: 240px;
}

/* ================================================
   NEW ORDER PAGE
   ================================================ */
.selectors-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    background: var(--white);
    padding: 24px 28px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selector-group-compact {
    align-items: flex-start;
}

.selector-logo {
    width: 48px;
    height: 48px;
    background: #EEE;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--navy);
}

.selector-group .form-control {
    flex: 1;
}

/* Section header with action */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

/* Product cards grid */
.product-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: 20px;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
}

.product-card.selected {
    border-color: var(--success);
    background: #FAFFF8;
}

.product-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.product-card-thumb {
    width: 50px;
    height: 50px;
    background: #F0F0F0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-card-thumb i {
    color: #AAA;
    font-size: 20px;
}

.product-card-info {
    flex: 1;
}

.product-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.product-card-code {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.product-card-alias {
    font-size: 12px;
    color: var(--navy);
    margin-top: 4px;
}

/* Toggle switch */
.toggle-switch {
    position: absolute;
    top: 16px;
    right: 16px;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    width: 44px;
    height: 24px;
    background: #CCC;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    display: block;
}

.toggle-switch .slider::after {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.slider {
    background: var(--success);
}

.toggle-switch input:checked+.slider::after {
    left: 22px;
}

/* Product packaging details */
.product-card-details {
    margin: 10px 0;
    font-size: 13px;
    color: var(--text);
}

.product-card-details .detail-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.product-card-details .detail-line i {
    color: var(--gold);
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.product-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0;
    line-height: 1.5;
}

/* Period tabs on card */
.period-tabs {
    display: flex;
    gap: 4px;
    margin: 10px 0;
}

.period-tab {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.period-tab.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* Stats line */
.product-card-stats {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 8px 0;
}

.product-card-stats .stat-total {
    color: var(--gold);
    font-weight: 700;
}

.product-preview-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 8px 0 2px;
}

/* Quantity controls */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 12px;
}

.qty-controls label {
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
    white-space: nowrap;
    color: var(--text);
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--navy);
    background: var(--navy);
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:first-of-type {
    border-radius: 6px 0 0 6px;
}

.qty-btn:last-of-type {
    border-radius: 0 6px 6px 0;
}

.qty-btn:hover {
    background: var(--navy-light);
}

.qty-input {
    width: 60px;
    height: 36px;
    border: 2px solid var(--navy);
    border-left: none;
    border-right: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: var(--text);
}

.qty-input:focus {
    outline: none;
}

.qty-total {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.qty-total .total-amount {
    color: var(--danger);
    font-weight: 700;
}

/* Bottom bar for new order */
.order-bottom-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px;
}

#newOrderNotePanel {
    width: min(320px, 100%);
}

#newOrderNotePanel .form-control {
    min-height: 96px;
}

/* ================================================
   ADD PRODUCTS MODAL
   ================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1100px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.product-preview-content {
    max-width: 620px;
}

.product-preview-card {
    border-color: rgba(34, 197, 94, 0.35);
    background: #FAFFF8;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-actions .search-input {
    width: 200px;
}

.modal-body {
    padding: 24px 28px;
}

/* Category pills */
.category-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-pill {
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.category-pill.active,
.category-pill:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* Added counter */
.added-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.added-counter .count {
    background: var(--gold);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* ================================================
   CHECKBOX GROUP (product-presentations)
   ================================================ */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.checkbox-label:hover {
    border-color: var(--gold);
    background: #FFFBF0;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--navy);
    width: 16px;
    height: 16px;
}

/* ================================================
   IMAGE GRID (product-images)
   ================================================ */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.image-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 3px solid var(--border);
    transition: var(--transition);
}

.image-item.default {
    border-color: var(--gold);
}

.image-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(7, 16, 30, 0.9));
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.image-action-btn,
.image-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.image-action-btn {
    background: rgba(255, 255, 255, 0.96);
    color: var(--navy);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.image-action-btn:hover {
    background: var(--white);
    color: var(--navy);
    transform: translateY(-1px);
}

.image-action-secondary {
    background: rgba(255, 239, 186, 0.96);
    color: #7a5800;
}

.image-action-secondary:hover {
    background: #fff3c4;
    color: #6a4b00;
}

.image-action-danger {
    width: 30px;
    padding: 0;
    background: #ef4444;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.28);
}

.image-action-danger:hover {
    background: #dc2626;
    color: var(--white);
}

.image-action-badge {
    background: rgba(34, 197, 94, 0.98);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ================================================
   UTILITIES
   ================================================ */
.text-muted {
    color: var(--text-muted);
}

.text-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 6px;
}

.mt-2 {
    margin-top: 12px;
}

.mb-2 {
    margin-bottom: 12px;
}

.mb-3 {
    margin-bottom: 24px;
}

.d-flex {
    display: flex;
}

.gap-12 {
    gap: 12px;
}

.align-center {
    align-items: center;
}

/* ================================================
   PRODUCT CARD EXTRAS
   ================================================ */
.product-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.product-card-alias {
    font-size: 12px;
    color: var(--text);
    margin: 6px 0;
    line-height: 1.5;
}

/* ================================================
   ORDER DETAIL - HEADER LABELS
   ================================================ */
.odh-left {
    margin-right: 40px;
}

.odh-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.odh-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ================================================
   PRIORITY DROPDOWN (Custom)
   ================================================ */
.priority-dropdown {
    position: relative;
    display: inline-block;
}

.priority-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    min-width: 140px;
    transition: var(--transition);
}

.priority-select-btn:hover {
    border-color: var(--gold);
}

.priority-select-btn i {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

.priority-dot-inline {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.priority-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 160px;
    z-index: 20;
    overflow: hidden;
}

.priority-options.show {
    display: block;
}

.priority-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.priority-option:hover {
    background: var(--bg);
}

/* ================================================
   EVENT HISTORY
   ================================================ */
.event-history {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-entry {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.event-meta {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.event-user {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 12px;
}

.text-link {
    color: var(--info);
    font-weight: 600;
    font-size: 13px;
    margin-left: 4px;
}

.event-note-box {
    margin-top: 8px;
}

.event-note-box label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.event-note-box textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

/* ================================================
   BADGE INFO
   ================================================ */
.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* ================================================
   INLINE TOGGLE SWITCH (Table rows)
   ================================================ */
.toggle-inline {
    width: 32px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 9px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    border: none;
    padding: 0;
    vertical-align: middle;
}

.toggle-inline .toggle-knob {
    width: 14px;
    height: 14px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: block;
}

.toggle-inline.active {
    background: var(--success);
}

.toggle-inline.active .toggle-knob {
    left: 16px;
}

/* ================================================
   PRODUCTS PAGE VIEW TOGGLE
   ================================================ */
.view-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: #f3f6fb;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}

.view-mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.view-mode-option:hover {
    color: var(--navy);
    background: rgba(13, 45, 84, 0.06);
}

.view-mode-option.active {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 6px 14px rgba(13, 45, 84, 0.16);
}

.products-page-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.products-page-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
}

.products-page-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.products-page-card-top .product-card-header {
    margin-bottom: 0;
    flex: 1;
}

.products-page-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.products-page-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.products-page-meta-pill:hover {
    border-color: var(--gold);
    color: var(--navy);
    background: #fffdf7;
}

.products-page-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 6px;
}

.products-page-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.table-sort-link:hover {
    color: rgba(255, 255, 255, 0.88);
}

.table-sort-arrow {
    font-size: 12px;
    line-height: 1;
}

.product-list-code {
    color: var(--text-muted);
    font-weight: 600;
}

.product-edit-preview-card {
    max-width: 760px;
}

.product-card-status-toggle {
    pointer-events: none;
}

.product-preview-qty .qty-btn[disabled] {
    opacity: 1;
    cursor: default;
}

.product-preview-qty .qty-input[readonly] {
    background: var(--white);
}

.image-preview-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
}

.image-preview-trigger img {
    display: block;
    width: 100%;
}

.image-lightbox-content {
    max-width: 920px;
}

.image-lightbox-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.image-lightbox-body img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.document-file-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.document-file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfcfe;
}

.document-file-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(13, 45, 84, 0.08);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.document-file-info {
    flex: 1;
    min-width: 0;
}

.document-file-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.document-file-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.document-file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ================================================
   FORM SECTIONS (Company / Station forms)
   ================================================ */
.form-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* Multi-column form rows */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.form-row-5 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 16px;
}

/* Logo upload row */
.logo-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

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


.company-logo-preview {
    width: 56px;
    height: 56px;
    background: #EEE;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: var(--navy);
    flex-shrink: 0;
}

.company-phone-block {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfcfe;
}

.company-phone-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.company-phone-title {
    margin-bottom: 0;
}

.company-phone-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.company-phone-row {
    display: grid;
    grid-template-columns: 1.2fr 1.3fr 0.8fr 0.8fr 0.8fr auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--white);
}

.station-phone-row {
    grid-template-columns: 1.2fr 1.1fr 1.3fr 0.8fr 0.8fr 0.8fr auto;
}

.company-phone-extension-toggle {
    padding-bottom: 10px;
}

.company-phone-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.company-phone-remove-cell {
    min-width: 54px;
}

.company-phone-remove-btn {
    width: 44px;
    justify-content: center;
}

.company-form-tab-nav {
    margin-bottom: 20px;
}

.company-form-tab-nav .tab-link {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.company-tab-panel {
    display: none;
}

.company-tab-panel.active {
    display: block;
}

.company-address-toolbar,
.company-products-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.company-address-title,
.company-products-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.company-address-view-select {
    width: 220px;
    min-width: 220px;
}

.company-address-section + .company-address-section {
    margin-top: 20px;
}

.company-products-add {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 460px);
}

.company-products-add .form-control {
    flex: 1;
}

.company-products-grid {
    align-items: start;
}

.company-product-card {
    padding-top: 24px;
}

.company-product-remove {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #FFE8E8;
    color: var(--danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.company-product-remove:hover {
    background: var(--danger);
    color: var(--white);
}

.company-products-empty {
    text-align: center;
    padding: 36px 24px;
    border: 1px dashed var(--border);
    box-shadow: none;
}

.company-products-empty i {
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 12px;
}

.company-products-empty h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.company-products-empty p {
    margin: 0;
    color: var(--text-muted);
}

/* Manager badges row */
.managers-row {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 0;
}

.manager-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    padding: 10px 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.manager-badge i {
    color: var(--gold);
    font-size: 16px;
}

/* (+) button on manager badge */
.btn-add-manager {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-left: 8px;
    transition: var(--transition);
    padding: 0;
}

.btn-add-manager:hover {
    background: var(--gold);
    transform: scale(1.1);
}

/* Manager modal list */
.manager-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.manager-list-item:last-child {
    border-bottom: none;
}

.manager-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.manager-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.manager-list-info {
    flex: 1;
}

.manager-list-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.manager-list-role {
    font-size: 12px;
    color: var(--text-muted);
}

.manager-list-item .btn-assigned {
    background: var(--success);
    color: var(--white);
    border: none;
    font-weight: 600;
}

.manager-list-item .btn-assigned:hover {
    background: #B71C1C;
}

/* Modal close X button */
.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: var(--bg);
    color: var(--danger);
}

/* History clock icon in stations table */
.history-clock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 15px;
    transition: var(--transition);
    text-decoration: none;
}

.history-clock-btn:hover {
    background: var(--navy);
    color: var(--white);
}


/* ================================================
   TABLE UTILITIES
   ================================================ */
.station-logo {
    width: 44px;
    height: 44px;
    background: #EAEDF2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: var(--navy);
    letter-spacing: 0.5px;
}

.station-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.order-arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
}

.order-arrow-btn:hover {
    background: var(--gold);
    color: var(--white);
}

/* ================================================
   INPUTS & SELECTS
   ================================================ */
.search-input {
    padding: 8px 12px 8px 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--gold);
    outline: none;
}

.filter-select {
    padding: 8px 30px 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* ================================================
   USER AVATARS
   ================================================ */
.user-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: #fff;
    border: 2px solid var(--gold);
    font-size: 22px;
    font-weight: 800;
}

.user-form-tab-nav {
    margin-bottom: 20px;
}

.user-form-tab-nav .tab-link {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ================================================
   PASSWORD FIELD
   ================================================ */
.password-input-wrap {
    position: relative;
}

.password-input-wrap .form-control {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 15px;
    padding: 4px;
    transition: var(--transition);
}

.password-toggle-btn:hover {
    color: var(--navy);
}

/* ================================================
   TICKET FORM
   ================================================ */
.ticket-form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.ticket-description {
    min-height: 200px;
    resize: vertical;
}

.ticket-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-attachment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-attachment:hover {
    background: var(--gold);
}

/* ================================================
   SETTINGS PAGES
   ================================================ */
.settings-page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
}

.settings-page-title span {
    color: var(--text-muted);
    font-weight: 600;
}

.settings-card {
    background: #ECEEF2;
    border-radius: var(--radius);
    padding: 28px;
    min-height: 400px;
}

/* Folder-style tabs */
.settings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
}

.settings-tab {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: #D8DBE2;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.settings-tab:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.settings-tab:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.settings-tab.active,
.settings-tab:hover {
    background: var(--white);
    color: var(--text);
}

/* Action buttons bar */
.settings-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-settings-primary {
    background: var(--navy);
    color: var(--white);
}

.btn-settings-primary:hover {
    background: #06213e;
    color: var(--white);
}

.btn-settings-outline {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-settings-outline:hover {
    background: #f1f5f9;
    border-color: var(--navy);
    color: var(--navy);
}

/* Settings table */
.settings-table-wrap {
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table thead th {
    background: var(--navy);
    color: var(--white);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid var(--navy);
}

.settings-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
    width: 60px;
    text-align: center;
}

.settings-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.settings-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.settings-table tbody tr:hover {
    background: #F7F9FC;
}

.settings-table tbody tr.selected-row {
    background: #EEF2FF;
}

.settings-table tbody td:first-child {
    text-align: center;
}

.settings-table tbody td input[type="checkbox"] {
    accent-color: var(--navy);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.settings-table .link-cell a {
    color: var(--info);
    text-decoration: none;
    font-weight: 500;
}

.settings-table .link-cell a:hover {
    text-decoration: underline;
}

/* Inline edit row for settings */
.settings-edit-row {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: none;
}

.settings-edit-row.active {
    display: block;
}

.settings-edit-row .form-row-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.settings-edit-row .form-group {
    flex: 1;
    min-width: 150px;
}

.settings-edit-row .form-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
    color: var(--text-muted);
}

.btn-close-row {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-row:hover {
    background: #fee2e2;
    color: #ef4444;
}


/* ================================================
   BUTTON VARIANTS
   ================================================ */
.btn-gold {
    background: var(--gold);
    color: var(--white);
    border: none;
}

.btn-gold:hover {
    background: #B8912F;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: none;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 15px;
}

/* ================================================
   EMPTY STATES
   ================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px !important;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    opacity: 0.15;
    margin-bottom: 12px;
    display: block;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ================================================
   PRODUCT CARD DESCRIPTION
   ================================================ */
.product-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 8px 0;
}

.product-card-desc strong {
    color: var(--text);
    display: block;
    font-size: 12px;
    margin-bottom: 2px;
}

/* ================================================
   SPACING UTILITIES
   ================================================ */
.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* ================================================
   TEXT UTILITIES
   ================================================ */
.text-muted {
    color: var(--text-muted) !important;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-area {
        margin-left: 200px;
    }

    .nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .company-phone-row {
        grid-template-columns: 1fr 1fr;
    }

    .company-phone-block-head {
        flex-direction: column;
        align-items: stretch;
    }

    .company-address-toolbar,
    .company-products-toolbar,
    .company-products-add {
        flex-direction: column;
        align-items: stretch;
    }

    .company-address-view-select,
    .company-products-add {
        width: 100%;
        min-width: 0;
    }

    .form-row-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-area {
        margin-left: 0;
    }

    .form-row,
    .form-row-3,
    .form-row-4,
    .form-row-5 {
        grid-template-columns: 1fr;
    }

    .company-phone-row {
        grid-template-columns: 1fr;
    }

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

    .document-file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .document-file-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .image-lightbox-content {
        max-width: calc(100vw - 24px);
    }

    .order-bottom-bar {
        grid-template-columns: 1fr;
    }

    .order-detail-header {
        flex-direction: column;
        gap: 16px;
        text-align: left;
    }

    .order-id-block {
        text-align: left;
    }

    .selectors-bar {
        grid-template-columns: 1fr;
    }

    .managers-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* ================================================
   ORDERS KPI BAR
   ================================================ */
.orders-kpi-bar {
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 20px 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 40px;
}

.kpi-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.kpi-divider {
    width: 1px;
    height: 44px;
    background: var(--border);
}

.text-warning {
    color: #f59e0b !important;
}

.text-info {
    color: #3b82f6 !important;
}

.text-success {
    color: #22c55e !important;
}

/* Fix for dropdown space at bottom */
.main-content {
    padding-bottom: 300px;
}
.company-extra-addresses-section {
    margin-top: 24px;
}

.company-extra-address-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}

.dynamic-address-row {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    background: #fff;
}

.dynamic-address-head {
    display: flex;
    gap: 16px;
    align-items: end;
}

.dynamic-address-head .form-group {
    flex: 1;
    margin-bottom: 0;
}

.dynamic-address-head .company-phone-remove-btn {
    min-width: 44px;
    height: 44px;
}
