:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-alt: #eef4fb;
  --line: #d7e0ea;
  --text: #102033;
  --muted: #607288;
  --accent: #20d3d6;
  --accent-deep: #0c7f96;
  --accent-soft: rgba(32, 211, 214, 0.14);
  --danger: #ba2642;
  --shadow: 0 18px 40px rgba(16, 32, 51, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.mydios-shell {
  min-height: 100vh;
  padding: 24px;
}

.auth-card,
.panel,
.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 440px;
  margin: 72px auto;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-card h1,
.topbar h1,
.content-head h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
}

.muted,
.hint {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

input {
  width: 100%;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

button {
  padding: 0 16px;
  background: var(--accent);
  color: #062129;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--text);
}

.error {
  color: var(--danger);
  min-height: 20px;
}

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

.topbar-actions,
.content-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.sidebar {
  padding: 18px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.sidebar-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.nav-tree {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.nav-group {
  display: grid;
  gap: 10px;
}

.nav-group-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px 14px;
  border-radius: 8px;
}

.nav-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.nav-item strong,
.nav-item span {
  display: block;
}

.nav-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.content {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px 20px;
}

.intro-band {
  background: linear-gradient(135deg, #ffffff, #eef7fb);
}

.content-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.content-head h2 {
  font-size: clamp(24px, 2vw, 34px);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 28px;
}

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

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tab-content {
  min-height: 360px;
}

.empty-state {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}

.mono {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
}

.stack-sm {
  display: grid;
  gap: 6px;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.record-card + .record-card {
  margin-top: 12px;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

@media (max-width: 960px) {
  .mydios-shell {
    padding: 14px;
  }

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

  .sidebar {
    position: static;
    max-height: none;
  }

  .content-head,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .content-actions,
  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .content-actions input,
  .content-actions button,
  .topbar-actions button {
    flex: 1;
  }
}
