@import url('/base.css');

:root {
  --accent: #d99b00;
  --accent-bright: #f2b705;
  --accent-dark: #b37e00;
  --green: #1f8a4c;
  --red: #c2313d;
  --bg: #f6f7f9;
  --ink: #21222a;
  --muted: #6f7282;
  --line: #e4e6ec;
  --sidebar: #14151a;
  --radius: 10px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 'Segoe UI', Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.loading { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d9dce4;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
  white-space: nowrap;
}
.btn:hover { background: #f2f3f7; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #121007; font-weight: 700; }
.btn.primary:hover { background: var(--accent-bright); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #f0c9cd; }
.btn .icon { width: 15px; height: 15px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: #eef0f5; color: var(--ink); }
.icon-btn .icon { width: 17px; height: 17px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-story {
  background: #111217;
  color: #fff;
  padding: 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-story::after {
  content: 'He';
  position: absolute;
  right: -12px;
  bottom: -48px;
  font-size: 270px;
  font-weight: 900;
  color: rgba(242, 183, 5, 0.06);
  pointer-events: none;
}
.login-story h1 { font-size: 44px; line-height: 1.1; letter-spacing: -1.5px; margin: 28px 0 16px; }
.login-story h1 em { font-style: normal; color: var(--accent-bright); }
.login-story p { color: #a7acb9; max-width: 400px; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 36px 24px; background: #fff; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 25px; margin-bottom: 6px; }
.login-form > p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.demo-roles { display: grid; gap: 8px; margin-bottom: 18px; }
.demo-box {
  background: #fff9e6;
  border: 1px solid #f0dc98;
  border-radius: 9px;
  padding: 13px;
  margin-bottom: 18px;
  font-size: 12px;
  color: #6f5407;
}

/* Layout */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  background: var(--sidebar);
  color: #b4b7c4;
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; color: #fff; padding: 0 6px 22px; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-bright); }
.brand strong { display: block; font-size: 14px; letter-spacing: .5px; color: var(--accent-bright); }
.brand small { display: block; font-size: 9px; letter-spacing: .8px; color: #8c90a0; }
.provider { font-size: 9.5px; color: #717586; margin-top: 10px; }
.provider b { color: #b5b9c7; font-weight: 600; }

.sidebar-nav { overflow: auto; flex: 1; min-height: 0; }
.nav-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #666a7a;
  margin: 16px 10px 6px;
  font-weight: 700;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin: 2px 0;
  border-radius: 7px;
  font-size: 12.5px;
  color: #c2c6d4;
}
.sidebar-nav a:hover { background: #1e2028; color: #fff; }
.sidebar-nav a.active {
  background: #2b2410;
  color: var(--accent-bright);
  box-shadow: inset 3px 0 0 var(--accent-bright);
  font-weight: 700;
}
.sidebar-nav .icon { width: 17px; height: 17px; flex: none; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #121007;
  min-width: 20px;
  height: 19px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  padding: 0 5px;
}
.sidebar-bottom {
  border-top: 1px solid #262933;
  padding: 12px 6px 0;
  display: grid;
  gap: 8px;
  font-size: 11px;
  flex-shrink: 0;
}
.sidebar-bottom a { display: flex; align-items: center; gap: 8px; color: #c8ccd8; }
.sidebar-bottom a:hover { color: var(--accent-bright); }
.sidebar-bottom .icon { width: 15px; height: 15px; flex: none; }

.main { margin-left: 244px; min-height: 100vh; }
.demo-banner {
  background: #fff6dc;
  border-bottom: 1px solid #ecd58a;
  padding: 7px 26px;
  font-size: 11px;
  color: #705306;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.topbar {
  min-height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 25;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu { display: none; }
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.branch-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.branch-filter select { width: auto; min-width: 190px; padding: 6px 10px; font-size: 12px; }
.top-date { color: var(--muted); font-size: 11.5px; text-transform: capitalize; }
.avatar {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff4d1;
  color: #8f6400;
  border: 1px solid #efd890;
  font-weight: 800;
  font-size: 11px;
}
.user-block { font-size: 11px; line-height: 1.3; }
.user-block strong { display: block; color: var(--ink); }
.user-block small { display: block; color: var(--muted); font-size: 10px; text-transform: capitalize; }

.content { padding: 24px 26px 40px; max-width: 1680px; margin: 0 auto; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-heading h1 { font-size: 24px; letter-spacing: -0.5px; font-weight: 800; }
.page-heading p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(24, 18, 29, 0.03);
}
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.metric-head .icon { width: 18px; height: 18px; color: #a1a4b2; }
.metric strong { display: block; font-size: 26px; font-weight: 750; letter-spacing: -.7px; margin: 9px 0 4px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 11px; color: var(--muted); }
.metric small.ok { color: var(--green); font-weight: 600; }
.metric small.warn { color: #b77700; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.panel-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-head p { font-size: 11.5px; color: var(--muted); }
.panel-body { padding: 16px 18px; }

.filters {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filters input, .filters select { width: auto; min-width: 170px; padding: 7px 10px; font-size: 12px; }
.filters input[type="search"] { flex: 1; min-width: 210px; }

.table-wrap { overflow: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; white-space: nowrap; }
th {
  background: #fafbfc;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 14px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-size: 11px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}
.badge.green { background: #e8f7ee; color: #19743f; }
.badge.amber { background: #fff5d8; color: #9c6a00; }
.badge.red { background: #fdebed; color: #b52431; }
.badge.blue { background: #eaf2fd; color: #245ca8; }
.badge.gray { background: #f0f1f5; color: #676a78; }

.alert-list { display: grid; gap: 0; padding: 4px 18px 14px; }
.attention { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f1f6; align-items: flex-start; }
.attention:last-child { border: 0; }
.attention-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #fff5d8; color: #a87500; flex: none; }
.attention-icon.red { background: #fdebed; color: var(--red); }
.attention-icon.green { background: #e8f7ee; color: var(--green); }
.attention-icon .icon { width: 16px; height: 16px; }
.attention strong { font-size: 12px; display: block; color: var(--ink); }
.attention p { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.mini-link { color: var(--accent-dark); font-size: 11px; font-weight: 700; background: none; border: 0; padding: 4px 0 0; }
.mini-link:hover { text-decoration: underline; }

.field { display: block; margin-bottom: 13px; font-size: 12px; font-weight: 600; color: #454857; }
.field > input, .field > select, .field > textarea { margin-top: 5px; }
input, select, textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d8dbe4;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: 1 / -1; }
.form-error { color: var(--red); font-size: 12px; margin: 6px 0; min-height: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 36px);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}
dialog::backdrop { background: rgba(15, 17, 24, 0.55); backdrop-filter: blur(2px); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
}
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px 20px; overflow: auto; }

.line-rows { display: grid; gap: 8px; margin: 10px 0; }
.line-row { display: grid; grid-template-columns: 1fr 90px 110px 34px; gap: 8px; align-items: center; }
.line-row-2 { display: grid; grid-template-columns: 1fr 95px 34px; gap: 8px; align-items: center; }

#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: #1d2a22;
  color: #fff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  display: none;
}
#toast.show { display: block; }
#toast.error { background: #9c1f2c; }
.scrim { display: none; }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 35; border: 0; }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .login { grid-template-columns: 1fr; }
  .login-story { display: none; }
}
@media (max-width: 600px) {
  .metrics { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .line-row { grid-template-columns: 1fr 70px 85px 30px; }
}
.cortez-print { font-family: Consolas, monospace; font-size: 12px; line-height: 1.55; }
.cortez-print hr { border: 0; border-top: 1px dashed #999; margin: 10px 0; }
.cortez-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cortez-table td { padding: 4px 0; border-bottom: 1px dotted #ddd; }
.cortez-table td:last-child { text-align: right; font-weight: 700; }
.chart-bars { display: grid; gap: 9px; }
.chart-bar-row { display: grid; grid-template-columns: 120px 1fr 90px; gap: 10px; align-items: center; font-size: 12px; }
.chart-track { background: #eff1f6; height: 11px; border-radius: 999px; overflow: hidden; }
.chart-fill { background: linear-gradient(90deg, var(--accent), #d99b00); height: 100%; border-radius: 999px; }
.chart-fill.green { background: linear-gradient(90deg, #1f8a4c, #2cb062); }
.chart-svg { width: 100%; height: 150px; display: block; }
.checklist-list { display: grid; gap: 8px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
  font-size: 12.5px;
  cursor: pointer;
}
.checklist-item input { width: auto; }
.checklist-item.done span { text-decoration: line-through; color: var(--muted); }
@media print {
  @page { margin: 12mm; }
  body > *:not(dialog[open]) { display: none !important; }
  dialog[open] { position: static; width: 100%; border: 0; box-shadow: none; }
  .no-print, .modal-head .icon-btn { display: none !important; }
}
