:root {
  --ink: #111827;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.26);
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --blue: #2563eb;
  --cyan: #06b6d4;
  --green: #10b981;
  --pink: #e879f9;
  --orange: #f59e0b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(45, 212, 191, 0.24), transparent 32%),
    radial-gradient(circle at 74% 2%, rgba(99, 102, 241, 0.22), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 42%, #ecfeff 100%);
}

button, input, select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  border-radius: 24px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
}

.login-card h1 {
  margin: 18px 0 24px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 800;
  background: linear-gradient(145deg, #111827, #2563eb 52%, #06b6d4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 30px rgba(37, 99, 235, 0.28);
}

.login-card label, .date-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
}

input:focus, select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

select:disabled {
  color: #94a3b8;
  background: rgba(226, 232, 240, 0.55);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  color: white;
  background: linear-gradient(135deg, #111827, #2563eb);
  cursor: pointer;
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.form-error {
  min-height: 20px;
  color: #dc2626;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  padding: 22px;
}

.sidebar {
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 32px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
}

nav a.active, nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
}

.sidebar .ghost-button {
  margin-top: auto;
}

.content {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.date-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.kpi {
  padding: 18px;
  min-height: 118px;
  overflow: hidden;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 12px;
  font-size: 25px;
}

.kpi em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.chart-card, .data-panel {
  padding: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.bar-chart {
  display: grid;
  gap: 12px;
  min-height: 290px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 92px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: center;
  min-height: 290px;
}

.donut {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.legend {
  display: grid;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.record-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.record-form button {
  align-self: end;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.45);
}

.status-ok, .status-low {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.status-ok {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}

.status-low {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
}

.link-button {
  padding: 0;
  color: #dc2626;
  background: transparent;
}

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

.manager-card {
  min-height: 260px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.manager-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.inline-form button {
  min-width: 72px;
}

.manager-select {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manager-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 9px 7px 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 13px;
}

.manager-pill button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #64748b;
  background: rgba(226, 232, 240, 0.8);
}

.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .kpis, .dashboard-grid, .management-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar, .section-title {
    display: grid;
  }

  .date-controls, .record-form, .donut-wrap {
    grid-template-columns: 1fr;
  }

  .kpis {
    grid-template-columns: 1fr;
  }
}
