:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --muted: #778399;
  --primary: #0ea5e9;
  --sidebar-grad-1: #69809a;
  --sidebar-grad-2: #5a6f88;
  --green: #16a34a;
  --red: #ef4444;
  --ring: rgba(2,132,199,.25);
  --shadow: 0 8px 24px rgba(15,23,42,.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --modal-top: #3b4f61;
  --modal-top-2: #334556;
  --modal-bg: #f3f5f7;
  --border: #e6ebf0;
  --ink: #0f172a;
  --ink-2: #344256;
  --btn-dark: #3b4f61;
  --btn-dark-2: #2f3f4e;
  --orange: #f97316;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: #0f172a;
}

.ui-modal-page {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 18% 18%, rgba(14,165,233,.05), transparent 55%),
    radial-gradient(900px 520px at 82% 22%, rgba(34,197,94,.05), transparent 52%),
    radial-gradient(760px 520px at 50% 86%, rgba(249,115,22,.04), transparent 52%),
    #a9adb5;
  padding: 26px;
  display: grid;
  place-items: center;
}

.ui-modal {
  width: min(1040px, 100%);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  background: var(--modal-bg);
  position: relative;
}

.ui-topbar {
  height: 72px;
  background: linear-gradient(180deg, var(--modal-top), var(--modal-top-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.ui-topbar .left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ui-topbar .title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .2px;
}

.ui-topbar .right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand-img {
  height: 44px;
  width: 120px;
  border-radius: 6px;
  object-fit: contain;
  background: transparent;
  border: 0;
  padding: 0;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .3px;
}

.logout-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: .18s ease;
}

.logout-btn:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

.ui-topbar .mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .85;
  font-weight: 800;
  font-size: 12px;
  text-transform: lowercase;
}

.ui-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: .18s ease;
}

.ui-close:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.ui-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.ui-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.ui-panel.glow-pass {
  border-color: rgba(34,197,94,.45);
  box-shadow: 0 0 0 4px rgba(34,197,94,.28), var(--shadow);
}

.ui-panel.glow-fail {
  border-color: rgba(239,68,68,.45);
  box-shadow: 0 0 0 4px rgba(239,68,68,.30), var(--shadow);
}

.ui-panel.soft {
  background: #f6fbf7;
  border-color: rgba(34,197,94,.2);
}

.ui-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.ui-table th,
.ui-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  color: #334155;
  background: #fff;
}

.ui-table th {
  background: #f8fafc;
  font-weight: 900;
  color: #475569;
}

.ui-table tbody tr {
  cursor: pointer;
  transition: .14s ease;
}

.ui-table tbody tr:hover td {
  background: #f1f5f9;
}

.ui-table tbody tr.selected td {
  background: rgba(14,165,233,.12);
}

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

.ui-table-wrap {
  overflow: auto;
}

.is-hidden {
  display: none !important;
}

.guest-hide {
  display: none !important;
}

.ui-panel-title {
  font-weight: 800;
  color: var(--ink-2);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ui-panel-title .step {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #334155;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.ui-grid {
  display: grid;
  gap: 12px;
}

.ui-cols-2 { grid-template-columns: 1fr 1fr; }
.ui-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.ui-cols-4 { grid-template-columns: repeat(4, 1fr); }

.pm04-test-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.pm04-test-grid > .ui-field {
  min-width: 0;
}

.ui-field label {
  display: block;
  font-weight: 700;
  color: #4b5563;
  font-size: 12px;
  letter-spacing: .3px;
  margin-bottom: 6px;
}

.ui-field input,
.ui-field select,
.ui-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  outline: none;
  transition: .18s ease;
  color: var(--ink);
}

.ui-field textarea {
  min-height: 120px;
  resize: vertical;
}

.ui-field input::placeholder,
.ui-field textarea::placeholder {
  color: #9aa4b2;
  font-weight: 600;
}

.ui-field input:focus,
.ui-field select:focus,
.ui-field textarea:focus {
  border-color: rgba(14,165,233,.65);
  box-shadow: 0 0 0 6px rgba(14,165,233,.18);
}

.ui-search {
  position: relative;
}

.ui-search svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .55;
}

.ui-search input {
  padding-right: 42px;
}

.ui-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ui-metric {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.ui-metric .name {
  color: #64748b;
  font-weight: 800;
  font-size: 13px;
}

.ui-metric .value {
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.ui-metric.green { border-color: rgba(34,197,94,.25); }
.ui-metric.green .value { color: var(--green); }
.ui-metric.orange { border-color: rgba(249,115,22,.25); }
.ui-metric.orange .value { color: var(--orange); }
.ui-metric.gray { border-color: rgba(148,163,184,.25); }
.ui-metric.gray .value { color: #64748b; }

.ui-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 6px;
}

.ui-btn {
  min-width: 150px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 22px rgba(15,23,42,.12);
  transition: .18s ease;
}

.ui-btn:hover { transform: translateY(-1px); }
.ui-btn:active { transform: translateY(1px); }

.ui-btn.dark { background: linear-gradient(180deg, var(--btn-dark), var(--btn-dark-2)); color: #fff; }
.ui-btn.green { background: linear-gradient(180deg, #22c55e, #16a34a); color: #fff; }
.ui-btn.gray { background: #9ca3af; color: #fff; }
.ui-btn.print { background: linear-gradient(180deg, #475569, #334155); color: #fff; }
.ui-btn.orange { background: linear-gradient(180deg, #fb923c, #f97316); color: #fff; }
.ui-btn.red { background: linear-gradient(180deg, #ef4444, #dc2626); color: #fff; }
.ui-btn.excel {
  background: #e5e7eb;
  color: #111827;
  border: 1px solid #d1d5db;
  box-shadow: 0 12px 22px rgba(15,23,42,.10);
}
.ui-btn.excel:hover { background: #e2e8f0; }
.ui-btn .ui-btn-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: inline-block;
}
.ui-btn.is-off {
  opacity: .45;
  filter: grayscale(1);
}
.ui-btn.is-off:hover {
  transform: none;
}

.ui-export-sheet2 {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

.ui-export-sheet2 .ui-btn {
  min-width: 170px;
  height: 40px;
}

.ui-tabs {
  display: inline-flex;
  gap: 10px;
}

.ui-tab {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  height: 44px;
  padding: 0 16px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
  transition: .18s ease;
}

.ui-tab.active {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border-color: rgba(34,197,94,.35);
  color: #fff;
}

.ui-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 10px;
}

.ui-stepper .node {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #334155;
  background: #e2e8f0;
  border: 2px solid #cbd5e1;
}

.ui-stepper .node.active {
  background: #334155;
  color: #fff;
  border-color: rgba(255,255,255,.35);
}

.ui-stepper .label {
  font-weight: 900;
  color: #334155;
}

.ui-stepper .link {
  width: 62px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
}

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

.ui-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.ui-pill.red { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #b91c1c; }
.ui-pill.orange { background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.35); color: #c2410c; }
.ui-pill.green { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); color: #166534; }
.ui-pill.gray { background: rgba(148,163,184,.14); border-color: rgba(148,163,184,.35); color: #334155; }

.ui-pill.active {
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
  border-color: rgba(14,165,233,.45);
}

@media (max-width: 980px) {
  .ui-cols-4 { grid-template-columns: 1fr 1fr; }
  .ui-cols-3 { grid-template-columns: 1fr; }
  .ui-cols-2 { grid-template-columns: 1fr; }
  .ui-metrics { grid-template-columns: 1fr; }
  .ui-actions { flex-wrap: wrap; }
  .dash-grid {
    grid-template-columns: 1fr 260px;
    grid-template-areas:
      "alert date"
      "summary total"
      "row3 donut"
      "actions actions";
  }
  .dash-row3 { grid-template-columns: 1fr 1fr; }
  .week-event-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .app-topstrip {
    padding: 0 14px;
  }
  .app-header {
    padding: 12px 14px;
  }
  .app-body {
    padding: 12px;
    gap: 12px;
    grid-template-columns: 220px 1fr;
  }
  .sidebar {
    flex-direction: column;
    overflow: visible;
    padding: 12px;
  }
  .nav-item {
    min-width: 0;
    padding: 12px;
  }
  .nav-ico {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .nav-ico svg,
  .nav-ico img {
    width: 32px;
    height: 32px;
  }
  .dash-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .ui-table th,
  .ui-table td {
    font-size: 12px;
    padding: 8px 10px;
  }
  .content {
    overflow-x: auto;
  }
  .dash-grid {
    grid-template-columns: 1fr 240px;
  }
  .week-event-grid {
    grid-template-columns: 1fr;
  }
  .donut {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 520px) {
  .app-topstrip-text {
    font-size: 10px;
  }
  .title .line-1 {
    font-size: 14px;
  }
  .title .line-2 {
    font-size: 12px;
  }
  .brand-img {
    height: 36px;
  }
  .app-header .logout-btn,
  .app-header .role-chip {
    height: 26px;
    font-size: 12px;
    top: 0;
    left: 0;
  }
  .dash-card {
    padding: 12px;
  }
  .ui-field input,
  .ui-field select,
  .ui-field textarea {
    font-size: 14px;
    padding: 10px 12px;
  }
  .ui-btn {
    min-width: 120px;
    height: 38px;
    font-size: 13px;
  }
  .app-body {
    grid-template-columns: 200px 1fr;
  }
  .dash-grid {
    grid-template-columns: 1fr 220px;
  }
  .donut {
    width: 140px;
    height: 140px;
  }
}


.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: min(2000px, 100%);
  margin: 0 auto;
}

.app-topstrip {
  height: 30px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 28px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.app-topstrip-text {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .6px;
  color: #475569;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 34px;
  background: var(--surface);
  border-bottom: 1px solid #e5e7eb;
  gap: 10px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}

.title {
  min-width: 0;
}

.title .line-1 {
  font-weight: 800;
  letter-spacing: .5px;
  font-size: 18px;
}
.title .line-2 {
  margin-top: 4px;
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

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

.app-header .logout-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  cursor: pointer;
  transition: .18s ease;
  box-shadow: none;
  position: relative;
  top: 6px;
  left: -8px;
}

.app-header .logout-btn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.app-header .role-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  position: relative;
  top: 6px;
  left: -8px;
}

.brand-img {
  height: 44px;
  width: auto;
  display: block;
}

.brand.has-real-logo .brand-text,
.brand.has-real-logo .brand-logo {
  display: none;
}

.brand-text {
  font-weight: 900;
  text-transform: lowercase;
  color: #64748b;
  letter-spacing: .2px;
}

.brand-logo {
  display: grid;
  place-items: center;
}

.app-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  padding: 22px;
  background: #f3f4f6;
  min-height: calc(100vh - 210px);
  padding-bottom: 90px;
}

.sidebar {
  background: linear-gradient(180deg, #6b7c93, #445468);
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .2s ease;
  text-align: left;
  box-shadow: 0 8px 20px rgba(15,23,42,.10);
}

.nav-ico {
  display: grid;
  place-items: center;
  border-radius: 16px;
  width: 60px;
  height: 60px;
  color: #0f172a;
  flex: 0 0 60px;
  background: transparent;
}

.nav-ico svg,
.nav-ico img {
  width: 44px;
  height: 44px;
}

.nav-ico.material { background: transparent; }
.nav-ico.newitem { background: transparent; }
.nav-ico.gasket { background: transparent; }
.nav-ico.pm02 { background: transparent; }
.nav-ico.pm04 { background: transparent; }
.nav-ico.hydro { background: transparent; }

.nav-item .label {
  font-weight: 900;
  letter-spacing: .4px;
  font-size: 16px;
}

.label-sub {
  display: block;
  font-size: 14px;
  letter-spacing: .3px;
  margin-top: 2px;
}
.nav-item:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}
.nav-item.active {
  outline: 2px solid rgba(34,197,94,.28);
  box-shadow: 0 10px 26px rgba(34,197,94,.18);
}

.sidebar-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 8px 22px rgba(15,23,42,.12);
}

.sidebar-card-title {
  font-weight: 900;
  color: #0f172a;
  font-size: 14px;
  letter-spacing: .3px;
}

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

.tech-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.tech-rank {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
  color: #0f172a;
  background: #e2e8f0;
}

.tech-rank.rank-1 { background: #fde68a; }
.tech-rank.rank-2 { background: #e2e8f0; }
.tech-rank.rank-3 { background: #fecaca; }

.tech-name {
  font-weight: 800;
  color: #0f172a;
  font-size: 13px;
}

.tech-count {
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #2563eb;
  background: #ffffff;
  border: 1px solid #dbeafe;
  box-shadow: 0 6px 14px rgba(37,99,235,.12);
}

.tech-empty {
  padding: 14px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  color: #64748b;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-areas:
    "alert date"
    "summary total"
    "row3 donut"
    "actions actions";
  gap: 20px;
}

.dash-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
  padding: 18px;
}

.dash-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 2px;
}

.dash-row3 {
  grid-area: row3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.week-event-card {
  grid-area: actions;
  display: grid;
  gap: 14px;
}

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

.week-event-tile {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: grid;
  gap: 8px;
  align-content: start;
}

.week-event-title {
  font-weight: 800;
  color: #334155;
  font-size: 12px;
  letter-spacing: .4px;
}

.week-event-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}

.week-event-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 24px;
  font-weight: 900;
  color: #2563eb;
  box-shadow: 0 6px 16px rgba(15,23,42,.08);
}

.week-event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.week-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.week-event-badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 900;
}

#weekPm02Pass {
  color: #16a34a;
}

#weekPm02Overhaul {
  color: #dc2626;
}

.donut-card {
  grid-area: donut;
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
}

.donut-wrap {
  display: grid;
  place-items: center;
  position: relative;
  padding: 10px 0;
}

.donut {
  width: 180px;
  height: 180px;
}

.donut-track {
  fill: none;
  stroke: var(--red);
  stroke-width: 14;
  opacity: 0.18;
}

.donut-ring {
  fill: none;
  stroke: var(--green);
  stroke-width: 14;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.donut-center {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 2px;
}

.donut-total {
  font-size: 30px;
  font-weight: 900;
  color: #0f172a;
}

.donut-sub {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.donut-percent {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34,197,94,.16);
  color: #15803d;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: .2px;
}

.dash-row3.is-expanded {
  grid-template-columns: 1fr;
}

.dash-row3.is-expanded .late-card {
  display: none;
}

.dash-row3.is-expanded .inquiry-card {
  grid-column: 1 / -1;
}

.cards-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 22px;
}

.alert-card {
  grid-area: alert;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.alert-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(234,88,12,.1);
  color: #f59e0b;
}
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(239,68,68,.35);
}
.alert-text {
  font-weight: 600;
}

.alert-body {
  display: grid;
  gap: 4px;
}

.alert-link {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 800;
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  justify-self: start;
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.date-card, .total-card {
  border-radius: 14px;
  display: grid;
  gap: 8px;
}
.date-card {
  grid-area: date;
  grid-template-columns: 44px 1fr;
  align-items: center;
}
.date-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  display: grid;
  place-items: center;
}
.date-text {
  font-weight: 700;
  white-space: nowrap;
  font-size: 18px;
}

.metric-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(249,115,22,.14);
  color: #f97316;
}

.total-card .metric-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.total-card .metric-icon img {
  width: 44px;
  height: 44px;
}

.metric-title {
  font-weight: 900;
  color: #475569;
  line-height: 1.05;
  font-size: 12px;
}

.total-card .metric-title {
  font-size: 15px;
  line-height: 1.15;
}

.total-value {
  font-size: 42px;
  font-weight: 800;
  color: #111827;
  letter-spacing: 2px;
  text-align: center;
}

.summary-card {
  grid-area: summary;
  display: grid;
  gap: 14px;
}
.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.summary-title {
  font-weight: 800;
}
.summary-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
select {
  appearance: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-weight: 600;
  outline: none;
  transition: .2s ease;
}
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 6px var(--ring);
}
.total {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.progress-wrap {
  padding: 12px;
}
.progress-bar {
  width: 100%;
  height: 22px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
.progress-segment {
  height: 100%;
}
.progress-segment.green {
  background: var(--green);
}
.progress-segment.red {
  background: var(--red);
}
.legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }

.list-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-title {
  font-weight: 800;
}
.inquiry {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.underline {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.list-body {
  display: grid;
  gap: 10px;
}
.list-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 48px 1fr 1fr 80px;
  align-items: center;
  gap: 10px;
}
.chip {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-weight: 800;
}
.tag {
  background: #fff;
  border: 1px dashed #cbd5e1;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  justify-self: start;
}
.name {
  font-weight: 700;
  color: #0f172a;
}
.qty {
  font-weight: 800;
  justify-self: end;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .4px;
  box-shadow: 0 10px 26px rgba(15,23,42,.12);
}
.btn .btn-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}
.btn.secondary {
  background: rgba(59,130,246,.25);
  color: #0f172a;
}
.btn.danger {
  background: rgba(239,68,68,.28);
  color: #7f1d1d;
}
.btn:active {
  transform: translateY(1px);
}

.inquiry-card { display: grid; gap: 12px; align-content: start; }

.card-title {
  font-weight: 900;
  color: #0f172a;
}

.late-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  margin-left: 10px;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 18px;
  font-weight: 900;
}

.inquiry-input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0 12px;
  outline: none;
  font-weight: 700;
}

.inquiry-input:focus {
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 0 6px rgba(59,130,246,.15);
}

.inquiry-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.late-table-wrap {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
}

.ui-table tbody tr.empty td {
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
}

.inquiry-table tbody tr.empty td {
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
}

.inquiry-card {
  min-height: 220px;
}

.total-card { grid-area: total; display: grid; gap: 16px; align-content: start; }

.madeby {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(15,23,42,.92);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  font-weight: 800;
  font-size: 12px;
}

.madeby-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #111827;
  border: 1px solid rgba(255,255,255,.14);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.madeby-text { opacity: .9; }

/* Low Stock Modal */
.ui-topbar.red {
  background: #dc2626;
  border-bottom: 1px solid #b91c1c;
}
.title.white, .subtitle.white {
  color: #fff;
}
.subtitle.white {
  opacity: 0.9;
  font-size: 13px;
  font-weight: 500;
}
.ui-close.white {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.ui-close.white:hover {
  background: rgba(255,255,255,0.3);
}
.icon-warning {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ui-table.compact th, .ui-table.compact td {
  padding: 10px 12px;
  font-size: 13px;
}
.ui-table.compact th {
  background: #334155;
  color: #fff;
  font-weight: 600;
}
.ui-table.compact tbody tr:nth-child(even) {
  background: #f8fafc;
}
.ui-table.compact tbody tr:hover {
  background: #f1f5f9;
}
.ui-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.stat-card {
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid transparent;
}
.stat-card.red-light {
  background: #fef2f2;
  border-color: #fecaca;
}
.stat-card.orange-light {
  background: #fff7ed;
  border-color: #fed7aa;
}
.stat-card.yellow-light {
  background: #fefce8;
  border-color: #fef08a;
}
.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.stat-val {
  font-size: 24px;
  font-weight: 800;
}
.stat-val.red { color: #dc2626; }
.stat-val.orange { color: #ea580c; }
.stat-val.yellow { color: #ca8a04; }
.val-warning {
  color: #ea580c;
  font-weight: 800;
  background: #fff7ed;
  padding: 2px 6px;
  border-radius: 4px;
}
.val-critical {
  color: #dc2626;
  font-weight: 800;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: rgba(15,23,42,0.32);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

#dbModal .db-modal {
  width: calc(100vw - 40px);
  height: calc(100vh - 40px);
  max-width: 1600px;
}

#dbModal .db-modal .ui-body {
  height: calc(100% - 72px);
  overflow: auto;
}

.page {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 22px;
  padding: 22px;
}
.center-wrap {
  display: grid;
  place-items: start center;
}
.modal-card {
  width: min(980px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 16px;
  position: relative;
}
.modal-title {
  font-weight: 800;
  font-size: 22px;
}
.form-grid {
  display: grid;
  gap: 12px;
}
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.field {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 10px;
}
.field .label {
  background: #0f766e;
  color: #fff;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  letter-spacing: .3px;
}
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  font-weight: 600;
  font-size: 15px;
  outline: none;
  transition: .2s ease;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 6px var(--ring);
}
.toolbar {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
}
.btn.flat {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}
.btn.success { background: var(--green); color: #fff; }
.btn.warning { background: #f59e0b; color: #fff; }
.btn.gray { background: #e5e7eb; color: #111827; }
.note {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 1080px) {
  .app-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .cards-row {
    grid-template-columns: 1fr;
  }
}

.login-page .ui-modal {
  max-width: 980px;
}

.login-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.login-hero {
  border-radius: 16px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  display: grid;
  gap: 10px;
  min-height: 320px;
  box-shadow: 0 16px 40px rgba(15,23,42,.18);
}

.login-hero-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .5px;
}

.login-hero-sub {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .3px;
  opacity: .9;
}

.login-hero-desc {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  opacity: .95;
}

.login-hero-foot {
  color: #000;
  font-weight: 700;
  font-size: 13px;
}

.login-hero-footer {
  margin-top: auto;
  display: grid;
  gap: 4px;
}

.login-hero-foot.muted {
  color: rgba(0, 0, 0, .6);
  font-weight: 600;
}

.login-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-hero-note {
  font-size: 13px;
  font-weight: 600;
  opacity: .92;
}

.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.login-pill-ico {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.22);
}

.login-pill-ico svg,
.login-pill-ico img {
  width: 18px;
  height: 18px;
  display: block;
}

.login-form {
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 22px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}

.login-form-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field label {
  font-weight: 600;
  font-size: 14px;
  color: #475569;
}

.login-input {
  height: 44px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0 12px;
  outline: none;
  font-weight: 600;
  font-size: 14px;
  transition: .2s ease;
}

.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 6px var(--ring);
}

.login-error {
  min-height: 18px;
  color: #dc2626;
  font-weight: 700;
  font-size: 13px;
}

.login-actions {
  display: grid;
  gap: 10px;
}

.login-note {
  color: #94a3b8;
  font-weight: 500;
  font-size: 14px;
}

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