﻿.codex-calc-grid button{padding:0!important;min-height:42px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;line-height:1!important}
:root {
  --bg: #f7f1e8;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffdfa;
  --panel-alt: #f4e7d5;
  --ink: #1d1b18;
  --muted: #6e6255;
  --accent: #b85c38;
  --accent-dark: #8a4126;
  --accent-soft: #e7c19d;
  --line: #dbcbb5;
  --success: #2d6a4f;
  --danger: #a83b32;
  --warning: #9a6d22;
  --shadow: 0 24px 50px rgba(87, 58, 31, 0.09);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-brand-panel {
  justify-self: end;
  width: min(100%, 390px);
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.login-brand-panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.warning-badge {
  background: #fff1c7;
  color: #7a4d0b;
  border: 1px solid rgba(154, 109, 34, 0.18);
}

.alert-card {
  border-color: rgba(154, 109, 34, 0.28);
  background: linear-gradient(180deg, rgba(255, 249, 232, 0.96), rgba(255, 253, 249, 0.92));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(184, 92, 56, 0.2), transparent 28%),
    radial-gradient(circle at right bottom, rgba(231, 193, 157, 0.22), transparent 30%),
    linear-gradient(135deg, #faf5ed, #eee0cf);
}

a {
  color: inherit;
  text-decoration: none;
}

.link-strong {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(155, 119, 82, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(184, 92, 56, 0.55);
  box-shadow: 0 0 0 4px rgba(184, 92, 56, 0.12);
  background: #fff;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(155, 119, 82, 0.16);
}

.checkbox-field input {
  width: auto;
  margin: 0;
}

.checkbox-field span {
  margin: 0;
}

.special-option {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(219, 203, 181, 0.72);
}

.special-option .helper-text {
  margin: 0;
}

.special-note[hidden] {
  display: none;
}

.customer-special-list {
  display: grid;
  gap: 10px;
}

.customer-special-row {
  border: 1px solid rgba(219, 203, 181, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.customer-special-row summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.customer-special-row summary span {
  color: var(--muted);
  font-size: 13px;
}

.special-detail-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.special-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.special-detail-grid > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(244, 231, 213, 0.5);
  border: 1px solid rgba(219, 203, 181, 0.72);
}

.special-detail-grid strong,
.special-detail-grid span {
  display: block;
}

.special-detail-grid span {
  margin-top: 6px;
  color: var(--muted);
}

.notification-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(155, 119, 82, 0.2);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 18px 44px rgba(87, 58, 31, 0.16);
}

.notification-panel strong,
.notification-panel span {
  display: block;
}

.notification-panel span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.notification-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  transition: grid-template-columns 0.25s ease;
}

.layout.sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(28, 24, 20, 0.96), rgba(43, 31, 22, 0.96)),
    #221a14;
  color: #f8efe4;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.brand-mark {
  width: 78px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
}

.brand-text p {
  margin: 4px 0 0;
  color: rgba(248, 239, 228, 0.7);
  font-size: 13px;
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8efe4;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-meta {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-meta p {
  margin: 0;
}

.sidebar-meta p + p {
  margin-top: 4px;
}

.sidebar nav {
  display: grid;
  gap: 10px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  color: #f8efe4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  min-width: 0;
  font-size: 14px;
}

.sidebar nav a::before {
  content: attr(data-icon);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar nav a span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.sidebar nav a:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

.layout.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

.layout.sidebar-collapsed .brand-text,
.layout.sidebar-collapsed .sidebar-meta,
.layout.sidebar-collapsed .sidebar nav a span {
  display: none;
}

.layout.sidebar-collapsed .sidebar nav a {
  justify-content: center;
  padding-inline: 0;
}

.content {
  padding: 26px;
}

.content-shell {
  max-width: 1480px;
  margin: 0 auto;
  min-width: 0;
}

.top-action-icons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.top-action-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(155, 119, 82, 0.18);
  box-shadow: 0 10px 22px rgba(87, 58, 31, 0.08);
  font-size: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.top-action-icons a:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 14px 26px rgba(87, 58, 31, 0.12);
}

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

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

.mail-summary-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(244,231,213,0.72));
  border: 1px solid rgba(184, 92, 56, 0.14);
  box-shadow: 0 12px 26px rgba(87, 58, 31, 0.05);
}

.mail-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mail-summary-card strong {
  display: block;
  font-size: 16px;
}

.revision-timeline {
  display: grid;
  gap: 12px;
}

.revision-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(155, 119, 82, 0.16);
}

.revision-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.revision-head span {
  color: var(--muted);
  font-size: 13px;
}

.revision-card p {
  margin: 0 0 8px;
}

.revision-lines {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

.revision-items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.revision-item-block {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(244, 231, 213, 0.56);
  border: 1px solid rgba(184, 92, 56, 0.12);
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.mail-raw-box {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid rgba(155, 119, 82, 0.16);
  background: rgba(255,255,255,0.7);
  padding: 10px 12px 12px;
}

.mail-raw-box summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 10px;
}

.page-topbar h2,
.page-topbar p {
  margin: 0;
}

.page-topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.card,
.hero,
.stat-card,
.shipment-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
  margin-bottom: 22px;
}

.hero {
  padding: 24px;
  margin-bottom: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 26%),
    linear-gradient(135deg, rgba(184, 92, 56, 0.95), rgba(235, 192, 133, 0.92));
  color: white;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: end;
}

.hero h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.02;
}

.hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.88);
}

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

.dashboard-hero-metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hero-metric {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-metric span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.9;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 40px;
}

.card-header,
.shipment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.card-header h2,
.card-header h3,
.shipment-header h2,
.shipment-header h3 {
  margin: 0;
}

.card-header p,
.shipment-header p {
  margin: 6px 0 0;
}

.actions,
.result-grid,
.segmented,
.pill-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(184, 92, 56, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(184, 92, 56, 0.28);
  filter: saturate(1.05);
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button.secondary {
  background: linear-gradient(135deg, #f6ebdc, #ecd8c0);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid rgba(155, 119, 82, 0.18);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid rgba(155, 119, 82, 0.18);
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.button.small {
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 13px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

.full {
  grid-column: 1 / -1;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.shipment-search-form {
  align-items: end;
  grid-template-columns: minmax(260px, 1fr) auto;
}

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

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.flash-success {
  background: #def2e6;
  color: var(--success);
  border-color: rgba(45, 106, 79, 0.14);
}

.flash-danger {
  background: #f8d9d5;
  color: var(--danger);
  border-color: rgba(168, 59, 50, 0.14);
}

.flash-info {
  background: #e8efe9;
  color: #31554a;
  border-color: rgba(49, 85, 74, 0.12);
}

.muted {
  color: var(--muted);
}

.section-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f5e7d4;
  color: #69452b;
  font-size: 13px;
  font-weight: 600;
}

.status-Beklemede {
  background: #f5ebdb;
  color: var(--warning);
}

.status-Kismi-Sevk-Edildi {
  background: #efe4d7;
  color: #8d4d28;
}

.status-Tamamlandi {
  background: #def2e6;
  color: var(--success);
}

.narrow {
  max-width: 520px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.detail-grid > div,
.summary-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 203, 181, 0.8);
}

.detail-grid strong,
.result-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-section {
  margin-bottom: 20px;
}

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

.result-box {
  min-width: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.result-box strong {
  font-size: 28px;
}

.table-shell {
  border: 1px solid rgba(219, 203, 181, 0.9);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.table-shell table {
  margin: 0;
}

.table-shell thead th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(244, 231, 213, 0.72);
}

.table-shell tbody tr:last-child td {
  border-bottom: 0;
}

.fit-table {
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}

.fit-table th,
.fit-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 8px 7px;
}

.fit-table.compact th,
.fit-table.compact td {
  font-size: 11px;
  line-height: 1.35;
  padding: 7px 6px;
}

.fit-pair {
  display: block;
  line-height: 1.34;
}

.fit-pair strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
}

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

.item-section {
  padding: 18px;
  border: 1px solid rgba(219, 203, 181, 0.9);
  border-radius: 22px;
  background: rgba(240, 228, 210, 0.36);
}

.item-section-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.item-section-header h3 {
  margin: 0;
}

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 120px 84px;
  gap: 10px;
  margin-top: 12px;
}

.item-grid-head {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.item-row-block {
  padding: 14px;
  margin-top: 14px;
  border: 1px solid rgba(219, 203, 181, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  animation: rise-in 0.28s ease;
}

.item-row-block.row-fade-out {
  animation: fade-out 0.18s ease forwards;
}

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

.shipment-form {
  display: grid;
  grid-template-columns: 120px 110px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.compact-inline-form {
  grid-template-columns: minmax(110px, 128px) minmax(90px, 104px) minmax(140px, 1fr) auto;
  align-items: end;
}

.stacked-shipment-form {
  grid-template-columns: minmax(120px, 1fr) minmax(88px, 108px);
  gap: 8px;
  align-items: end;
}

.inline-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.inline-field span {
  margin: 0;
  font-size: 11px;
}

.note-field input {
  min-width: 0;
}

.stacked-shipment-form .note-field {
  grid-column: 1 / -1;
}

.compact-submit {
  min-width: 92px;
  white-space: nowrap;
}

.full-submit {
  grid-column: 1 / -1;
  width: 100%;
}

.shipment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shipment-summary .badge {
  background: #f6eee4;
}

.shipment-card {
  padding: 20px;
  margin-bottom: 18px;
}

.segmented {
  padding: 5px;
  border-radius: 16px;
  background: rgba(244, 231, 213, 0.85);
  border: 1px solid rgba(219, 203, 181, 0.9);
}

.segmented a {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.segmented a.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(87, 58, 31, 0.08);
}

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

.action-grid {
  margin-bottom: 14px;
}

.quick-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(219, 203, 181, 0.9);
}

.quick-card h3,
.quick-card p {
  margin: 0;
}

.quick-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}

.action-card .button {
  margin-top: auto;
}

.metric-row {
  display: grid;
  gap: 8px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.metric-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(231, 193, 157, 0.32);
  overflow: hidden;
}

.metric-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), #d89a70);
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 220px;
}

.compact-trend {
  min-height: 180px;
}

.trend-col {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.trend-bar {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: end;
  padding: 6px;
  border-radius: 18px;
  background: rgba(231, 193, 157, 0.2);
}

.compact-trend .trend-bar {
  height: 118px;
}

.trend-bar i {
  display: block;
  width: 100%;
  border-radius: 14px;
  background: linear-gradient(180deg, #e8bf97, var(--accent));
}

.trend-col strong {
  font-size: 14px;
}

.trend-col span {
  color: var(--muted);
  font-size: 12px;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.compact-gallery {
  margin-top: 10px;
}

.image-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(219, 203, 181, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(87, 58, 31, 0.1);
}

.image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.image-card strong {
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

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

.error-list ul {
  margin: 0;
  padding-left: 18px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@media (max-width: 1180px) {
  .hero-grid,
  .split-panels,
  .quick-grid,
  .detail-grid,
  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .stats,
  .two-col,
  .filter-grid,
  .hero-grid,
  .hero-metrics,
  .split-panels,
  .quick-grid,
  .detail-grid,
  .summary-row,
  .item-grid,
  .details-grid,
  .shipment-form {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }

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

  .item-section-header,
  .card-header,
  .page-topbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 620px) {
  .dashboard-hero-metrics {
    grid-template-columns: 1fr;
  }
}

/* Mobile usability pass */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    font-size: 16px;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(184, 92, 56, 0.14), transparent 36%),
      linear-gradient(135deg, #faf5ed, #eee0cf);
  }

  .layout,
  .layout.sidebar-collapsed {
    display: block;
    min-height: 100vh;
  }

  .sidebar,
  .layout.sidebar-collapsed .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    max-height: none;
    padding: 12px 12px 14px;
    gap: 12px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 12px 28px rgba(43, 31, 22, 0.22);
  }

  .sidebar-top {
    align-items: center;
  }

  .brand {
    gap: 9px;
    min-width: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 14px;
  }

  .brand-text h1 {
    font-size: 19px;
    white-space: nowrap;
  }

  .brand-text p,
  .sidebar-meta,
  .sidebar-toggle {
    display: none !important;
  }

  .layout.sidebar-collapsed .brand-text,
  .layout.sidebar-collapsed .sidebar nav a span {
    display: block;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav a,
  .layout.sidebar-collapsed .sidebar nav a {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
  }

  .sidebar nav a::before {
    display: none;
  }

  .sidebar nav a:hover {
    transform: none;
  }

  .content {
    padding: 14px;
  }

  .content-shell {
    max-width: none;
  }

  .hero,
  .card,
  .shipment-card,
  .stat-card {
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 16px;
  }

  .hero h2 {
    font-size: 30px;
    line-height: 1.08;
  }

  .page-topbar h2,
  .card-header h2,
  .shipment-header h2 {
    font-size: 24px;
    line-height: 1.15;
  }

  .card-header h3,
  .shipment-header h3,
  .quick-card h3 {
    font-size: 19px;
  }

  .page-topbar p,
  .card-header p,
  .shipment-header p,
  .quick-card p,
  .muted {
    font-size: 15px;
    line-height: 1.5;
  }

  .hero-metric,
  .detail-grid > div,
  .summary-card,
  .result-box,
  .quick-card,
  .item-section,
  .image-card {
    border-radius: 15px;
    padding: 14px;
  }

  .stats,
  .filter-grid,
  .hero-grid,
  .hero-metrics,
  .dashboard-hero-metrics,
  .split-panels,
  .quick-grid,
  .detail-grid,
  .summary-row,
  .item-grid,
  .details-grid,
  .shipment-form,
  .compact-inline-form,
  .stacked-shipment-form,
  .form-grid.two-col {
    grid-template-columns: 1fr !important;
  }

  .page-topbar,
  .card-header,
  .shipment-header,
  .item-section-header,
  .revision-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .actions,
  .result-grid,
  .segmented,
  .pill-list,
  .shipment-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .button,
  .button.small,
  .compact-submit,
  .full-submit,
  .actions .button,
  .segmented a {
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    white-space: normal;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
  }

  input,
  select,
  textarea,
  button {
    min-height: 48px;
    font-size: 16px;
    border-radius: 13px;
  }

  label span,
  .section-label {
    font-size: 15px;
  }

  textarea {
    min-height: 96px;
  }

  .table-shell {
    max-width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .table-shell table {
    min-width: 720px;
  }

  .fit-table {
    table-layout: auto;
  }

  .fit-table th,
  .fit-table td,
  .fit-table.compact th,
  .fit-table.compact td,
  th,
  td {
    padding: 11px 10px;
    font-size: 13px;
    line-height: 1.42;
  }

  .table-shell thead th {
    font-size: 12px;
  }

  .item-grid-head {
    display: none;
  }

  .item-row-block {
    padding: 14px;
    border-radius: 16px;
  }

  .inline-field,
  .note-field,
  .stacked-shipment-form .note-field,
  .full {
    grid-column: auto;
  }

  .trend-grid {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .trend-col {
    min-width: 62px;
  }

  .trend-bar {
    height: 124px;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .flash {
    border-radius: 14px;
    padding: 14px;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .content {
    padding: 12px 10px;
  }

  .brand-text h1 {
    font-size: 18px;
  }

  .sidebar nav a,
  .layout.sidebar-collapsed .sidebar nav a {
    padding-inline: 12px;
    font-size: 14px;
  }

  .hero,
  .card,
  .shipment-card,
  .stat-card {
    padding: 16px;
  }

  .table-shell table {
    min-width: 700px;
  }
}

.codex-calc-btn{position:fixed;right:18px;bottom:84px;z-index:9000;width:42px;height:42px;border:1px solid rgba(37,99,235,.22);border-radius:999px;background:rgba(255,255,255,.9);box-shadow:0 14px 36px rgba(15,23,42,.16);font-size:19px;cursor:pointer;opacity:.78;transition:.16s ease}.codex-calc-btn:hover{opacity:1;transform:translateY(-1px)}.codex-calc-panel{position:fixed;right:18px;bottom:134px;z-index:9001;width:min(292px,calc(100vw - 28px));padding:14px;border:1px solid rgba(37,99,235,.18);border-radius:18px;background:rgba(255,255,255,.98);box-shadow:0 28px 80px rgba(15,23,42,.22);display:none}.codex-calc-panel.open{display:block}.codex-calc-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-weight:900;color:var(--text,#111827)}.codex-calc-close{border:0;background:#eef2ff;border-radius:9px;width:28px;height:28px;cursor:pointer}.codex-calc-display{width:100%;height:46px;margin-bottom:10px;padding:10px 12px;border:1px solid var(--border,#dbe3ef);border-radius:12px;background:#f8fafc;text-align:right;font:700 20px/1.1 ui-monospace,SFMono-Regular,Menlo,monospace;color:#111827}.codex-calc-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.codex-calc-grid button{border:0;border-radius:12px;padding:11px 0;background:#f1f5f9;color:#111827;font:800 15px/1 Inter,"Segoe UI",sans-serif;cursor:pointer}.codex-calc-grid button:hover{background:#e2e8f0}.codex-calc-grid .op{background:#dbeafe;color:#2563eb}.codex-calc-grid .eq{background:#2563eb;color:#fff}.codex-calc-grid .wide{grid-column:span 2}
