/* ============================================================ depot admin app */

:root {
  --bg: #eef4f9;
  --card: #ffffff;
  --line: #e3ecf3;
  --line-strong: #d2e3ee;
  --ink: #0c2a3a;
  --muted: #6d8797;
  --brand: #0891b2;
  --brand-strong: #0e7490;
  --brand-soft: #e2f6fb;
  --ok: #0f9d63;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(12, 42, 58, 0.05);
  --shadow: 0 14px 30px -22px rgba(12, 42, 58, 0.5);
  --app-max: 980px;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(1200px 500px at 50% -220px, #dff2f9 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.sheet-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.25;
}

a {
  color: var(--brand-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  display: block;
}

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

.small {
  font-size: 11.5px;
}

.strong {
  font-weight: 700;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------- app bar */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(135deg, #0b6379 0%, #0891b2 55%, #06b6d4 100%);
  color: #fff;
  box-shadow: 0 10px 26px -20px rgba(8, 60, 80, 0.9);
}

.appbar-inner {
  max-width: var(--app-max);
  margin: 0 auto;
  height: 60px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.brand-text {
  min-width: 0;
}

.brand-text strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-text span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.appbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.status-pill:active {
  transform: scale(0.97);
}

.avatar-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.avatar-btn .avatar {
  background: transparent;
  color: #fff;
  width: auto;
  height: auto;
  font-size: 13px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}

.avatar.big {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a7bcc8;
  flex: 0 0 auto;
}

.dot.on {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* ------------------------------------------------------------- layout */

.app-main {
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 16px 14px 96px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.page-head-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.page-head h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

#pageSub {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  max-width: 46ch;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.back-btn {
  margin-top: 2px;
}

.back-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeUp 0.2s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

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

@media (min-width: 720px) {
  .app-main {
    padding: 22px 20px 110px;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .kpis {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  }
}

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

  .two-col > .grid {
    margin-bottom: 0;
  }
}

/* ------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 30px -24px rgba(12, 42, 58, 0.6);
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tab-icon {
  width: 46px;
  height: 26px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background 0.18s ease;
}

.tab-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.tab-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  color: var(--brand-strong);
}

.tab.active .tab-icon {
  background: var(--brand-soft);
}

.tab:active .tab-icon {
  transform: scale(0.94);
}

@media (min-width: 900px) {
  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 14px;
    width: min(660px, calc(100% - 32px));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 10px;
    box-shadow: 0 22px 44px -28px rgba(12, 42, 58, 0.6);
  }

  .tab {
    font-size: 10.5px;
  }
}

/* ------------------------------------------------------------- sheets */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(8, 30, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 75;
  width: min(520px, 100%);
  transform: translate(-50%, 110%);
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -28px 60px -30px rgba(8, 30, 42, 0.6);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet.open {
  transform: translate(-50%, 0);
}

@media (min-width: 900px) {
  .sheet {
    bottom: 16px;
    border-radius: 22px;
  }
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #dce8f0;
  margin: 6px auto 12px;
}

.sheet-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-user strong {
  display: block;
  font-size: 14px;
}

.sheet-user small {
  color: var(--muted);
  font-size: 11px;
}

.sheet-close {
  margin-left: auto;
  font-size: 17px;
  line-height: 1;
  color: #4a6a7d;
}

.sheet-wa {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5fafc;
  color: #35586b;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.sheet-wa .chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  fill: #8ba6b5;
}

.sheet-list {
  display: flex;
  flex-direction: column;
}

.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

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

.sheet-item svg {
  width: 20px;
  height: 20px;
  fill: #3f8ba6;
  flex: 0 0 auto;
}

.sheet-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.sheet-item.danger {
  color: var(--danger);
}

.sheet-item.danger svg {
  fill: var(--danger);
}

.sheet-credit {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: #8ba2b1;
}

/* ------------------------------------------------------------- cards */

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 15px;
}

.card-body.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-body.toolbar .note {
  flex: 1 1 100%;
  font-size: 11px;
  color: var(--muted);
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
}

.kpi .label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.kpi .value {
  margin: 3px 0 2px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi .value.brand {
  color: var(--brand-strong);
}

.kpi .value.ok {
  color: var(--ok);
}

.kpi .value.warn {
  color: var(--warn);
}

.kpi .hint {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}

/* ------------------------------------------------------------- lists */

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.list-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-item.plain {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 0;
}

.list-item.plain:first-child {
  padding-top: 2px;
}

.list-item.plain:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.list-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 0;
}

.list-title a {
  color: var(--ink);
}

.list-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
  color: #46687b;
}

.list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.list-foot .amount {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.list-foot .small {
  font-size: 10.5px;
}

.list .empty {
  border: 0;
  background: transparent;
}

.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.order-items span {
  background: #f1f7fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
  color: #3d6379;
}

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

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.mini-stats div {
  background: #f7fbfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
}

.mini-stats span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
}

.mini-stats b {
  font-size: 11.5px;
  font-weight: 700;
}

.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #fafcfe;
}

.empty strong {
  display: block;
  margin-bottom: 4px;
  color: #3d6379;
  font-size: 13px;
}

/* ------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn.primary {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff;
  box-shadow: 0 10px 20px -14px rgba(8, 145, 178, 0.95);
}

.btn.ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: #28566b;
}

.btn.danger {
  background: #fdeaea;
  border-color: #f6cfcf;
  color: var(--danger);
}

.btn.small {
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 12px;
}

.btn.small svg {
  width: 14px;
  height: 14px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #3d6379;
  cursor: pointer;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #eef5fa;
  color: #48697c;
  font-size: 11px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #eef5fa;
  color: #41677c;
  white-space: nowrap;
}

.badge.BARU {
  background: #e6f2fd;
  color: #1d6eb8;
}

.badge.DIPROSES {
  background: #fdf3e1;
  color: #a16207;
}

.badge.DIANTAR {
  background: #eaf0fd;
  color: #3f56b8;
}

.badge.HUTANG {
  background: #fdf1e6;
  color: #b45309;
}

.badge.LUNAS {
  background: #e6f7ee;
  color: #0f7a52;
}

.badge.BATAL {
  background: #fdeaea;
  color: #b91c1c;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar > select {
  width: auto;
  min-width: 148px;
  flex: 0 1 auto;
}

.toolbar > input[type="search"] {
  width: auto;
  flex: 1 1 180px;
}

.toolbar .note {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: #3d6379;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fbfdfe;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236d8797' d='M7 9.5 12 15l5-5.5H7Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 30px;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar .field {
  flex: 1 1 130px;
  margin: 0;
}

/* ------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.data th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

table.data td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

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

/* ------------------------------------------------------------- order modal */

.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  font-size: 12.5px;
}

.kv > span:nth-child(odd) {
  color: var(--muted);
}

.kv > span:nth-child(even) {
  text-align: right;
  word-break: break-word;
}

/* ------------------------------------------------------------- whatsapp */

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

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

.qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.qr-box img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 8px;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.qr-placeholder svg {
  width: 44px;
  height: 44px;
  fill: #bcd7e4;
}

.wa-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #28566b;
}

.steps {
  margin: 0;
  padding-left: 18px;
  color: #3d6379;
  font-size: 12.5px;
  line-height: 1.6;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

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

.timeline-item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.timeline-item .meta span {
  font-size: 11px;
  color: var(--muted);
}

/* ------------------------------------------------------------- charts */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 150px;
  padding: 0 2px;
}

.bar-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.bar-col b {
  font-size: 8.5px;
  font-weight: 600;
  color: var(--muted);
}

.bar-col i {
  width: 100%;
  max-width: 26px;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #22d3ee, #0891b2);
}

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

.legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

/* ------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 30, 42, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -24px 60px -24px rgba(8, 30, 42, 0.55);
  animation: sheetUp 0.22s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }

  .modal {
    border-radius: 20px;
    max-width: 100%;
    animation: pop 0.16s ease;
  }
}

@keyframes pop {
  from {
    transform: scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 15px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f6fafc;
  color: #4a6a7d;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .modal-foot {
    padding-bottom: 12px;
  }
}

/* ------------------------------------------------------------- toast */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100% - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 11px 14px;
  border-radius: 12px;
  background: #0f2f40;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 16px 34px -20px rgba(0, 0, 0, 0.65);
  animation: toastIn 0.18s ease;
}

.toast.ok {
  background: #0f7a52;
}

.toast.err {
  background: #b91c1c;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------- footer */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 16px 4px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.app-footer span:first-child {
  font-weight: 600;
  color: #3d6379;
}

/* ------------------------------------------------------------- login */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 22px 16px;
  background: radial-gradient(900px 420px at 50% -140px, #d8f1fa 0%, #eaf3f8 55%, #e4eef6 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 26px 60px -34px rgba(12, 42, 58, 0.55);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.login-brand .brand-mark {
  width: 42px;
  height: 42px;
  border: 0;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  box-shadow: 0 10px 22px -14px rgba(8, 145, 178, 0.9);
}

.login-brand .brand-mark svg {
  width: 22px;
  height: 22px;
}

.login-brand h1 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.login-brand .sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.login-card .sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.login-error {
  display: none;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f6cfcf;
  border-radius: 11px;
  background: #fdf0f0;
  color: #b91c1c;
  font-size: 12px;
}

.login-error.show {
  display: block;
}

.login-card .btn {
  width: 100%;
  margin-top: 4px;
}

.login-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.login-credit {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: #7f9aab;
}

@media (max-width: 380px) {
  .brand-text strong {
    font-size: 12.5px;
  }

  .appbar-inner {
    padding: 0 10px;
  }

  .status-pill {
    padding: 0 8px;
  }

  .tab {
    font-size: 9px;
  }
}