:root {
  --sidebar-width: 200px;
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --panel: #ffffff;
  --page: #f5f5f7;
  --primary: #0071e3;
  --primary-strong: #005bb5;
  --accent: #ff9f0a;
  --soft: #eef5ff;
  --warning: #fff7e6;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Helvetica, "Helvetica Neue", Arial, "Myanmar Text", Padauk, Pyidaungsu, sans-serif;
  background: var(--page);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

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

.settings-sidebar {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  padding: 18px 12px;
  overflow: auto;
  background: rgba(245, 245, 247, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
  transition: opacity 160ms ease, padding 220ms ease, border-width 220ms ease;
}

.app-shell.sidebar-collapsed .settings-sidebar {
  padding: 0;
  overflow: hidden;
  border-right-width: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-toggle {
  position: fixed;
  z-index: 25;
  top: 18px;
  left: calc(var(--sidebar-width) + 12px);
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: saturate(180%) blur(14px);
  transition: left 220ms ease, background 160ms ease;
}

.sidebar-toggle::before {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  margin: auto;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M9 3v18M16 9l-3 3 3 3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M9 3v18M16 9l-3 3 3 3'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(180deg);
  transition: transform 220ms ease;
}

.sidebar-toggle:hover {
  background: #ffffff;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  left: 14px;
}

.app-shell.sidebar-collapsed .sidebar-toggle::before {
  transform: rotate(0deg);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 14px;
}

.sidebar-brand.brand-tab {
  width: 100%;
  min-height: auto;
  margin-bottom: 16px;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.sidebar-brand.brand-tab:hover,
.sidebar-brand.brand-tab.active {
  background: #ffffff;
}

.sidebar-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.sidebar-brand h1 {
  font-size: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

h2 {
  font-size: 22px;
  line-height: 1.35;
}

h3 {
  font-size: 18px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Keep one clear title for each workspace; chart periods remain as useful context. */
.dashboard-head > div > .eyebrow,
.panel-head:not(.dashboard-trend-head) > div > .eyebrow,
.raw-page-head > div > .eyebrow {
  display: none;
}

.dashboard-head h2,
.panel-head:not(.dashboard-trend-head) h2,
.raw-page-head h2 {
  color: #0066cc;
}

.cloud-sync-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.cloud-sync-panel .panel-head {
  margin-bottom: 0;
}

.cloud-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cloud-auth-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.cloud-auth-form .form-actions {
  margin: 0;
}

.cloud-signed-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cloud-signed-in .form-actions {
  margin: 0;
}

.cloud-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--muted);
  background: #f2f2f7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cloud-status[data-tone="success"] { color: #176b31; background: #e9f9ee; }
.cloud-status[data-tone="error"] { color: #9d2118; background: #fff0ef; }
.cloud-status[data-tone="loading"] { color: #8a4f00; background: #fff7e6; }

.tabs {
  display: grid;
  gap: 1px;
}

.tab,
.secondary,
.ghost,
.primary {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.tabs .tab {
  font-size: 14px;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.62);
}

.tab.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 3px 8px rgba(0, 0, 0, 0.14);
}

.nav-icon::before {
  content: "";
  width: 15px;
  height: 15px;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.order-icon {
  background: linear-gradient(180deg, #5ac8fa 0%, #007aff 100%);
}

.order-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h10a2 2 0 0 1 2 2v18l-3-2-2 2-2-2-2 2-2-2-3 2V4a2 2 0 0 1 2-2Zm2 5v2h6V7H9Zm0 4v2h6v-2H9Zm0 4v2h4v-2H9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h10a2 2 0 0 1 2 2v18l-3-2-2 2-2-2-2 2-2-2-3 2V4a2 2 0 0 1 2-2Zm2 5v2h6V7H9Zm0 4v2h6v-2H9Zm0 4v2h4v-2H9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.dashboard-icon {
  background: linear-gradient(180deg, #5ac8fa 0%, #007aff 100%);
}

.dashboard-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 20V10h3v10H4Zm6 0V4h3v16h-3Zm6 0v-7h3v7h-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 20V10h3v10H4Zm6 0V4h3v16h-3Zm6 0v-7h3v7h-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.invoice-icon {
  background: linear-gradient(180deg, #bf5af2 0%, #7d2ae8 100%);
}

.invoice-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm1 3v5h8V5H8Zm0 8v2h2v-2H8Zm4 0v2h2v-2h-2Zm4 0v6h-2v-6h2Zm-8 4v2h2v-2H8Zm4 0v2h2v-2h-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm1 3v5h8V5H8Zm0 8v2h2v-2H8Zm4 0v2h2v-2h-2Zm4 0v6h-2v-6h2Zm-8 4v2h2v-2H8Zm4 0v2h2v-2h-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.receivable-icon {
  background: linear-gradient(180deg, #ffb340 0%, #ff7a1a 100%);
}

.receivable-icon::before {
  width: 18px;
  height: 18px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3c4.4 0 8 1.4 8 3.2v2.1c0 1.8-3.6 3.2-8 3.2s-8-1.4-8-3.2V6.2C4 4.4 7.6 3 12 3Zm-8 8c1.7 1.4 4.7 2.1 8 2.1s6.3-.8 8-2.1v2.1c0 1.8-3.6 3.2-8 3.2s-8-1.4-8-3.2V11Zm0 4.8c1.7 1.4 4.7 2.1 8 2.1s6.3-.8 8-2.1V18c0 1.8-3.6 3.2-8 3.2S4 19.8 4 18v-2.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3c4.4 0 8 1.4 8 3.2v2.1c0 1.8-3.6 3.2-8 3.2s-8-1.4-8-3.2V6.2C4 4.4 7.6 3 12 3Zm-8 8c1.7 1.4 4.7 2.1 8 2.1s6.3-.8 8-2.1v2.1c0 1.8-3.6 3.2-8 3.2s-8-1.4-8-3.2V11Zm0 4.8c1.7 1.4 4.7 2.1 8 2.1s6.3-.8 8-2.1V18c0 1.8-3.6 3.2-8 3.2S4 19.8 4 18v-2.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.payable-summary-icon {
  background: linear-gradient(180deg, #7da2ff 0%, #3158c9 100%);
}

.payable-summary-icon::before {
  width: 18px;
  height: 18px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cg%20transform%3D%27rotate%28-14%2012%2012%29%27%3E%3Cpath%20d%3D%27M4.8%207.4C8%205.8%2016%208.8%2019.2%207.2V16.6C16%2018.2%208%2015.2%204.8%2016.8V7.4Z%27%20stroke%3D%27white%27%20stroke-width%3D%272%27%20stroke-linejoin%3D%27round%27/%3E%3Cpath%20d%3D%27M7.4%209.1C10%207.9%2014%2010.1%2016.6%208.9M7.4%2012C10%2010.8%2014%2013.2%2016.6%2012M7.4%2014.9C10%2013.7%2014%2015.9%2016.6%2014.7%27%20stroke%3D%27white%27%20stroke-width%3D%271.45%27%20stroke-linecap%3D%27round%27/%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%271.6%27%20stroke%3D%27white%27%20stroke-width%3D%271.45%27/%3E%3C/g%3E%3C/svg%3E");
}

.raw-material-icon {
  background: linear-gradient(180deg, #ff6b5f 0%, #ff3b30 100%);
  border: 0;
}

.raw-material-icon::before {
  width: 17px;
  height: 17px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M4%208.5L12%204L20%208.5V16L12%2020L4%2016V8.5Z%27%20stroke%3D%27%23FFFFFF%27%20stroke-width%3D%272.2%27%20stroke-linejoin%3D%27round%27/%3E%3Cpath%20d%3D%27M4.5%208.7L12%2013L19.5%208.7M12%2013V20%27%20stroke%3D%27%23FFFFFF%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E");
}

.purchase-module-icon {
  background: linear-gradient(180deg, #ffb340 0%, #ff6b00 100%);
}

.purchase-module-icon::before {
  width: 17px;
  height: 17px;
  background: #ffffff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 8V7a5 5 0 0 1 10 0v1h1.4L20 21H4L5.6 8H7Zm2 0h6V7a3 3 0 0 0-6 0v1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 8V7a5 5 0 0 1 10 0v1h1.4L20 21H4L5.6 8H7Zm2 0h6V7a3 3 0 0 0-6 0v1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.distributor-icon {
  background: linear-gradient(180deg, #63e6a3 0%, #30d158 100%);
}

.distributor-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8.5 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm7-1a3.25 3.25 0 1 1 0-6.5 3.25 3.25 0 0 1 0 6.5ZM2.5 20c.5-4.2 2.6-6.5 6-6.5s5.5 2.3 6 6.5h-12Zm11.7 0a9.4 9.4 0 0 0-2.1-5.1c.9-.9 2.1-1.4 3.4-1.4 3 0 4.9 2.2 5.4 6.5h-6.7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8.5 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm7-1a3.25 3.25 0 1 1 0-6.5 3.25 3.25 0 0 1 0 6.5ZM2.5 20c.5-4.2 2.6-6.5 6-6.5s5.5 2.3 6 6.5h-12Zm11.7 0a9.4 9.4 0 0 0-2.1-5.1c.9-.9 2.1-1.4 3.4-1.4 3 0 4.9 2.2 5.4 6.5h-6.7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.settings-icon {
  background: linear-gradient(180deg, #8e8e93 0%, #48484a 100%);
}

.settings-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a7.2 7.2 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A7.2 7.2 0 0 0 7 6L4.6 5l-2 3.5 2 1.5c-.1.5-.1 1-.1 1.5s0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a7.2 7.2 0 0 0 2.6 1.5L10 22h4l.4-2.5A7.2 7.2 0 0 0 17 18l2.4 1 2-3.5-2-1.5ZM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2-1.5-2-3.5-2.4 1a7.2 7.2 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A7.2 7.2 0 0 0 7 6L4.6 5l-2 3.5 2 1.5c-.1.5-.1 1-.1 1.5s0 1 .1 1.5l-2 1.5 2 3.5 2.4-1a7.2 7.2 0 0 0 2.6 1.5L10 22h4l.4-2.5A7.2 7.2 0 0 0 17 18l2.4 1 2-3.5-2-1.5ZM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.content-pane {
  padding: 24px clamp(18px, 4vw, 48px) 48px;
}

.purchase-module-view.active {
  display: grid;
  grid-template-rows: auto minmax(720px, 1fr);
  gap: 10px;
  min-height: calc(100vh - 72px);
}

.purchase-module-frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.purchase-module-embed {
  min-height: 760px;
  border-radius: 12px;
  overflow: hidden;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-head {
  margin-bottom: 18px;
}

.dashboard-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

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

.dashboard-metric {
  min-height: 132px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dashboard-metric span,
.dashboard-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-metric strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 28px;
  line-height: 1.1;
}

.dashboard-metric.accent-blue { border-top: 4px solid #007aff; }
.dashboard-metric.accent-amber { border-top: 4px solid #ff9f0a; }
.dashboard-metric.accent-orange { border-top: 4px solid #ff7a1a; }
.dashboard-metric.accent-teal { border-top: 4px solid #3158c9; }

.dashboard-trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-trend-panel {
  min-height: 320px;
}

.dashboard-trend-head {
  align-items: flex-start;
}

.dashboard-trend-chart {
  height: 235px;
  margin-top: 12px;
}

.dashboard-trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-grid-line {
  stroke: #e6e6eb;
  stroke-width: 1;
}

.trend-axis-label {
  fill: #86868b;
  font-size: 12px;
  font-family: Helvetica, "Helvetica Neue", Arial, "Myanmar Text", sans-serif;
}

.trend-line {
  fill: none;
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-orders { stroke: #007aff; }
.trend-deliveries { stroke: #34c759; }

.purchase-module-view.active {
  display: grid;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 20px;
  align-items: start;
}

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

.panel {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.embedded-report {
  margin-top: 20px;
}

.raw-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.raw-month-filter {
  width: 180px;
  margin: 0;
}

.raw-month-filter select {
  min-height: 38px;
}

.raw-inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.raw-inventory-main,
.inventory-section,
.raw-side-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.raw-side-stack {
  position: sticky;
  top: 104px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-title small {
  color: var(--muted);
  font-weight: 700;
}

.inventory-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.inventory-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.inventory-card:active {
  cursor: grabbing;
}

.inventory-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(29, 29, 31, 0.16);
}

.inventory-card:hover {
  border-color: rgba(29, 29, 31, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.inventory-card.active {
  border-color: rgba(29, 29, 31, 0.9);
  box-shadow: inset 0 0 0 2px rgba(29, 29, 31, 0.72), 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.inventory-card.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #ffffff;
  background: #1d1d1f;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.inventory-card.dragging {
  opacity: 0.46;
  transform: scale(0.98);
}

.inventory-card.drag-over {
  border-color: rgba(52, 199, 89, 0.9);
  box-shadow: inset 0 0 0 2px rgba(52, 199, 89, 0.72), 0 8px 20px rgba(52, 199, 89, 0.16);
}

.inventory-card span,
.inventory-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-card strong {
  font-size: 26px;
  line-height: 1;
}

.inventory-card.tone-rice { background: #f3f9ff; border-color: #cfe5fb; }
.inventory-card.tone-rice::before { background: #78aee8; }
.inventory-card.tone-corn { background: #fff9e8; border-color: #f2dfa3; }
.inventory-card.tone-corn::before { background: #d5a72d; }
.inventory-card.tone-prawn { background: #fff5f3; border-color: #f1cdc8; }
.inventory-card.tone-prawn::before { background: #d98278; }
.inventory-card.tone-chili { background: #fff4f2; border-color: #efccc7; }
.inventory-card.tone-chili::before { background: #c96a5d; }
.inventory-card.tone-oil { background: #fff8e9; border-color: #efd9a5; }
.inventory-card.tone-oil::before { background: #c89a35; }
.inventory-card.tone-sugar { background: #f7fbff; border-color: #d8e5ef; }
.inventory-card.tone-sugar::before { background: #9db5c8; }
.inventory-card.tone-onion { background: #faf7ff; border-color: #ddd1ef; }
.inventory-card.tone-onion::before { background: #9c7fc4; }
.inventory-card.tone-seasoning { background: #f5fbf4; border-color: #cfe5cb; }
.inventory-card.tone-seasoning::before { background: #82b878; }
.inventory-card.tone-neutral { background: #ffffff; border-color: #d8d8de; }
.inventory-card.tone-neutral::before { background: #a6a6ad; }
.inventory-card.tone-packaging { background: #f8f8fb; border-color: #dcdce6; }
.inventory-card.tone-packaging::before { background: #8e8e93; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px 10px;
  align-items: baseline;
  text-align: right;
}

.mini-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-stats strong {
  font-size: 18px;
}

.raw-table-wrap table,
.raw-entry-table {
  min-width: 850px;
}

.raw-entry-table tr.month-break td {
  padding: 12px 10px 7px;
  border-top: 3px solid #b8bac4;
  border-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.raw-entry-table tr.month-break span {
  display: inline-flex;
  padding: 3px 8px;
  color: var(--ink);
  background: #f5f5f7;
  border: 1px solid #d8d8de;
  border-radius: 999px;
}

.num-cell {
  text-align: right;
  white-space: nowrap;
}

.action-cell {
  width: 64px;
  text-align: center;
}

.compact-entry {
  padding: 14px;
}

.compact-entry label {
  margin-bottom: 10px;
}

.compact-grid {
  gap: 8px;
}

.balance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.balance-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.balance-preview strong {
  font-size: 18px;
}

.add-item-toggle {
  width: 100%;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.06);
}

.side-panel {
  position: sticky;
  top: 104px;
}

.panel-head,
.items-head,
.actions,
.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head.compact {
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  align-content: start;
}

label span {
  min-height: 18px;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.month-year-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(105px, 0.8fr);
  gap: 8px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.grid {
  display: grid;
  gap: 14px;
}

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

.info-line {
  margin: 14px 0 20px;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--soft);
  font-weight: 700;
}

.info-line strong,
.info-line small,
.shortcut-button strong,
.shortcut-button small {
  display: block;
}

.info-line small,
.shortcut-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.shortcut-suggestions {
  display: none;
  margin-top: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.shortcut-suggestions.open {
  display: grid;
}

.shortcut-button {
  min-height: 48px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.shortcut-button:last-child {
  border-bottom: 0;
}

.shortcut-button:hover,
.shortcut-button:focus {
  background: var(--soft);
  outline: none;
}

.status-field {
  margin-bottom: 18px;
}

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

.items-head {
  margin: 12px 0;
}

.items-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 150px 42px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f8f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.icon {
  width: 42px;
  height: 42px;
  align-self: end;
  border-radius: 8px;
  color: #c03525;
  background: #fff0ee;
  font-size: 24px;
  line-height: 1;
}

.item-row input,
.item-row select {
  height: 44px;
}

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

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

.summary-strip div,
.metrics div,
.metric-button {
  padding: 14px;
  border-radius: 8px;
  background: #f8f8fa;
}

.metric-button {
  width: 100%;
  border: 1px solid transparent;
  color: inherit;
  text-align: left;
}

.metric-button:hover,
.metric-button:focus {
  border-color: var(--primary);
  background: var(--soft);
  outline: none;
}

.summary-strip span,
.metrics span,
.metric-button span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-strip strong,
.metrics strong,
.metric-button strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.primary {
  color: #ffffff;
  background: var(--primary);
}

.primary:hover {
  background: var(--primary-strong);
}

.secondary {
  color: var(--primary-strong);
  background: var(--soft);
}

.ghost {
  color: var(--muted);
  background: #f2f2f7;
}

.danger {
  color: #9d3420;
  background: #ffebe6;
}

.badge {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary-strong);
  background: var(--soft);
  border-radius: 8px;
}

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

.order-list.empty {
  padding: 16px;
  color: var(--muted);
  background: #f8f8fa;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.order-card {
  padding: 13px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.order-card strong,
.settings-row strong {
  display: block;
}

.order-card small,
.settings-row small {
  color: var(--muted);
}

.invoice-order-list {
  display: grid;
  gap: 8px;
}

.section-label {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-filters {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 1.2fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.report-filters,
.invoice-filters,
.invoice-history-date-search,
.payable-summary-filters {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
}

.invoice-filters .ghost {
  grid-column: 1 / -1;
  min-height: 38px;
}

.invoice-history-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.invoice-history-search {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-history-main-search {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1.2fr);
  gap: 8px;
}

.invoice-history-date-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.compact-field {
  min-width: 130px;
  flex: 1 1 130px;
}

.compact-field input,
.compact-field select,
.compact-clear {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.compact-clear {
  flex: 0 0 auto;
}

.invoice-history-month {
  grid-template-columns: minmax(120px, 1fr) minmax(95px, 0.7fr);
}

.initial-payment-box {
  margin-bottom: 12px;
  padding: 12px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.initial-payment-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr);
  gap: 8px;
}

.history-card {
  background: #fffdf7;
}

.company-info-form {
  display: grid;
  gap: 12px;
  max-width: 680px;
  padding: 10px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.company-logo-editor {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.company-logo-editor img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

.invoice-order-card {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  overflow: hidden;
}

.invoice-order-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.invoice-order-card.delivered {
  background: #f0fbf5;
  border-color: #bfead0;
}

.invoice-order-card.delivered::before {
  background: #30d158;
}

.invoice-order-card.not-delivered {
  background: #fff4f2;
  border-color: #ffd1cc;
}

.invoice-order-card.not-delivered::before {
  background: #ff453a;
}

.invoice-order-card.partial {
  background: #fff8e8;
  border-color: #ffe1a6;
}

.invoice-order-card.partial::before {
  background: #ff9f0a;
}

.invoice-order-card span,
.invoice-order-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.invoice-order-card:hover {
  border-color: rgba(29, 29, 31, 0.22);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.invoice-order-card.active {
  border-color: rgba(29, 29, 31, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(29, 29, 31, 0.48),
    0 4px 14px rgba(0, 0, 0, 0.08);
}

.invoice-order-card.active::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #ffffff;
  background: #1d1d1f;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.invoice-order-card.active::before {
  width: 7px;
}

.invoice-preview-panel {
  position: sticky;
  top: 24px;
}

.invoice-print-surface {
  min-height: 620px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.invoice-sheet {
  color: #1d1d1f;
}

.invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1d1d1f;
}

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

.invoice-brand img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 14px;
}

.invoice-brand h2 {
  font-size: 24px;
  line-height: 1.25;
  margin-bottom: 4px;
}

.invoice-brand p {
  line-height: 1.4;
}

.invoice-brand p,
.invoice-brand small,
.invoice-meta small,
.invoice-meta span,
.invoice-customer span,
.invoice-customer small {
  color: var(--muted);
}

.invoice-brand small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.25;
}

.invoice-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.invoice-meta strong {
  font-size: 20px;
  letter-spacing: 0;
}

.invoice-customer {
  margin: 10px 0;
}

.invoice-customer-card {
  padding: 8px;
  background: #f8f8fa;
  border-radius: 8px;
}

.invoice-customer span,
.invoice-customer strong,
.invoice-customer small {
  display: block;
}

.invoice-customer-details {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
}

.invoice-customer-details div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 6px;
}

.invoice-customer-details dt,
.invoice-customer-details dd {
  margin: 0;
}

.invoice-customer-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-customer-details dd {
  color: var(--ink);
  font-weight: 700;
}

.invoice-table {
  min-width: 0;
  table-layout: auto;
}

.invoice-table th,
.invoice-table td {
  padding: 6px 8px;
}

.invoiceQtyInput {
  width: 86px;
  min-height: 36px;
  text-align: right;
}

.invoice-qty-print {
  display: none;
}

.invoice-remaining {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.invoice-total {
  display: flex;
  align-items: baseline;
  justify-content: end;
  gap: 12px;
  margin: 10px 0 0;
  padding: 8px 0 0;
  color: var(--ink);
  background: transparent;
  border-top: 2px solid var(--ink);
  border-radius: 0;
  font-size: 18px;
  font-weight: 800;
}

.invoice-total span {
  color: var(--muted);
  line-height: 1.2;
}

.invoice-total strong {
  text-align: right;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.delivered {
  color: #0f6b45;
  background: #e3f7ed;
}

.status-pill.not-delivered {
  color: #8b3d12;
  background: var(--warning);
}

.status-pill.partial {
  color: #5f3ab8;
  background: #eee8ff;
}

.status-pill.advance {
  color: #0a5f9f;
  background: #e5f4ff;
}

.receivable-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.62fr);
}

.receivable-metrics {
  margin-bottom: 16px;
}

.receivable-filters {
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(160px, 0.9fr) auto;
}

.receivable-filters .ghost {
  align-self: end;
}

.receivable-period-filter {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(230px, 1fr);
  gap: 14px;
  align-items: end;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.receivable-period-filter > label {
  min-width: 0;
}

.receivable-period-filter .month-year-fields {
  grid-template-columns: minmax(150px, 1.2fr) minmax(120px, 0.8fr);
  gap: 10px;
}

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

.receivable-table tbody tr[data-receivable-customer] {
  cursor: pointer;
}

.payable-summary-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.68fr);
}

.payable-summary-metrics {
  margin-bottom: 16px;
}

.payable-summary-filters {
  grid-template-columns: minmax(210px, 1.3fr) minmax(160px, 0.9fr) minmax(125px, 0.7fr) minmax(120px, 0.65fr) minmax(150px, 0.85fr) auto;
}

.payable-summary-filters .ghost {
  align-self: end;
}

.payable-summary-table {
  min-width: 920px;
}

.payable-summary-table tbody tr[data-payable-supplier] {
  cursor: pointer;
}

.payable-summary-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payable-detail-panel .info-line {
  margin-bottom: 12px;
}

.payable-payment-form {
  margin-bottom: 12px;
}

.payable-payment-form .form-actions {
  grid-template-columns: 1fr auto auto;
}

.payable-payment-form .primary {
  width: 100%;
}

.payable-order-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.payable-order-card-selected {
  border-color: #34c7a3;
  background: #f0fffb;
  box-shadow: inset 3px 0 0 #34c7a3;
}

.payable-order-card strong,
.payable-order-card small {
  display: block;
}

.payable-order-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.payable-order-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payable-order-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.payable-order-facts span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.payable-order-money {
  display: grid;
  gap: 2px;
}

.payable-history-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.payable-history-line .edit-button {
  flex: 0 0 auto;
}

.selected-row td {
  background: #f1f7ff;
}

.receivable-payment-panel .primary {
  width: 100%;
}

.receivable-invoice-details {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.receivable-invoice-details .section-label {
  margin: 0 0 2px;
}

.receivable-invoice-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfd;
}

.receivable-invoice-head,
.receivable-invoice-total,
.receivable-invoice-line,
.receivable-grand-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.receivable-invoice-head {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 9px 10px;
  background: #f2f2f7;
}

.receivable-invoice-head small,
.receivable-invoice-payment,
.receivable-grand-total small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.receivable-invoice-line {
  padding: 7px 10px;
  border-top: 1px solid #ececf0;
  font-size: 12px;
}

.receivable-invoice-line span:nth-child(2),
.receivable-invoice-line b {
  white-space: nowrap;
  text-align: right;
}

.receivable-invoice-total {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.receivable-invoice-total b {
  grid-column: 2 / -1;
  white-space: nowrap;
  text-align: right;
}

.receivable-invoice-payment {
  display: block;
  padding: 0 10px 9px;
}

.receivable-grand-total {
  padding: 11px;
  border-radius: 8px;
  color: #075d9b;
  background: #edf5ff;
}

.receivable-grand-total b {
  white-space: nowrap;
  text-align: right;
}

.receivable-grand-total small {
  grid-column: 1 / -1;
}

.payment-history-list {
  display: grid;
  gap: 8px;
}

.payment-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payment-history-row strong,
.payment-history-row small {
  display: block;
}

.payment-history-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-history-row b {
  white-space: nowrap;
}

.payment-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-action {
  min-height: 34px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--primary-strong);
  background: var(--soft);
  font-weight: 800;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: end;
}

.hidden {
  display: none;
}

.table-wrap {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  background: #f5f5f7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.num-cell {
  text-align: right;
  white-space: nowrap;
}

.action-cell {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.invoice-row-button {
  position: relative;
  display: inline-grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  background: #f0ebff;
  box-shadow: inset 0 0 0 1px #d9ceff;
}

.invoice-row-button:hover {
  background: #e8e0ff;
}

.invoice-row-icon {
  position: relative;
  width: 18px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(180deg, #7b61ff 0%, #5f35d6 100%);
  box-shadow: 0 5px 12px rgba(95, 53, 214, 0.25);
}

.invoice-row-icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 4px;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.9), 0 10px 0 rgba(255, 255, 255, 0.72);
}

.invoice-row-icon::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  border-top: 7px solid #c8b9ff;
  border-left: 7px solid transparent;
}

.inline-form {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.side-form {
  display: grid;
  gap: 14px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.helper-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.side-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.product-form {
  grid-template-columns: minmax(180px, 1fr) 150px auto auto;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: #f2f2f7;
  border-radius: 8px;
  line-height: 1;
}

.icon-button::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
}

.edit-button:hover,
.edit-button:focus {
  color: #007aff;
  background: #edf5ff;
  outline: none;
}

.trash-button:hover,
.trash-button:focus {
  color: #ff3b30;
  background: #fff2f1;
  outline: none;
}

.edit-button::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 17.25V20h2.75L17.8 8.95 15.05 6.2 4 17.25Zm15.7-10.95a1 1 0 0 0 0-1.4l-1.6-1.6a1 1 0 0 0-1.4 0l-1.25 1.25 2.75 2.75 1.5-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 17.25V20h2.75L17.8 8.95 15.05 6.2 4 17.25Zm15.7-10.95a1 1 0 0 0 0-1.4l-1.6-1.6a1 1 0 0 0-1.4 0l-1.25 1.25 2.75 2.75 1.5-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.trash-button::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 21a2 2 0 0 1-2-2V8h14v11a2 2 0 0 1-2 2H7ZM9 4h6l1 2h4v2H4V6h4l1-2Zm0 7v7h2v-7H9Zm4 0v7h2v-7h-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 21a2 2 0 0 1-2-2V8h14v11a2 2 0 0 1-2 2H7ZM9 4h6l1 2h4v2H4V6h4l1-2Zm0 7v7h2v-7H9Zm4 0v7h2v-7h-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.context-menu {
  position: fixed;
  z-index: 50;
  min-width: 172px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  backdrop-filter: saturate(180%) blur(16px);
}

.context-menu button {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: #ff453a;
  background: transparent;
  border-radius: 6px;
  font-weight: 850;
  text-align: left;
}

.context-menu button:hover {
  background: #ffecec;
}

@media (max-width: 920px) {
  .panel-head,
  .items-head,
  .raw-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .raw-month-filter {
    width: 100%;
  }

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

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

  .settings-sidebar {
    position: sticky;
    z-index: 10;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-shell.sidebar-collapsed .settings-sidebar {
    display: none;
  }

  .sidebar-toggle,
  .app-shell.sidebar-collapsed .sidebar-toggle {
    top: 12px;
    right: auto;
    left: 12px;
  }

  .sidebar-brand {
    padding: 0 4px 12px;
  }

  .sidebar-brand img {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .tabs,
  .report-actions {
    width: 100%;
    overflow-x: auto;
  }

  .tabs {
    display: flex;
    padding-bottom: 2px;
  }

  .tab {
    min-width: max-content;
  }

  .split,
  .raw-inventory-layout,
  .grid.two,
  .report-filters,
  .invoice-history-main-search,
  .receivable-filters,
  .initial-payment-grid,
  .summary-strip,
  .metrics {
    grid-template-columns: 1fr;
  }

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

  .dashboard-trend-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-trend-head {
    align-items: stretch;
  }

  .receivable-period-filter,
  .receivable-period-filter .month-year-fields {
    grid-template-columns: 1fr;
  }

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

  .item-row .icon {
    width: 100%;
  }

  .inline-form,
  .product-form {
    grid-template-columns: 1fr;
  }

  .company-logo-editor {
    grid-template-columns: 1fr;
  }

  .side-panel,
  .raw-side-stack {
    position: static;
  }

  .inventory-dashboard {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }

  .invoice-preview-panel {
    position: static;
  }

  .invoice-customer {
    grid-template-columns: 1fr;
  }

  .invoice-customer-details div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media print {
  .settings-sidebar,
  .sidebar-toggle,
  body:not(.printing-invoice) .order-entry-layout,
  body:not(.printing-invoice) #invoiceView,
  body:not(.printing-invoice) #receivableView,
  body:not(.printing-invoice) #rawMaterialView,
  body:not(.printing-invoice) #distributorView,
  body:not(.printing-invoice) #settingsView,
  body:not(.printing-invoice) .report-actions,
  body:not(.printing-invoice) .report-filters,
  body.printing-invoice #orderView,
  body.printing-invoice #receivableView,
  body.printing-invoice #rawMaterialView,
  body.printing-invoice #distributorView,
  body.printing-invoice #settingsView,
  body.printing-invoice #invoiceView > .invoice-layout > .panel:first-child,
  body.printing-invoice .invoice-preview-panel > .panel-head,
  body.printing-invoice .initial-payment-box,
  .toast {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content-pane {
    padding: 0;
  }

  .view,
  #orderView,
  body.printing-invoice #invoiceView,
  #reportsView {
    display: block !important;
  }

  .panel {
    box-shadow: none;
    border: 0;
  }

  body.printing-invoice .invoice-layout,
  body.printing-invoice .invoice-preview-panel {
    display: block;
  }

  body.printing-invoice .invoice-print-surface {
    min-height: 0;
    padding: 0;
    border: 0;
  }

  body.printing-invoice .invoiceQtyInput,
  body.printing-invoice .invoice-remaining {
    display: none;
  }

  body.printing-invoice .invoice-qty-print {
    display: inline;
  }
}
