@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500&family=Ubuntu:wght@400;500;700&display=swap");

:root {
  color: #172033;
  background: #f4f7fb;
  font-family: "Ubuntu", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --accent: #2f7db8;
  --accent-hover: #286fa5;
  --accent-soft: #e9f3fb;
  --accent-ink: #1f638f;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
  background:
    linear-gradient(180deg, rgba(238, 244, 250, 0.96), rgba(244, 247, 251, 0.82) 340px),
    #f4f7fb;
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d9e2ed;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 10px 12px;
  outline: 0;
}
textarea { min-height: 88px; resize: vertical; }
label { display: grid; gap: 6px; color: #667085; font-size: 12px; font-weight: 700; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .metric strong, .brand-mark {
  font-family: "Montserrat", "Ubuntu", system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 22px 70px rgba(25, 43, 76, 0.16);
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 500;
}
.login-title { display: flex; align-items: center; gap: 12px; }
.login-title h1 { font-size: 26px; }
.login-title p { margin-top: 2px; color: #667085; font-size: 13px; }
.error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff0ee;
  color: #b73b2d;
  font-weight: 700;
}

.shell {
  min-height: 100vh;
  padding: 14px;
  overflow-x: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand h1 { font-size: 25px; }
.brand p { margin-top: 2px; color: #667085; font-size: 13px; }
.tabs, .actions, .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tab {
  color: #314056;
  background: #e9eef5;
  padding: 0 14px;
  font-weight: 800;
}
.tab.active { color: #fff; background: var(--accent); }
.primary { color: #fff; background: var(--accent); padding: 0 14px; font-weight: 800; }
.primary:hover,
.tab.active:hover { background: var(--accent-hover); }
.ghost { color: #314056; background: #e9eef5; padding: 0 14px; font-weight: 800; }
.danger { color: #b42318; background: #fee4e2; }
.small-button {
  min-height: 32px;
  padding: 0 10px;
  color: #314056;
  background: #e9eef5;
  font-size: 12px;
  font-weight: 800;
}
.small-button.danger { color: #b42318; background: #fee4e2; }

.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: 1.1fr 0.9fr; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel {
  min-width: 0;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 12px 32px rgba(25, 43, 76, 0.07);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #edf1f6;
}
.panel-head h2 { font-size: 17px; font-weight: 400; }
.panel-body { padding: 14px; }
.metric { padding: 15px; }
.metric p { color: #667085; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; margin-top: 8px; font-size: 26px; font-weight: 400; }
.metric span { display: block; margin-top: 4px; color: #667085; font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
th { color: #667085; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}
.muted { color: #667085; }
.positive { color: var(--accent-ink); font-weight: 800; }
.negative { color: #b42318; font-weight: 800; }
.full { grid-column: 1 / -1; }
.settings-stack { display: grid; gap: 12px; }
.directory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}
.modal-card {
  width: min(760px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(25, 43, 76, 0.22);
}
.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #edf1f6;
}
.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid #edf1f6;
  border-bottom: 0;
}
.modal-body { padding: 14px; }
.delete-copy {
  padding: 12px;
  border-radius: 8px;
  background: #fff5f4;
  color: #9b2c22;
  font-weight: 700;
}

@media (max-width: 1050px) {
  .metrics, .two, .three, .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .shell { padding: 10px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .metrics, .two, .three, .form-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; }
  .tab { flex: 1 1 auto; }
  .modal-backdrop { align-items: stretch; padding: 0; }
  .modal-card { width: 100%; max-height: 100vh; border-radius: 0; }
}
