:root {
  --blue: #0a57d5;
  --blue-2: #2f6bed;
  --blue-soft: #edf5ff;
  --navy: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5edf7;
  --panel: #ffffff;
  --page: #fbf9ff;
  --sidebar: #f8fbff;
  --green: #07845d;
  --green-soft: #dffbea;
  --red: #e0242d;
  --red-soft: #ffe8e8;
  --orange: #f97316;
  --orange-soft: #ffedd5;
  --yellow: #f8bb18;
  --shadow: 0 16px 40px rgba(31, 41, 55, .07);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, .06);
  --radius: 8px;
  --sidebar-w: 262px;
  --topbar-h: 66px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--navy);
  background: var(--page);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid #dce7f4;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}

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

.brand-mark,
.mini-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(10, 87, 213, .22);
}

.logo-mark {
  background: #fff;
  overflow: hidden;
  border: 1px solid #d9e4f1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.logo-mark img,
.branded-auth-photo img,
.branded-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name {
  color: #111827;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.brand-sub {
  color: #0a57d5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
  margin-top: 5px;
}

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

.nav-list,
.sidebar-footer {
  display: grid;
  gap: 6px;
  padding: 0 18px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: 0;
  color: #5d708b;
  font-size: 16px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: #eef6ff;
  color: var(--blue);
}

.nav-item.active {
  background: #edf5ff;
  color: #0b61ff;
  font-weight: 700;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 0;
  width: 4px;
  height: 100%;
  background: #1f63ff;
}

.sidebar-spacer { flex: 1; }

.quick-add {
  margin: 20px 25px 17px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(10, 87, 213, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.sidebar-footer {
  border-top: 1px solid #dce7f4;
  padding-top: 22px;
  padding-bottom: 26px;
}

.content-wrap {
  grid-column: 2;
  min-width: 0;
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid #e4ebf5;
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
}

.search {
  width: min(450px, 48vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f6f9fc;
  color: #9aa8bd;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #334155;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #63728a;
  background: transparent;
  position: relative;
}

.icon-btn:hover {
  background: #f3f7fd;
  color: var(--blue);
}

.icon-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--red);
  border: 1px solid #fff;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 15px;
  border-left: 1px solid #e4ebf5;
}

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

.profile span {
  display: block;
  color: #4e6382;
  font-size: 11px;
  text-align: right;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 28%, #ffe3c7 0 17%, transparent 18%),
    linear-gradient(140deg, #9bd7e1 0 45%, #e9f4ff 46% 100%);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d5e1ef;
}

.page {
  width: 100%;
  max-width: none;
  padding: 32px clamp(24px, 3vw, 44px) 58px;
}

.page.full { max-width: none; }

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

.crumb {
  color: #8a9ab1;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.crumb span {
  color: #0b61ff;
}

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

h1 {
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 8px;
  color: #61708d;
  font-size: 16px;
  line-height: 1.45;
  max-width: 590px;
}

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

.btn {
  min-height: 45px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #d8e2ef;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: #b8c7db;
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 14px 28px rgba(10, 87, 213, .24);
}

.btn.dark {
  background: #101827;
  border-color: #101827;
  color: #fff;
}

.btn.red {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn.green {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.btn.small {
  min-height: 29px;
  padding: 0 12px;
  font-size: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-grid > *,
.grid-2 > *,
.recommendations > *,
.metric-split > * {
  min-width: 0;
}

.stat-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.stat-card,
.table-card,
.panel {
  background: var(--panel);
  border: 1px solid #edf1f8;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  min-height: 98px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card.stack {
  min-height: 170px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
}

.stat-card.stack > div:last-child {
  grid-column: 1 / -1;
  align-self: end;
}

.stat-icon,
.med-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.stat-label {
  color: #667792;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 850;
  margin-top: 3px;
}

.stat-note {
  color: #8798b3;
  font-size: 13px;
  margin-top: 16px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #10a34a;
  font-weight: 900;
  font-size: 14px;
}

.trend.down { color: var(--red); }
.trend.warn { color: #f04e00; }

.soft-blue { background: var(--blue-soft); color: #2667f0; }
.soft-green { background: #dcfbec; color: var(--green); }
.soft-orange { background: #fff3e7; color: #c0570b; }
.soft-red { background: var(--red-soft); color: var(--red); }
.soft-yellow { background: #fff7d7; color: #d98a00; }
.soft-violet { background: #f2e8ff; color: #7a2bf3; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, .95fr);
  gap: 24px;
  margin-bottom: 24px;
}

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

.expiry-layout {
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, .85fr);
}

.panel {
  padding: 24px;
}

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

.panel h2 {
  font-size: 22px;
  line-height: 1.2;
}

.panel-sub {
  color: #52647e;
  margin-top: 4px;
  font-size: 14px;
}

.table-card {
  overflow: hidden;
  margin-bottom: 24px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th {
  text-align: left;
  color: #6b7b95;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  background: #fbfcfe;
  padding: 18px 25px;
}

th.sortable { cursor: pointer; }

td {
  padding: 20px 25px;
  border-top: 1px solid #edf1f6;
  color: #40506a;
  vertical-align: middle;
}

.row-title {
  color: var(--navy);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.1;
}

.row-sub {
  margin-top: 4px;
  color: #6a7b97;
  font-size: 12px;
  line-height: 1.25;
}

.medicine-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 190px;
}

.med-icon {
  width: 40px;
  height: 40px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .45px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.safe,
.badge.completed,
.badge.verified { background: var(--green-soft); color: var(--green); }
.badge.low,
.badge.processing { background: #ffedd5; color: #d54c00; }
.badge.expiring,
.badge.critical,
.badge.urgent { background: #ffe0e2; color: var(--red); }
.badge.ordered,
.badge.review { background: #eaf2ff; color: #075fe7; }

.unit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  border-radius: 7px;
  background: #eef2f7;
  color: #44536a;
  font-size: 12px;
  font-weight: 900;
}

.stock-bar {
  width: 96px;
  height: 5px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
  margin-top: 5px;
}

.stock-bar span {
  display: block;
  height: 100%;
  width: var(--w, 70%);
  background: var(--c, var(--green));
  border-radius: inherit;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 25px;
  background: #fbfcfe;
  border-top: 1px solid #edf1f6;
  color: #52647e;
  font-size: 13px;
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-dot {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #dce6f3;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.page-dot.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #ffd1d1;
  background: linear-gradient(90deg, #fff4f4, #fffaf8);
  border-radius: 8px;
  padding: 24px 25px;
  margin-bottom: 28px;
}

.alert-copy {
  display: flex;
  align-items: center;
  gap: 20px;
}

.alert-copy strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.alert-copy p {
  color: #52647e;
  line-height: 1.45;
}

.floating-action {
  position: fixed;
  right: 31px;
  bottom: 31px;
  z-index: 25;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 30px rgba(10, 87, 213, .27);
}

.queue-list {
  display: grid;
  gap: 25px;
}

.queue-item strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #202938;
}

.queue-item small {
  display: flex;
  justify-content: space-between;
  color: #8a9ab1;
  margin-top: 3px;
}

.hero-metric {
  min-height: 183px;
  background: linear-gradient(135deg, #2868e9, #3c73f4);
  color: #fff;
  border-radius: 8px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 10px;
  box-shadow: 0 18px 32px rgba(47, 107, 237, .25);
}

.hero-metric .big {
  font-size: 34px;
  font-weight: 900;
}

.category-list {
  display: grid;
  gap: 18px;
}

.category-line {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 12px;
  align-items: center;
}

.category-line i {
  width: 8px;
  height: 32px;
  border-radius: 999px;
  background: var(--blue-2);
}

.chart-card {
  padding: 28px 32px;
}

.bar-chart {
  height: 280px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 1px;
  padding: 35px 8px 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.94)),
    radial-gradient(circle at 80% 30%, rgba(27, 185, 161, .35), transparent 34%);
  border-radius: 8px;
  position: relative;
}

.bar {
  display: grid;
  align-items: end;
  gap: 0;
  height: 100%;
}

.bar b,
.bar span {
  display: block;
  border-radius: 8px 8px 0 0;
}

.bar b { height: var(--b); background: var(--blue-2); }
.bar span { height: var(--s); background: #cfe2fb; opacity: .95; }

.chart-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  color: #8ba0bb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .6px;
  text-align: center;
}

.legend {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 18px;
  color: #52647e;
  font-size: 13px;
  font-weight: 700;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: -1px;
}

.progress-list {
  display: grid;
  gap: 17px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  color: #687893;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.progress {
  height: 7px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--c, var(--blue-2));
  border-radius: inherit;
}

.toast {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(480px, 80vw);
  background: #fff;
  border: 1px solid #e6edf6;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.toast-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--blue-2);
}

.urgency-list {
  display: grid;
  gap: 16px;
}

.urgency-row {
  display: grid;
  grid-template-columns: 1.6fr .8fr .7fr .7fr;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  background: #fff;
  border: 1px solid #edf1f6;
  border-left: 8px solid var(--red);
  border-radius: 8px;
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
}

.urgency-row.orange { border-left-color: var(--orange); }
.urgency-row.yellow { border-left-color: var(--yellow); }

.days-pill {
  justify-self: end;
  min-width: 82px;
  text-align: center;
  border-radius: 999px;
  padding: 10px 13px;
  background: #ffe0e2;
  color: var(--red);
  font-weight: 900;
  font-size: 12px;
}

.days-pill.orange { background: #ffead2; color: #e15a00; }
.days-pill.yellow { background: #fff2bf; color: #c46f00; }

.action-stack {
  display: grid;
  gap: 13px;
}

.wide-action {
  min-height: 57px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dark-panel {
  color: #fff;
  background: #111a2e;
  border: 0;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .18);
}

.dark-panel .panel-sub,
.dark-panel .progress-top {
  color: #aab7c9;
}

.audit-list {
  display: grid;
  gap: 17px;
  color: #40506a;
  font-weight: 700;
  line-height: 1.35;
}

.audit-list li::marker { color: var(--blue-2); }
.audit-list li.green::marker { color: #10b981; }

.form-card {
  padding: 30px 32px;
}

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

.field {
  display: grid;
  gap: 9px;
}

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

.field label {
  color: #40506a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  border: 1px solid #d9e4f1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 16px;
  color: #1f2937;
  outline: 0;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(47, 107, 237, .12);
  background: #fff;
}

.help-text {
  color: #8ca0bc;
  font-size: 12px;
}

.arrival-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.incoming-layout {
  grid-template-columns: minmax(360px, .82fr) minmax(620px, 1.18fr);
}

.incoming-layout > * {
  min-width: 0;
}

.incoming-history-card {
  overflow: visible;
  padding: 0;
  min-width: 0;
}

.incoming-history-card .panel-head {
  padding: 24px 24px 0;
  margin-bottom: 18px;
}

.incoming-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.arrival-row {
  display: grid;
  grid-template-columns: 1.7fr .7fr .6fr .9fr .7fr;
  gap: 16px;
  align-items: center;
  padding: 17px 24px;
  border-top: 1px solid #edf1f6;
}

.incoming-arrival-row {
  grid-template-columns: minmax(220px, 1.7fr) minmax(118px, .78fr) minmax(82px, .5fr) minmax(128px, .75fr) minmax(132px, .78fr);
  gap: 14px;
  min-width: 760px;
  padding: 15px 24px;
}

.incoming-history-card .medicine-cell {
  min-width: 0;
}

.incoming-history-card .medicine-cell > div {
  min-width: 0;
}

.incoming-history-card .row-title {
  overflow-wrap: anywhere;
}

.arrival-batch {
  color: #43536d;
  font-size: 13px;
  white-space: nowrap;
}

.arrival-quantity,
.arrival-status {
  white-space: nowrap;
}

.arrival-time {
  white-space: nowrap;
  color: #43536d;
}

.metric-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.insight-card {
  min-height: 190px;
  display: grid;
  align-content: center;
  padding: 32px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.36)),
    radial-gradient(circle at 82% 46%, rgba(80, 210, 223, .65), transparent 24%),
    linear-gradient(135deg, #eff8fb, #cde5ea);
  border-radius: 8px;
  overflow: hidden;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  background: #eef4fb;
  border-radius: 8px;
}

.tab {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  color: #5d708b;
  background: transparent;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab.active {
  color: var(--blue);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
}

.report-filters {
  min-height: 122px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  position: relative;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  background: #eef4fb;
  border-radius: 8px;
}

.segmented button,
.segmented a {
  min-height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5d708b;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.segmented button.active,
.segmented a.active {
  background: #fff;
  color: #1f2937;
  box-shadow: var(--shadow-sm);
}

.recommendations {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.prediction {
  color: #fff;
  background:
    linear-gradient(135deg, #101827, #152a50),
    radial-gradient(circle at 92% 80%, rgba(47, 107, 237, .24), transparent 20%);
  min-height: 220px;
  padding: 32px;
}

.prediction p {
  color: #aeb9ca;
  margin: 13px 0 25px;
  line-height: 1.5;
}

.notice {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #ffd1d1;
  background: #fff7f8;
  border-radius: 8px;
  padding: 24px;
}

.stock-alert-item {
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.stock-alert-medicine {
  flex: 1 1 220px;
  min-width: 0;
  align-items: flex-start;
}

.stock-alert-medicine > div {
  min-width: 0;
}

.stock-alert-medicine .row-title {
  overflow-wrap: anywhere;
}

.stock-alert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.stock-alert-meta span {
  overflow-wrap: anywhere;
}

.stock-alert-badge {
  flex: 0 0 auto;
  align-self: flex-start;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f5f4ff;
}

.auth-visual {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 60px;
  color: #fff;
}

.auth-visual.login {
  background: linear-gradient(145deg, #2d6de8 0%, #59dfb9 100%);
}

.auth-visual.register {
  background:
    radial-gradient(circle at 85% 65%, rgba(255,255,255,.08), transparent 20%),
    linear-gradient(160deg, #0f62df, #064ebc);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  width: 120%;
  height: 180px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  transform: rotate(-9deg);
}

.auth-visual::before { top: 18%; left: -10%; }
.auth-visual::after { bottom: 12%; left: -8%; }

.login-visual-inner,
.register-visual-inner {
  position: relative;
  z-index: 1;
  width: min(420px, 82vw);
  text-align: center;
}

.visual-photo {
  height: 330px;
  border-radius: 8px;
  border: 12px solid rgba(255, 255, 255, .16);
  box-shadow: 0 26px 58px rgba(0,0,0,.22);
  background:
    radial-gradient(circle at 53% 62%, rgba(81, 255, 243, .45) 0 7%, transparent 8%),
    radial-gradient(circle at 42% 48%, rgba(80, 255, 241, .65) 0 5%, transparent 6%),
    linear-gradient(90deg, transparent 42%, rgba(57, 225, 215, .25) 42% 45%, transparent 46%),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.43)),
    linear-gradient(135deg, #08232a, #0b7d86);
}

.branded-auth-photo {
  background: #fff;
  display: grid;
  place-items: center;
  padding: 54px;
}

.register-photo {
  height: 355px;
  border-radius: 8px;
  box-shadow: 0 24px 52px rgba(0,0,0,.26);
  background:
    radial-gradient(circle at 50% 25%, #d7f4ff 0 14%, transparent 15%),
    linear-gradient(75deg, transparent 43%, rgba(255,255,255,.86) 44% 62%, transparent 63%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.02)),
    linear-gradient(135deg, #91d8e2, #337f9e);
  margin-top: 34px;
}

.auth-brand-title {
  font-size: 22px;
  font-weight: 900;
  margin-top: 18px;
}

.auth-copy {
  margin: 16px auto 0;
  color: rgba(255,255,255,.78);
  line-height: 1.45;
  max-width: 320px;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 28px;
  text-align: left;
}

.feature-tile {
  min-height: 88px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  border-radius: 8px;
}

.feature-tile strong {
  display: block;
  margin: 8px 0 5px;
}

.feature-tile p {
  color: rgba(255,255,255,.74);
  font-size: 12px;
  line-height: 1.35;
}

.trust-pill {
  position: absolute;
  left: 44px;
  bottom: 42px;
  min-height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.16);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 800;
}

.auth-form-side {
  display: grid;
  place-items: center;
  padding: 50px;
}

.auth-box {
  width: min(360px, 100%);
}

.auth-card {
  background: #fff;
  border: 1px solid #e0e6f0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.auth-card h1 {
  font-size: 20px;
  margin-bottom: 7px;
}

.auth-card .subtitle {
  font-size: 13px;
  margin: 0 0 20px;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form label {
  display: block;
  color: #4b5565;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.input-wrap {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d5dfed;
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
}

.input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  min-width: 0;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #667792;
  font-size: 12px;
}

.link {
  color: #0b61ff;
  font-weight: 800;
}

.auth-footer {
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid #e7edf6;
  text-align: center;
  color: #667792;
  font-size: 12px;
}

.register-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-legal {
  margin-top: 18px;
  text-align: center;
  color: #667792;
  font-size: 12px;
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  border-top: 1px solid #e7edf6;
  margin-top: 30px;
  padding-top: 18px;
  font-size: 11px;
  color: #7c8da6;
  font-weight: 800;
}

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 15%, rgba(89, 223, 185, .45), transparent 22%),
    linear-gradient(135deg, #f7fbff 0%, #edf5ff 45%, #f7fffb 100%);
  color: var(--navy);
}

.landing-nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 72px);
}

.landing-nav .brand {
  padding: 0;
}

.landing-hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 42px;
  padding: 20px clamp(22px, 5vw, 72px) 70px;
}

.landing-copy h1 {
  font-size: clamp(42px, 6vw, 78px);
  line-height: .98;
  max-width: 760px;
}

.landing-copy p {
  color: #53647f;
  font-size: 18px;
  line-height: 1.6;
  margin: 22px 0 32px;
  max-width: 620px;
}

.landing-visual {
  min-height: 520px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 47% 22%, #eef8ff 0 10%, transparent 11%),
    linear-gradient(74deg, transparent 42%, rgba(255,255,255,.85) 43% 62%, transparent 63%),
    radial-gradient(circle at 75% 38%, rgba(89, 223, 185, .5), transparent 26%),
    linear-gradient(145deg, #d9eff8, #9fd3e4);
  box-shadow: 0 30px 70px rgba(30, 87, 151, .16);
  border: 1px solid rgba(255,255,255,.85);
}

.branded-visual {
  background: #fff;
  display: grid;
  place-items: center;
  padding: clamp(70px, 10vw, 150px);
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.landing-stat {
  padding: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid #dce7f4;
  border-radius: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  background: rgba(15, 23, 42, .34);
  padding: 20px;
}

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

.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toast-message {
  position: fixed;
  right: 24px;
  top: 86px;
  z-index: 90;
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #10213d;
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .24);
}

.svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg.fill { fill: currentColor; stroke: none; }

@media (max-width: 1080px) {
  :root { --sidebar-w: 236px; }
  .page { padding: 28px 24px 48px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2,
  .grid-2.equal,
  .recommendations { grid-template-columns: 1fr; }
  .report-filters { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-102%); }
  .sidebar.open { transform: translateX(0); }
  .content-wrap { grid-column: 1; }
  .menu-toggle { display: grid; place-items: center; }
  .topbar { padding: 0 16px; }
  .search { width: 100%; }
  .profile div { display: none; }
  .page-head { flex-direction: column; }
  .stat-grid,
  .stat-grid.three,
  .metric-split,
  .landing-stats { grid-template-columns: 1fr; }
  .arrival-row,
  .urgency-row { grid-template-columns: 1fr; }
  .incoming-arrival-row {
    grid-template-columns: minmax(220px, 1.7fr) minmax(118px, .78fr) minmax(82px, .5fr) minmax(128px, .75fr) minmax(132px, .78fr);
  }
  .days-pill { justify-self: start; }
  .auth-page,
  .landing-hero { grid-template-columns: 1fr; }
  .auth-visual { min-height: auto; padding: 48px 24px; }
  .auth-form-side { padding: 42px 22px; }
  .landing-visual { min-height: 340px; }
}

@media (max-width: 560px) {
  .top-actions .icon-btn:nth-child(2),
  .top-actions .icon-btn:nth-child(3) { display: none; }
  .page { padding: 22px 16px 42px; }
  h1 { font-size: 28px; }
  .toolbar,
  .filter-row,
  .table-footer,
  .alert-banner,
  .alert-copy,
  .panel-head { align-items: stretch; flex-direction: column; }
  .btn { width: 100%; }
  .floating-action { right: 18px; bottom: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .trust-pill { left: 20px; bottom: 20px; }
}
