.app-notice { margin: 0 0 14px; padding: 12px 15px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; }
.notice-success { color: #245c41; background: #e6f3eb; border-color: #cce5d5; }
.notice-error { color: #8f2f28; background: #fbeae7; border-color: #f0c9c3; }
.notice-warning { color: #775311; background: #fff5d8; border-color: #f2e3b2; }
.app-notice ul { padding-left: 18px; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.auth-card { width: min(100%, 430px); padding: 30px; }
.auth-brand { margin-bottom: 32px; }
.auth-card h1 { margin: 8px 0; font-family: "Bricolage Grotesque", sans-serif; font-size: 29px; font-weight: 400; }
.auth-card .button { width: 100%; margin-top: 6px; }
.surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; }
.surface-heading h2, .card-heading h2 { margin: 0; color: var(--ink); font-family: "Bricolage Grotesque", sans-serif; font-size: 20px; font-weight: 400; }
.surface-heading .eyebrow, .card-heading .eyebrow { margin-bottom: 5px; }
.empty-state { padding: 26px 20px; color: var(--ink-soft); font-size: 12px; }
.empty-state a, .cell-link { color: var(--forest-soft); font-weight: 600; }
.cell-link:hover, .empty-state a:hover { color: var(--orange-dark); }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--ink-soft); font-size: 11px; }
.table-footer nav { margin-left: auto; }
.table-footer .pagination { margin: 0; }
.form-textarea { min-height: 85px; padding: 9px 10px; resize: vertical; }
.form-card, .settings-card { min-width: 0; }
.settings-panel[hidden] { display: none; }
.settings-panel .settings-card { margin-bottom: 0; }
.form-card .card-heading { display: flex; align-items: center; justify-content: space-between; }
.form-hint { color: var(--ink-soft); font-size: 11px; }
.details-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 14px; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.detail-list dt { color: var(--ink-soft); font-weight: 500; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.status-pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 30px; background: var(--surface-muted); color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.status-draft { color: #617068; background: #eef1ed; }
.status-sent, .status-shipped { color: #39618a; background: #e8f0fa; }
.status-paid, .status-accepted, .status-delivered { color: #276047; background: #e6f3eb; }
.status-overdue, .status-cancelled, .status-rejected { color: #9a4037; background: #fbeae7; }
.invoice-items-wrap { border: 1px solid var(--line); border-radius: 10px; }
.quotation-opening-box { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); color: var(--ink); font-size: 12px; line-height: 1.55; }
.quotation-opening-detail { margin: 0 16px 14px; }
.quotation-opening-text { margin: 0; }
.invoice-items-table { min-width: 760px; }
.invoice-items-table .form-control { font-size: 13px; }
.invoice-items-table .form-control { min-width: 90px; }
.invoice-items-table td:first-child .form-control { min-width: 190px; }
.invoice-items-table td:nth-child(2) .form-control { min-width: 150px; }
.invoice-items-table td:last-child { width: 42px; }
.invoice-suggest-results { position: fixed; z-index: 1100; max-height: 240px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 12px 30px rgb(20 35 28 / 16%); }
.invoice-suggest-results[hidden] { display: none; }
.invoice-suggest-option { display: flex; width: 100%; flex-direction: column; gap: 3px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.invoice-suggest-option:hover, .invoice-suggest-option:focus, .invoice-suggest-option.is-active { outline: none; background: var(--surface-muted); }
.invoice-suggest-option span { font-size: 13px; font-weight: 600; }
.invoice-suggest-option small, .invoice-suggest-empty { color: var(--ink-soft); font-size: 11px; }
.invoice-suggest-empty { padding: 10px; }
.totals-list { width: min(100%, 390px); margin: 18px 20px 20px auto; }
.totals-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; color: var(--ink-soft); font-size: 11px; }
.totals-list dd { margin: 0; color: var(--ink); }
.totals-list .total-row { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 700; }
.totals-list .total-row dd { font-size: 15px; }
.action-card { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 14px; }
.inline-form { display: inline-flex; }
.profile-logout { width: 100%; text-align: left; }
.profile-logout > i { margin-left: auto; color: #9eb4a8; }
.table-search { min-width: min(100%, 250px); }
.compact-select { max-width: 180px; }
.status-pill { white-space: nowrap; }
.dashboard-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.invoice-chart-card { min-width: 0; padding: 15px; }
.invoice-year-chart { height: 160px; margin: 10px 0 0; }
.invoice-year-chart canvas { display: block; width: 100% !important; height: 100% !important; }
.product-sales-card { min-width: 0; }
.product-sales-list { display: flex; flex-direction: column; margin-top: 12px; }
.product-sales-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.product-sales-dot { width: 6px; height: 6px; border-radius: 50%; }
.product-sales-dot-1 { background: #e2a53a; }
.product-sales-dot-2 { background: #6c9c4c; }
.product-sales-dot-3 { background: #1b9c8d; }
.product-sales-dot-4 { background: #478fc9; }
.product-sales-dot-5 { background: #81939b; }
.product-sales-dot-6 { background: #e45b7e; }
.product-sales-info { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.product-sales-info strong { overflow: hidden; color: #435148; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.product-sales-info small { color: #929c95; font-size: 9px; }
.product-sales-row b { color: #425047; font-size: 10px; font-weight: 600; white-space: nowrap; }
.dashboard-year-filter { display: flex; align-items: center; gap: 8px; }
.dashboard-year-filter .form-select { width: auto; min-width: 105px; }
.invoice-actions { display: flex; align-items: center; gap: 4px; }
.invoice-actions form { display: inline-flex; margin: 0; }
.invoice-heading-actions { flex-wrap: wrap; }
.invoice-heading-actions .invoice-pdf-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.invoice-signature-group { display: inline-flex; align-items: center; gap: 7px; }
.invoice-signature-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.invoice-heading-buttons { display: inline-flex; align-items: center; gap: 8px; }
.invoice-pdf-options { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.invoice-pdf-options .switch { flex-shrink: 0; }
.invoice-totals-wrapper { padding: 0 16px 16px; }
.invoice-action { display: inline-grid; width: 30px; height: 30px; place-items: center; padding: 0; color: #64736a; background: transparent; border: 0; border-radius: 7px; cursor: pointer; font-size: 15px; }
.invoice-action:hover { background: #f0f3ef; }
.invoice-action-edit:hover { color: #3b6d91; }
.invoice-action-paid:hover { color: #27765b; background: #e6f3eb; }
.invoice-action-delete:hover { color: #bd443c; background: #fbeae7; }
.invoice-action:focus-visible { outline: 2px solid #557fa1; outline-offset: 2px; }
.trend-neutral { color: #707c74; background: #edf0ec; }
.breadcrumb-parent { color: #7d8881; text-decoration: none; transition: color .15s ease; }
.breadcrumb-parent:hover { color: var(--ink); }
.breadcrumb-sep { color: #a7b1aa; font-size: 10px; }
.topbar { position: relative; z-index: 1100; }
.topbar-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.topbar .icon-button,
.topbar .theme-toggle-button,
.topbar .notification-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1;
}
.topbar .theme-toggle-button,
.topbar .notification-button {
  display: inline-grid;
}
@media (min-width: 992px) {
  .topbar .menu-toggle {
    display: none !important;
  }
}
@media (max-width: 991.98px) {
  .topbar .menu-toggle {
    display: inline-grid !important;
  }
}
.topbar .top-create {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .topbar .top-create {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }
}
.topbar-dropdown-menu { right: 0; left: auto; z-index: 1110; }
.topbar-caret { font-size: 10px; transition: transform .15s ease; }
.topbar-dropdown[open] .topbar-caret { transform: rotate(180deg); }
.topbar-create-menu { min-width: 185px; padding: 6px; }
.topbar-menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.topbar-menu-item i { color: var(--ink-soft); font-size: 14px; }
.topbar-menu-item:hover, .topbar-menu-item:focus { background: var(--surface-muted); color: var(--ink); }
.notification-button { position: relative; }
.notification-badge { position: absolute; top: -4px; right: -4px; display: inline-flex; min-width: 17px; height: 17px; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--page); border-radius: 999px; background: var(--orange); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }
.notification-dropdown-menu { width: min(340px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notification-dropdown-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.notification-dropdown-header strong { display: block; color: var(--ink); font-size: 12px; }
.notification-dropdown-header small { color: var(--ink-soft); font-size: 10px; }
.notification-total { color: var(--orange-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
.notification-list { max-height: 300px; overflow-y: auto; }
.notification-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background .15s ease; }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: var(--surface-muted); color: var(--ink); }
.notification-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notification-item-top strong { font-size: 12px; font-weight: 600; }
.notification-item-customer { color: var(--ink-soft); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 10px; }
.notification-item-meta b { color: var(--ink); font-size: 11px; font-weight: 600; }
.notification-empty { padding: 18px 14px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.notification-dropdown-footer { padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface-muted); text-align: center; }
.notification-dropdown-footer a { color: var(--forest-soft); font-size: 11px; font-weight: 600; text-decoration: none; }
.notification-dropdown-footer a:hover { color: var(--orange-dark); }
.pagination form { display: flex; margin: 0; }
.pagination button:not(:disabled) { cursor: pointer; }
.pagination button.is-current { color: #fff; background: #1c3228; }
.pagination button:not(:disabled):hover { color: #1c3228; background: #f0f3ef; }
.pagination button:focus-visible { outline: 2px solid #557fa1; outline-offset: 2px; }

html[data-theme="dark"] .invoice-action { color: #a9b7ad; }
html[data-theme="dark"] .invoice-action:hover { background: #29372e; }
html[data-theme="dark"] .surface,
html[data-theme="dark"] .stat-card { border-color: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .product-sales-info strong,
html[data-theme="dark"] .product-sales-row b { color: #dce5dd; }
html[data-theme="dark"] .product-sales-info small { color: #9aa89e; }
html[data-theme="dark"] .pagination button:not(:disabled):hover { color: #e6ede7; background: #29372e; }
html[data-theme="dark"] .pagination button.is-current { color: #fff; background: var(--orange); }
html[data-theme="dark"] .empty-state a,
html[data-theme="dark"] .cell-link,
html[data-theme="dark"] .notification-dropdown-footer a { color: #7bc4a0; }
html[data-theme="dark"] .empty-state a:hover,
html[data-theme="dark"] .cell-link:hover,
html[data-theme="dark"] .notification-dropdown-footer a:hover { color: #f29a76; }
html[data-theme="dark"] .status-draft { color: #b8c4bc; background: #2d3b33; }
html[data-theme="dark"] .status-sent,
html[data-theme="dark"] .status-shipped { color: #90c2f0; background: #1e354a; }
html[data-theme="dark"] .status-paid,
html[data-theme="dark"] .status-accepted,
html[data-theme="dark"] .status-delivered { color: #84d6ad; background: #1c3b2d; }
html[data-theme="dark"] .status-overdue,
html[data-theme="dark"] .status-cancelled,
html[data-theme="dark"] .status-rejected { color: #f29b91; background: #422320; }
html[data-theme="dark"] .notice-success { color: #9be0bc; background: #1a3729; border-color: #28543e; }
html[data-theme="dark"] .notice-error { color: #f5a89f; background: #3e201d; border-color: #5c2f2b; }
html[data-theme="dark"] .notice-warning { color: #f3d38c; background: #3b3018; border-color: #594824; }
html[data-theme="dark"] .trend-neutral { color: #aebbb1; background: #2d3b33; }

/* Auth Brand Contrast (Login Page) */
.auth-brand .brand-copy strong {
  color: var(--ink);
}
.auth-brand .brand-copy span {
  color: var(--ink-soft);
}
.auth-brand .brand-mark {
  color: #fff;
  background: var(--forest);
}
html[data-theme="dark"] .auth-brand .brand-mark {
  color: #122820;
  background: #e4d7b8;
}

/* Custom Font, Sidebar Color, Auto-Contrast, & Rounded Elements */
body,
h1,
h2,
.brand-mark,
.brand-copy strong,
.auth-card h1,
.surface-heading h2,
.card-heading h2,
.form-aside h2 {
  font-family: var(--app-font, "Bricolage Grotesque", sans-serif);
}

.sidebar {
  background: var(--sidebar-bg, var(--forest));
  transition: width .22s ease, padding .22s ease, transform .2s ease, background-color .2s ease, color .2s ease;
}

/* Sidebar Auto-Contrast when Light Background Color is Selected */
html[data-sidebar-tone="light"] .sidebar {
  color: #1a2821;
  border-color: rgba(16, 36, 28, .12);
  box-shadow: 0 16px 38px rgba(12, 31, 24, .08);
}
html[data-sidebar-tone="light"] .sidebar .brand-mark {
  color: #fff;
  background: #172820;
}
html[data-sidebar-tone="light"] .sidebar .brand-copy strong,
html[data-sidebar-tone="light"] .sidebar .profile-button,
html[data-sidebar-tone="light"] .sidebar .profile-copy strong {
  color: #14221b;
}
html[data-sidebar-tone="light"] .sidebar .brand-copy span,
html[data-sidebar-tone="light"] .sidebar .nav-caption,
html[data-sidebar-tone="light"] .sidebar .profile-copy small {
  color: #55665d;
}
html[data-sidebar-tone="light"] .sidebar .side-link {
  color: #33443b;
}
html[data-sidebar-tone="light"] .sidebar .side-link > i,
html[data-sidebar-tone="light"] .sidebar .side-link > [data-icon],
html[data-sidebar-tone="light"] .sidebar .profile-logout > i {
  color: #4d6056;
}
html[data-sidebar-tone="light"] .sidebar .side-link:hover,
html[data-sidebar-tone="light"] .sidebar .side-link.is-active {
  color: #111e18;
  background: rgba(16, 38, 29, .09);
  font-weight: 600;
}
html[data-sidebar-tone="light"] .sidebar .side-link.is-active > i,
html[data-sidebar-tone="light"] .sidebar .side-link.is-active > [data-icon] {
  color: var(--orange-dark);
}
html[data-sidebar-tone="light"] .sidebar .sidebar-collapse-button,
html[data-sidebar-tone="light"] .sidebar .sidebar-close {
  color: #33443b;
  background: rgba(16, 38, 29, .07);
  border-color: rgba(16, 38, 29, .16);
}
html[data-sidebar-tone="light"] .sidebar .sidebar-collapse-button:hover,
html[data-sidebar-tone="light"] .sidebar .sidebar-close:hover {
  color: #111e18;
  background: rgba(16, 38, 29, .14);
  border-color: rgba(16, 38, 29, .26);
}

/* Font Size Scaling (Sidebar + Right Content, Tables, Forms, Cards) */
html[data-font-size="small"] { --font-scale: 0.92; }
html[data-font-size="medium"] { --font-scale: 1; }
html[data-font-size="large"] { --font-scale: 1.12; }
html[data-font-size="xlarge"] { --font-scale: 1.24; }

.data-table { font-size: calc(13px * var(--font-scale, 1)); }
.data-table thead th { height: 40px; font-size: calc(11.5px * var(--font-scale, 1)); }
.data-table tbody td { height: 52px; font-size: calc(13px * var(--font-scale, 1)); }
.data-table .cell-copy strong,
.data-table .value-cell strong,
.data-table .cell-link { font-size: calc(13px * var(--font-scale, 1)); }
.data-table .cell-copy small,
.data-table .value-cell small { font-size: calc(11.5px * var(--font-scale, 1)); }

html[data-font-size] body { font-size: calc(14px * var(--font-scale, 1)); }
html[data-font-size] .sidebar .brand-copy strong { font-size: calc(18px * var(--font-scale, 1)); }
html[data-font-size] .sidebar .brand-copy span,
html[data-font-size] .sidebar .nav-caption { font-size: calc(9.5px * var(--font-scale, 1)); }
html[data-font-size] .sidebar .side-link { font-size: calc(12.5px * var(--font-scale, 1)); }
html[data-font-size] .sidebar .side-link > i { font-size: calc(14px * var(--font-scale, 1)); }
html[data-font-size] .sidebar .profile-copy strong { font-size: calc(11.5px * var(--font-scale, 1)); }
html[data-font-size] .sidebar .profile-copy small { font-size: calc(10px * var(--font-scale, 1)); }

html[data-font-size] .main-shell h1,
html[data-font-size] .auth-card h1 { font-size: calc(clamp(26px, 2.3vw, 33px) * var(--font-scale, 1)); }
html[data-font-size] .main-shell .surface-heading h2,
html[data-font-size] .main-shell .card-heading h2 { font-size: calc(20px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .eyebrow,
html[data-font-size] .auth-card .eyebrow,
html[data-font-size] .main-shell .page-tab > span,
html[data-font-size] .main-shell .trend,
html[data-font-size] .main-shell .summary-label { font-size: calc(10px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .topbar-date,
html[data-font-size] .main-shell .form-field small,
html[data-font-size] .main-shell .product-sales-info small,
html[data-font-size] .main-shell .stat-foot,
html[data-font-size] .main-shell .card-heading p,
html[data-font-size] .main-shell .dropdown-menu-custom button,
html[data-font-size] .main-shell .notification-dropdown-header small,
html[data-font-size] .main-shell .notification-item-meta { font-size: calc(11px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .data-table thead th,
html[data-font-size] .main-shell .data-table .cell-copy small,
html[data-font-size] .main-shell .data-table .value-cell small,
html[data-font-size] .main-shell .status-pill,
html[data-font-size] .main-shell .status-badge { font-size: calc(11.5px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .breadcrumb-line,
html[data-font-size] .main-shell .page-tab,
html[data-font-size] .main-shell .table-search input,
html[data-font-size] .main-shell .compact-select,
html[data-font-size] .main-shell .form-field label,
html[data-font-size] .main-shell .form-field > span,
html[data-font-size] .auth-card .form-field label,
html[data-font-size] .main-shell .button,
html[data-font-size] .auth-card .button,
html[data-font-size] .main-shell .form-control,
html[data-font-size] .auth-card .form-control,
html[data-font-size] .main-shell .form-select,
html[data-font-size] .main-shell .stat-label,
html[data-font-size] .main-shell .table-footer,
html[data-font-size] .main-shell .pagination button,
html[data-font-size] .main-shell .form-hint,
html[data-font-size] .main-shell .invoice-signature-label,
html[data-font-size] .main-shell .notification-item-customer,
html[data-font-size] .main-shell .notification-item-meta b,
html[data-font-size] .main-shell .notification-total,
html[data-font-size] .main-shell .notification-empty,
html[data-font-size] .main-shell .notification-dropdown-footer a,
html[data-font-size] .invoice-suggest-option small,
html[data-font-size] .invoice-suggest-empty { font-size: calc(12px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .page-subtitle,
html[data-font-size] .auth-card .page-subtitle,
html[data-font-size] .main-shell .empty-state,
html[data-font-size] .main-shell .app-notice,
html[data-font-size] .auth-card .app-notice,
html[data-font-size] .main-shell .topbar-menu-item,
html[data-font-size] .main-shell .notification-dropdown-header strong,
html[data-font-size] .main-shell .notification-item-top strong,
html[data-font-size] .main-shell .quotation-opening-box,
html[data-font-size] .main-shell .detail-list > div,
html[data-font-size] .main-shell .totals-list > div,
html[data-font-size] .main-shell .product-sales-info strong,
html[data-font-size] .main-shell .product-sales-row b { font-size: calc(12.5px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .data-table,
html[data-font-size] .main-shell .data-table tbody td,
html[data-font-size] .main-shell .data-table .cell-copy strong,
html[data-font-size] .main-shell .data-table .value-cell strong,
html[data-font-size] .main-shell .data-table .cell-link,
html[data-font-size] .main-shell .invoice-items-table .form-control,
html[data-font-size] .invoice-suggest-option span { font-size: calc(13px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .totals-list .total-row { font-size: calc(14px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .totals-list .total-row dd,
html[data-font-size] .main-shell .summary-metric strong { font-size: calc(15px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .stats-grid-compact .stat-value { font-size: calc(21px * var(--font-scale, 1)); }
html[data-font-size] .main-shell .stat-value { font-size: calc(23px * var(--font-scale, 1)); }

.main-shell {
  transition: margin-left .22s ease;
}

.sidebar-collapse-button {
  width: 30px;
  height: 30px;
  margin-left: auto;
  color: #c7d6ce;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .14);
}
.sidebar-collapse-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .25);
}
html[data-theme="dark"]:not([data-sidebar-tone="light"]) .sidebar .sidebar-collapse-button {
  color: #c7d6ce;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .14);
}
html[data-theme="dark"]:not([data-sidebar-tone="light"]) .sidebar .sidebar-collapse-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .25);
}

@media (min-width: 992px) {
  html.sidebar-collapsed,
  body.sidebar-collapsed {
    --sidebar-width: 88px;
  }
  html.sidebar-collapsed .sidebar,
  body.sidebar-collapsed .sidebar {
    width: calc(var(--sidebar-width) - 12px);
    padding: 18px 10px 14px;
    overflow-x: hidden;
  }
  html.sidebar-collapsed .sidebar .brand,
  body.sidebar-collapsed .sidebar .brand {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 0 0 16px;
  }
  html.sidebar-collapsed .sidebar .sidebar-collapse-button,
  body.sidebar-collapsed .sidebar .sidebar-collapse-button {
    margin-left: 0;
  }
  html.sidebar-collapsed .sidebar .brand-copy,
  body.sidebar-collapsed .sidebar .brand-copy,
  html.sidebar-collapsed .sidebar .nav-caption,
  body.sidebar-collapsed .sidebar .nav-caption,
  html.sidebar-collapsed .sidebar .side-link > span,
  body.sidebar-collapsed .sidebar .side-link > span,
  html.sidebar-collapsed .sidebar .profile-copy,
  body.sidebar-collapsed .sidebar .profile-copy {
    display: none !important;
  }
  html.sidebar-collapsed .sidebar .sidebar-nav,
  body.sidebar-collapsed .sidebar .sidebar-nav {
    align-items: center;
    gap: 5px;
  }
  html.sidebar-collapsed .sidebar .side-link,
  body.sidebar-collapsed .sidebar .side-link {
    justify-content: center;
    width: 42px;
    min-height: 40px;
    padding: 0;
  }
  html.sidebar-collapsed .sidebar .side-link > i,
  body.sidebar-collapsed .sidebar .side-link > i {
    font-size: 16px;
  }
  html.sidebar-collapsed .sidebar .side-link.is-active::before,
  body.sidebar-collapsed .sidebar .side-link.is-active::before {
    inset: 8px auto 8px -6px;
  }
  html.sidebar-collapsed .sidebar .profile-button,
  body.sidebar-collapsed .sidebar .profile-button {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 8px 0 2px;
  }
  html.sidebar-collapsed .sidebar .profile-logout > i,
  body.sidebar-collapsed .sidebar .profile-logout > i {
    margin-left: 0;
  }
}

html[data-rounded="none"] {
  --r-sidebar: 0px;
  --r-surface: 0px;
  --r-card: 0px;
  --r-control: 0px;
  --r-item: 0px;
  --r-badge: 0px;
  --r-pill: 0px;
}
html[data-rounded="small"] {
  --r-sidebar: 10px;
  --r-surface: 8px;
  --r-card: 6px;
  --r-control: 5px;
  --r-item: 4px;
  --r-badge: 3px;
  --r-pill: 6px;
}
html[data-rounded="medium"] {
  --r-sidebar: 22px;
  --r-surface: 15px;
  --r-card: 12px;
  --r-control: 9px;
  --r-item: 6px;
  --r-badge: 5px;
  --r-pill: 999px;
}
html[data-rounded="large"] {
  --r-sidebar: 28px;
  --r-surface: 22px;
  --r-card: 18px;
  --r-control: 14px;
  --r-item: 10px;
  --r-badge: 8px;
  --r-pill: 999px;
}
html[data-rounded="full"] {
  --r-sidebar: 32px;
  --r-surface: 26px;
  --r-card: 22px;
  --r-control: 999px;
  --r-item: 14px;
  --r-badge: 999px;
  --r-pill: 999px;
}

html[data-rounded] .sidebar { border-radius: var(--r-sidebar); }
html[data-rounded] .surface,
html[data-rounded] .record-dialog,
html[data-rounded] .auth-card { border-radius: var(--r-surface); }
html[data-rounded] .stat-card,
html[data-rounded] .crud-summary,
html[data-rounded] .revenue-card,
html[data-rounded] .performance-summary,
html[data-rounded] .invoice-items-wrap,
html[data-rounded] .quotation-opening-box,
html[data-rounded] .app-notice,
html[data-rounded] .toast-message,
html[data-rounded] .dropdown-menu-custom,
html[data-rounded] .invoice-suggest-results { border-radius: var(--r-card); }
html[data-rounded] .button,
html[data-rounded] .icon-button,
html[data-rounded] .form-control,
html[data-rounded] .form-select,
html[data-rounded] .topbar-date,
html[data-rounded] .global-search,
html[data-rounded] .table-search,
html[data-rounded] .compact-select,
html[data-rounded] .side-link,
html[data-rounded] .brand-mark,
html[data-rounded] .dialog-mark,
html[data-rounded] .form-aside-icon,
html[data-rounded] .segmented-control,
html[data-rounded] .channel-tabs { border-radius: var(--r-control); }
html[data-rounded] textarea.form-control,
html[data-rounded] .form-textarea { border-radius: min(var(--r-control), 18px); }
html[data-rounded] .segment-button,
html[data-rounded] .channel-tab,
html[data-rounded] .row-action,
html[data-rounded] .row-more,
html[data-rounded] .pagination button,
html[data-rounded] .invoice-action,
html[data-rounded] .invoice-suggest-option,
html[data-rounded] .topbar-menu-item,
html[data-rounded] .sub-link,
html[data-rounded] .dropdown-menu-custom button,
html[data-rounded] .stat-icon { border-radius: var(--r-item); }
html[data-rounded] .status-badge,
html[data-rounded] .trend,
html[data-rounded] .step-label { border-radius: var(--r-badge); }
html[data-rounded] .status-pill,
html[data-rounded] .filter-chip,
html[data-rounded] .page-tab > span { border-radius: var(--r-pill); }

.appearance-color-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.appearance-color-picker {
  width: 44px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-control, 8px);
  background: var(--surface);
  cursor: pointer;
}
.appearance-color-hex {
  max-width: 120px;
  font-family: monospace;
  font-weight: 600;
}
.appearance-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.appearance-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.appearance-swatch:hover {
  transform: scale(1.08);
}
.appearance-swatch.is-selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--orange);
  transform: scale(1.08);
}

.shipping-label-layout { align-items: start; }
.shipping-preview-wrapper { display: flex; justify-content: center; padding: 8px 0; }
.shipping-label-preview {
  width: 100%;
  max-width: 340px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1.4;
}
.sl-section { padding: 12px 14px; border-bottom: 1.5px solid #111; }
.sl-section-to { min-height: 140px; }
.sl-section-from { min-height: 92px; }
.sl-caption {
  margin-bottom: 2px;
  color: #333;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.sl-caption-spaced { margin-top: 10px; }
.sl-recipient-name { margin-bottom: 4px; color: #000; font-size: 15px; font-weight: 700; }
.sl-recipient-address, .sl-recipient-location, .sl-phone { color: #111; font-size: 12px; }
.sl-sender-name { color: #000; font-size: 13px; font-weight: 700; }
.sl-meta-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1.5px solid #111; }
.sl-meta-cell { padding: 10px 14px 12px; }
.sl-meta-left { border-right: 1.5px solid #111; }
.sl-meta-item + .sl-meta-item { margin-top: 10px; }
.sl-meta-value {
  margin-top: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #444;
  color: #000;
  font-size: 12.5px;
  font-weight: 700;
}
.sl-meta-value-last { padding-bottom: 0; border-bottom: 0; }
.sl-care-banner {
  padding: 10px 8px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 991.98px) {
  .sidebar-collapse-button { display: none !important; }
  .main-shell { margin-left: 0; }
  .sidebar { z-index: 1210; transform: translateX(-110%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 1200; inset: 0; display: none; background: rgba(15, 29, 22, .35); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .breadcrumb-line { display: none !important; }
  .topbar-actions { margin-inline-start: auto; }
  .details-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-year-filter { width: 100%; }
  .dashboard-year-filter .form-select { flex: 1; }
  .form-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .form-field-wide { grid-column: auto; }
  .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .topbar { padding: 0 14px; }
  .topbar-date { display: none; }
  .notification-dropdown { position: static; }
  .notification-dropdown-menu {
    top: calc(100% + 4px);
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 360px;
    margin: 0 auto;
  }
  .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-chart-card, .product-sales-card { padding: 12px; }
  .invoice-year-chart { height: 210px; }
  .invoice-heading-actions { gap: 8px; }
  .invoice-heading-actions .invoice-pdf-options { width: 100%; }
  .invoice-signature-group { flex: 1; min-width: 0; }
  .invoice-heading-buttons { width: 100%; }
  .invoice-heading-buttons .button { flex: 1; }
  .totals-list { width: 100%; margin: 0; }
  .invoice-totals-wrapper { padding: 16px; }
}

/* Page Load & Navigation Transition Animation */
.page-loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--orange), #f28c64);
  box-shadow: 0 0 8px rgba(216, 79, 37, .45);
  opacity: 0;
  pointer-events: none;
  transition: width .32s cubic-bezier(.22, 1, .36, 1), opacity .22s ease;
}
.page-loader-bar.is-loading {
  width: 76%;
  opacity: 1;
}
.page-loader-bar.is-done {
  width: 100%;
  opacity: 0;
  transition: width .16s ease-out, opacity .25s ease .12s;
}
.page-content,
.auth-card {
  transition: opacity .16s ease, transform .18s cubic-bezier(.22, 1, .36, 1);
}
.page-content.is-page-entering,
.auth-card.is-page-entering {
  animation: pageEnter .24s cubic-bezier(.22, 1, .36, 1) both;
}
body.is-page-leaving .page-content,
body.is-page-leaving .auth-card {
  opacity: .55;
  transform: translateY(4px);
}
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .page-loader-bar,
  .page-content,
  .auth-card,
  .page-content.is-page-entering,
  .auth-card.is-page-entering {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
