:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e5eaf2;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 24px 60px rgba(15, 23, 42, 0.12);
  --primary: #0f6b5f;
  --primary-dark: #0a5148;
  --primary-soft: #e7f5f2;
  --danger: #e5484d;
  --danger-soft: #fff1f2;
  --success: #12a150;
  --warning: #f59e0b;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 107, 95, 0.12), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 46%, #eef3f8 100%);
  color: var(--text);
  min-height: 100vh;
}

body.dashboard-page {
  background:
    radial-gradient(circle at 0% 0%, rgba(15, 107, 95, 0.22), transparent 30rem),
    linear-gradient(118deg, #e7f5f2 0%, #f8fafc 38%, #f5f7fb 100%);
}

body.dashboard-page::before {
  display: none;
}

/* CLAY CARD */
.clay-card {
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--radius);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

/* LOGIN */
.login-page {
  display: grid;
  place-items: center;
  padding: 0;
  background:
    linear-gradient(105deg, #052e2a 0%, #0f6b5f 48%, #f8fafc 48%, #ffffff 100%);
}

.login-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
  gap: 0;
  align-items: center;
  padding: 0;
  border-radius: 0;
  background:
    linear-gradient(100deg, transparent 0 55%, rgba(255, 255, 255, 0.92) 67%, #fff 100%);
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.login-shell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 48%;
  width: 20%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(15, 107, 95, 0), rgba(255, 255, 255, 0.72) 56%, #fff 100%);
  z-index: 1;
}

.login-hero {
  position: relative;
  overflow: hidden;
  min-height: auto;
  min-height: 100vh;
  padding: clamp(2.5rem, 5vw, 5rem);
  border-radius: 0;
  background:
    radial-gradient(circle at 72% 20%, rgba(34, 197, 94, 0.28), transparent 23rem),
    linear-gradient(135deg, rgba(5, 46, 42, 0.98), rgba(15, 107, 95, 0.92));
  color: #fff;
  box-shadow: none;
  z-index: 2;
}

.login-hero::after {
  display: none;
}

.login-hero .login-brand-logo {
  width: fit-content;
  min-width: 380px;
  max-width: min(460px, 100%);
  height: 104px;
  margin: 0 0 4rem;
  padding: 1rem 1.35rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.eyebrow {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-hero h1 {
  max-width: 620px;
  font-size: clamp(2.4rem, 4.7vw, 4.65rem);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 800;
}

.hero-copy {
  max-width: 520px;
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.7;
}

.login-preview-card {
  position: relative;
  width: min(420px, 100%);
  margin-top: 2rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
  backdrop-filter: blur(12px);
  z-index: 1;
}

.preview-topline {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.preview-topline span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
}

.preview-row {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  font-weight: 800;
}

.preview-row b {
  color: #bbf7d0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-meter {
  height: 8px;
  margin: 0.9rem 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.preview-meter span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bbf7d0, #22c55e);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.preview-grid div {
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-grid b,
.preview-grid span {
  display: block;
}

.preview-grid b {
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.preview-grid span {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-pills span {
  padding: 0.58rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  font-weight: 700;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  min-height: auto;
  margin: 0 auto;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.05rem;
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background:
    radial-gradient(circle at top right, rgba(15, 107, 95, 0.09), transparent 14rem),
    rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.login-logo {
  text-align: left;
  margin-bottom: 0.5rem;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-logo-group {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
}

.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--border);
  flex-shrink: 0;
}

.metrodata-logo { width: 190px; height: 58px; }
.mii-logo { width: 108px; height: 58px; }

.login-logo h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--text);
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.form-group input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 107, 95, 0.12);
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
}

/* BUTTONS */
.clay-btn {
  padding: 0.85rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.clay-btn:hover { border-color: #cbd5e1; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08); }
.clay-btn:active { transform: translateY(1px) scale(0.99); }

.clay-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 14px 30px rgba(15, 107, 95, 0.24); }
.clay-btn.primary:hover { background: var(--primary-dark); }

.clay-btn.danger { background: var(--danger-soft); border-color: #fecdd3; color: var(--danger); }
.clay-btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.clay-btn.small { padding: 0.5rem 1rem; font-size: 0.82rem; border-radius: 10px; }
.terminal-only { display: none; }
body.terminal-enabled .terminal-only { display: inline-flex; }

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 100;
}

body.dashboard-page .topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

body.dashboard-page #dashboardView {
  min-height: 100vh;
  display: grid !important;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--border);
  box-shadow: 18px 0 48px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-frame {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.sidebar-title {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.sidebar-sub {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-quick-run {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
}

.sidebar-section-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quick-run-btn {
  padding: 0.8rem;
  border: 1px solid rgba(15, 107, 95, 0.14);
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.quick-run-btn:hover {
  transform: translateY(-1px);
  background: #dcf7ee;
  box-shadow: 0 12px 28px rgba(15, 107, 95, 0.1);
}

.quick-run-btn span,
.quick-run-btn small {
  display: block;
}

.quick-run-btn span {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
}

.quick-run-btn small {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 0.7rem;
}

.sidebar-actions .clay-btn {
  width: 100%;
}

.topbar-left { display: flex; align-items: center; gap: 0.8rem; }
.topbar-logo-frame {
  width: 248px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
}
.topbar-logo.metrodata-logo { width: 136px; height: 38px; }
.topbar-logo.mii-logo { width: 72px; height: 38px; }
.topbar-logo-frame .brand-divider { height: 34px; }
.sidebar-logo-frame .topbar-logo.metrodata-logo { width: 142px; height: 38px; }
.sidebar-logo-frame .topbar-logo.mii-logo { width: 72px; height: 38px; }
.sidebar-logo-frame .brand-divider { height: 34px; }
.topbar-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.topbar-sub { font-size: 0.75rem; color: var(--text-muted); }

/* DASHBOARD */
.dashboard {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 2rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.2rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(15, 107, 95, 0.12), transparent 22rem),
    linear-gradient(135deg, #ffffff, #f8fafc);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -5rem;
  bottom: -8rem;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.dashboard-eyebrow { color: var(--primary); }

.dashboard-hero h1 {
  max-width: 720px;
  margin-top: 0.5rem;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
  font-weight: 800;
}

.dashboard-hero p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-stat-card {
  position: relative;
  z-index: 1;
  min-width: 220px;
  padding: 1.25rem;
  border-radius: 22px;
  align-self: flex-end;
  background: #0f6b5f;
  border: 1px solid rgba(15, 107, 95, 0.22);
  box-shadow: 0 18px 44px rgba(15, 107, 95, 0.18);
}

.hero-stat-label,
.hero-stat-note {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-stat-card strong {
  display: block;
  margin: 0.35rem 0;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.06em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  padding: 1.15rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.05);
}

.stat-kicker {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.stat-card span:last-child {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.dashboard-section {
  padding: 1.25rem;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.06);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head p {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0;
}

/* WORKFLOW GROUPS */
.workflow-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.workflow-group {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.86));
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
}

.workflow-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #22c55e);
}

.workflow-group-onprem::before {
  background: linear-gradient(90deg, #0f172a, #64748b);
}

.workflow-group-head {
  padding: 0.85rem 0.85rem 1rem;
}

.workflow-group-head span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.workflow-group-onprem .workflow-group-head span { color: #475569; }

.workflow-group-head strong {
  display: block;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.workflow-group-head p {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.workflow-list {
  display: grid;
  gap: 0.75rem;
}

.script-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(15, 107, 95, 0.11), transparent 8rem),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  text-align: left;
  border: 1px solid var(--border);
}

.script-card:hover { border-color: rgba(15, 107, 95, 0.35); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.script-card:active { transform: scale(0.98); }
.script-card.running { border-color: var(--primary); }
.script-card.done { border-color: var(--success); }
.script-card.error { border-color: var(--danger); }

.script-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 2.5rem),
    linear-gradient(135deg, #e7f5f2, #d8f3e8);
  border: 1px solid rgba(15, 107, 95, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 24px rgba(15, 107, 95, 0.12);
}
.script-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.script-card:hover .script-icon {
  background: linear-gradient(135deg, var(--primary), #16a34a);
  border-color: rgba(255, 255, 255, 0.24);
}
.script-card:hover .script-icon svg {
  stroke: #fff;
}
.script-copy {
  min-width: 0;
  padding-top: 0.1rem;
}

.script-label { font-size: 0.98rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.script-action {
  margin-top: 0.35rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}
.script-status { font-size: 0.75rem; color: var(--text-muted); }

/* JOB PROGRESS VIEW */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
  margin-bottom: 0.75rem;
}

.job-card-error .job-header,
.job-card-error .job-body {
  border-color: rgba(229, 72, 77, 0.35);
  background: linear-gradient(180deg, #fff, #fff7f7);
}

.job-card-success .job-header,
.job-card-success .job-body {
  border-color: rgba(18, 161, 80, 0.28);
  background: linear-gradient(180deg, #fff, #f4fbf7);
}

.job-header-left { display: flex; align-items: center; gap: 0.6rem; }
.job-header-right { display: flex; align-items: center; gap: 0.75rem; }
.job-dismiss {
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.job-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 6px var(--warning);
  animation: pulse 1.2s ease-in-out infinite;
}
.job-dot.done { background: var(--success); box-shadow: 0 0 6px var(--success); animation: none; }
.job-dot.error { background: var(--danger); box-shadow: 0 0 6px var(--danger); animation: none; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.job-name { font-weight: 700; font-size: 0.95rem; }
.job-status { font-size: 0.82rem; color: var(--text-muted); }
.job-chevron { font-size: 1.4rem; color: var(--text-muted); cursor: pointer; line-height:1; padding: 0 0.3rem; transition: transform 0.2s; }
.job-chevron.open { transform: rotate(90deg); }

.job-body { padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.8rem; }
.job-body-top { display: flex; justify-content: space-between; align-items: center; }
.job-body-title { font-weight: 700; font-size: 0.95rem; }
.job-timer { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.job-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.job-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #22c55e);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.job-collecting { display: flex; align-items: center; gap: 0.5rem; }
.job-collecting-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 1s ease-in-out infinite;
}
.job-collecting-text { font-size: 0.82rem; color: var(--text-muted); }

.job-skeleton { display: flex; flex-direction: column; gap: 0.5rem; }
.skeleton-line {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w90 { width: 90%; }

@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.job-output {
  background: #1a1b26;
  color: #a9b1d6;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  padding: 1rem;
  border-radius: var(--radius-sm);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 0.5rem;
}
.shell-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 420px;
  background: #1a1b26;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.35);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.shell-drawer.open { transform: translateY(0); }

.shell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  display: none;
  backdrop-filter: blur(2px);
}

.shell-overlay.open { display: block; }

.shell-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #2a2b3a;
  flex-shrink: 0;
}

.shell-topbar-left { display: flex; align-items: center; gap: 0.5rem; }

.shell-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.shell-dot.red    { background: #ff5f57; }
.shell-dot.yellow { background: #febc2e; }
.shell-dot.green  { background: #28c840; }

.shell-title { color: #7a7a9a; font-size: 0.82rem; margin-left: 0.5rem; }

.shell-btn {
  background: none;
  border: none;
  color: #7a7a9a;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.shell-btn:hover { background: #2a2b3a; color: #fff; }

#terminal {
  flex: 1;
  padding: 0.5rem;
  overflow: hidden;
}

.xterm { height: 100%; }
.xterm-viewport { border-radius: 0; }

/* REPORTS */
.report-toolbar {
  display: grid;
  grid-template-columns: 1fr 160px 140px;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-toolbar input,
.report-toolbar select {
  width: 100%;
  padding: 0.82rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.report-toolbar input:focus,
.report-toolbar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 107, 95, 0.1);
}

.reports-card {
  padding: 0.6rem;
}

.report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  border-radius: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, transform 0.15s;
}

.report-item:last-child { border-bottom: none; }
.report-item:hover {
  background: var(--surface-soft);
  transform: translateX(2px);
}
.report-meta { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.report-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.report-name {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.report-copy { min-width: 0; }
.report-details {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}
.report-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.empty-text {
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* SPINNER */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@media (max-width: 600px) {
  body.dashboard-page #dashboardView { display: block !important; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { flex-direction: row; align-items: center; }
  .sidebar-logo-frame { width: 188px; height: 48px; }
  .sidebar-nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-nav a { padding: 0.7rem 0.5rem; text-align: center; font-size: 0.75rem; }
  .sidebar-quick-run { grid-template-columns: 1fr 1fr; }
  .sidebar-section-label { grid-column: 1 / -1; }
  .sidebar-actions { grid-template-columns: 1fr 1fr; }
  .dashboard { padding: 1rem; }
  .topbar { padding: 0.8rem 1rem; }
  .topbar-sub { display: none; }
  .dashboard-hero { flex-direction: column; padding: 1.5rem; }
  .hero-stat-card { width: 100%; align-self: stretch; }
  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-section { padding: 1rem; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .workflow-groups { grid-template-columns: 1fr; }
  .report-item { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .report-toolbar { grid-template-columns: 1fr; }
  .report-actions { width: 100%; }
  .report-actions .clay-btn { flex: 1; }
  .login-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #073b35 0%, #0f6b5f 44%, #f8fafc 44%, #ffffff 100%);
  }
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 0;
    background: linear-gradient(180deg, transparent 0 46%, rgba(255, 255, 255, 0.9) 62%, #fff 100%);
  }
  .login-shell::before { display: none; }
  .login-hero { min-height: auto; padding: 0; border-radius: 0; }
  .login-hero .login-brand-logo {
    min-width: 0;
    width: 100%;
    height: 86px;
    margin-bottom: 1.75rem;
  }
  .login-hero .metrodata-logo { width: 56%; }
  .login-hero .mii-logo { width: 28%; }
  .login-preview-card { width: 100%; margin-top: 1.5rem; }
  .topbar-logo-frame { width: 188px; height: 48px; }
  .topbar-logo.metrodata-logo { width: 102px; height: 30px; }
  .topbar-logo.mii-logo { width: 54px; height: 30px; }
  .login-card { min-height: auto; max-width: none; margin: 0; padding: 1.5rem; border-radius: 14px; border-left: 1px solid rgba(226, 232, 240, 0.9); }
}
