:root {
  --bg: #f6f5f2;
  --bg-soft: #fff8ef;
  --surface: #ffffff;
  --surface-raised: #fffdf9;
  --border: #e5e0d8;
  --border-strong: #d7cfc2;
  --text: #171717;
  --text-secondary: #6b665f;
  --text-muted: #8a8177;
  --primary: #f6821f;
  --primary-2: #faae40;
  --primary-hover: #e66f00;
  --primary-soft: #fff1dd;
  --primary-ring: rgba(246, 130, 31, 0.22);
  --danger: #cf2e2e;
  --danger-hover: #a82424;
  --danger-soft: #fff0f0;
  --success: #198754;
  --success-soft: #e9f8f0;
  --info-soft: #eef6ff;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(18, 18, 18, 0.04), 0 8px 24px rgba(18, 18, 18, 0.06);
  --shadow-lg: 0 20px 50px rgba(17, 17, 17, 0.16);
  --sidebar-width: 264px;
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(246, 130, 31, 0.13), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(250, 174, 64, 0.18), transparent 28%),
    linear-gradient(180deg, #fbfaf8 0%, var(--bg) 52%, #f1eee8 100%);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 72%);
}

a { color: inherit; }

svg { width: 16px; height: 16px; flex-shrink: 0; }

button, input, select { font: inherit; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(229, 224, 216, 0.9);
  box-shadow: 12px 0 35px rgba(31, 24, 16, 0.045);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.sidebar-logo {
  position: relative;
  padding: 28px 22px 22px 62px;
  min-height: 78px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 24px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #faae40 0%, #f6821f 52%, #d65f00 100%);
  box-shadow: 0 10px 25px rgba(246, 130, 31, 0.34);
}

.sidebar-logo::after {
  content: "API Gateway";
  position: absolute;
  left: 62px;
  top: 49px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-logo span { color: var(--primary); }

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
}

.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: #fff7ed;
  border-color: #ffe1bd;
  transform: translateX(2px);
}

.nav-item.active {
  color: #8a3a00;
  background: linear-gradient(135deg, #fff5e8, #fffaf1);
  border-color: #ffd8a8;
  box-shadow: inset 3px 0 0 var(--primary), 0 8px 20px rgba(246, 130, 31, 0.09);
}

.nav-item.active svg { color: var(--primary); }

.sidebar > div:last-child {
  margin: 12px;
  padding: 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,248,239,0.76));
}

.main {
  position: relative;
  flex: 1;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  padding: 34px 42px 60px;
  animation: pageIn 420ms ease both;
}

.main::before {
  content: "Cloud Skills Control Plane";
  display: block;
  margin-bottom: 8px;
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main > h2,
.flex-between > h2 {
  font-size: 28px !important;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h2 {
  margin-bottom: 7px;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.055em;
}

.page-header p {
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 14px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 28px;
  align-items: stretch;
  padding: 32px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-card h1 {
  max-width: 760px;
  margin: 18px 0 12px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.07em;
}

.hero-card p {
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-flow {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f9fafb;
  color: var(--text-secondary);
  font-weight: 800;
  text-align: center;
}

.hero-flow div {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.feature-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.feature-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.verify-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.check-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 700;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card,
.stat-card,
.steps {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(229, 224, 216, 0.94);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card {
  padding: 24px;
  margin-bottom: 20px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  border-color: #f8d7aa;
  box-shadow: 0 12px 36px rgba(46, 35, 23, 0.09);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.card-title { font-size: 16px; font-weight: 800; letter-spacing: -0.015em; }
.card-desc { color: var(--text-secondary); font-size: 13px; }

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }

.btn-primary {
  color: #1f1203;
  background: linear-gradient(180deg, #ffc46f 0%, var(--primary) 100%);
  border-color: #d96900;
  box-shadow: 0 8px 18px rgba(246, 130, 31, 0.25), inset 0 1px 0 rgba(255,255,255,0.45);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ffb84d 0%, var(--primary-hover) 100%);
  box-shadow: 0 12px 24px rgba(246, 130, 31, 0.32), inset 0 1px 0 rgba(255,255,255,0.45);
}

.btn-secondary {
  color: var(--text);
  background: linear-gradient(180deg, #fff, #f8f5ef);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.btn-secondary:hover { border-color: #d7b98d; background: #fff8ee; }

.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #e65a5a, var(--danger));
  border-color: #b72a2a;
  box-shadow: 0 8px 18px rgba(207, 46, 46, 0.2);
}

.btn-danger:hover { background: linear-gradient(180deg, #d74848, var(--danger-hover)); }

.btn-sm {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.btn:disabled::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,0,0,0.22);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

/* Forms */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  margin-bottom: 7px;
  color: #3c352d;
  font-size: 13px;
  font-weight: 760;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.form-input:hover,
.form-select:hover { border-color: #d4b58a; }

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
  background: #fff;
}

.form-input::placeholder { color: #aaa196; }
.form-select { cursor: pointer; }

/* Tables */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 14px;
  color: #776d62;
  background: linear-gradient(180deg, #fffaf4, #f8f4ed);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table th:first-child { border-top-left-radius: 12px; }
.table th:last-child { border-top-right-radius: 12px; }

.table td {
  padding: 14px;
  border-bottom: 1px solid #eee8df;
  vertical-align: middle;
  font-size: 14px;
}

.table tr:last-child td { border-bottom: none; }
.table tr { transition: background 150ms ease, transform 150ms ease; }
.table tr:hover td { background: #fff9f0; }
.table a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.table a:hover { color: var(--primary-hover); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green { background: var(--success-soft); color: #11653e; }
.badge-gray { background: #f0ede8; color: #756b60; }
.badge-red { background: #fef2f2; color: #991b1b; }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.skill-card-top,
.skill-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.skill-card h3 {
  margin: 16px 0 8px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.skill-card p {
  flex: 1;
  color: var(--text-secondary);
  font-size: 13px;
}

.skill-card-actions {
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}

.version-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Toggle */
.toggle {
  width: 46px;
  height: 25px;
  border: 1px solid #cfc7bb;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9e5de, #d9d2c8);
  cursor: pointer;
  position: relative;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.toggle:hover { box-shadow: 0 0 0 4px rgba(0,0,0,0.04); }

.toggle.on {
  border-color: #d66b00;
  background: linear-gradient(180deg, #ffb75c, var(--primary));
  box-shadow: 0 8px 18px rgba(246, 130, 31, 0.22);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.22);
  transition: transform 180ms cubic-bezier(.2,.8,.2,1);
}

.toggle.on::after { transform: translateX(21px); }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 22px;
  min-height: 130px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(46, 35, 23, 0.1);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 90px;
  height: 90px;
  border-radius: 30px;
  background: radial-gradient(circle, rgba(246,130,31,0.18), transparent 68%);
  transform: rotate(18deg);
}

.stat-label {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 38px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.07em;
}

.stat-value.blue { color: var(--primary-hover); }

/* Steps */
.steps {
  padding: 22px;
  margin-bottom: 20px;
  background:
    linear-gradient(135deg, rgba(255,245,232,0.95), rgba(255,255,255,0.86)),
    radial-gradient(circle at 90% 20%, rgba(246,130,31,0.18), transparent 34%);
}

.steps h3 {
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  color: #4d453b;
  font-size: 13px;
}

.step-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #22170e;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(34,23,14,0.18);
}

/* Code */
code,
.code-block {
  font-family: "SF Mono", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff3df;
  color: #944200;
  font-size: 12px;
  border: 1px solid #ffe1bd;
}

.code-block {
  position: relative;
  overflow: auto;
  min-height: 46px;
  padding: 13px 112px 13px 14px;
  border: 1px solid #ddd3c5;
  border-radius: 12px;
  background: linear-gradient(180deg, #1f1913, #14110e);
  color: #ffe6c8;
  font-size: 13px;
  word-break: break-all;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #211306;
}

/* Toast */
.toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 100;
  min-width: 220px;
  padding: 13px 16px;
  border-radius: 13px;
  color: #20150a;
  background: linear-gradient(180deg, #fff, #fff5e8);
  border: 1px solid #ffd8a8;
  box-shadow: var(--shadow-lg);
  font-weight: 750;
  animation: toastIn 260ms cubic-bezier(.2,.8,.2,1) both;
}

.toast-success::before { content: "✓ "; color: var(--success); }
.toast-error { color: #fff; background: linear-gradient(180deg, #e34f4f, var(--danger)); border-color: #b72a2a; }
.toast-error::before { content: "! "; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Login */
.login-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.72;
}

.login-page::before {
  width: 440px;
  height: 440px;
  left: -90px;
  top: -120px;
  background: radial-gradient(circle, rgba(246,130,31,0.3), transparent 68%);
  animation: floatOne 8s ease-in-out infinite;
}

.login-page::after {
  width: 360px;
  height: 360px;
  right: -80px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(250,174,64,0.34), transparent 68%);
  animation: floatTwo 9s ease-in-out infinite;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(229,224,216,0.94);
  border-radius: 22px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  animation: cardPop 420ms ease both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.login-card p {
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  width: 100%;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f6f1e9;
}

.tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab.active {
  color: #8a3a00;
  background: #fff;
  box-shadow: 0 5px 14px rgba(46, 35, 23, 0.08);
}

@keyframes cardPop {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatOne { 50% { transform: translate(20px, 24px); } }
@keyframes floatTwo { 50% { transform: translate(-18px, -22px); } }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 15, 10, 0.44);
  backdrop-filter: blur(7px);
  animation: fadeIn 140ms ease both;
}

.modal-overlay.hidden { display: none !important; }

.modal {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.72);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-lg);
  animation: modalIn 220ms cubic-bezier(.2,.8,.2,1) both;
}

.modal h3 {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Empty */
.empty {
  padding: 62px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty svg {
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  padding: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 16px;
}

.empty-title {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.compact-empty {
  padding: 34px 20px;
}

/* Utilities */
.hidden { display: none !important; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-secondary { color: var(--text-secondary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton-table { display: grid; gap: 10px; padding: 2px; }

.skeleton-row {
  display: grid;
  gap: 12px;
  padding: 13px;
  border-radius: 12px;
  background: rgba(255, 248, 239, 0.58);
}

.skeleton-row span {
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eee6dc 0%, #fff6ea 42%, #eee6dc 84%);
  background-size: 220% 100%;
  animation: shimmer 1.15s linear infinite;
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

@media (max-width: 900px) {
  .layout { display: block; }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
  }

  .sidebar-logo {
    min-width: 210px;
    border-bottom: none;
    padding-bottom: 18px;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }

  .nav-item { width: auto; min-width: max-content; }

  .sidebar > div:last-child { display: none; }

  .main {
    width: 100%;
    margin-left: 0;
    padding: 24px 18px 44px;
  }

  .stats-grid { grid-template-columns: 1fr; }
  .hero-card,
  .feature-grid,
  .dashboard-grid,
  .quick-actions,
  .verify-row,
  .settings-grid { grid-template-columns: 1fr; }
  .flex-between,
  .page-header { align-items: flex-start; flex-direction: column; }
  .table { min-width: 720px; }
  .card { overflow-x: auto; }
}

@media (max-width: 520px) {
  .login-card { padding: 28px 22px; }
  .sidebar { display: block; }
  .sidebar-logo { width: 100%; }
  .main > h2, .flex-between > h2 { font-size: 24px !important; }
  .modal { padding: 22px; }
  .code-block { padding-right: 14px; }
  .code-block .copy-btn { position: static; margin-top: 10px; width: 100%; }
}

/* Clean white theme overrides */
:root {
  --bg: #f7f7f8;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --primary: #111827;
  --primary-2: #374151;
  --primary-hover: #000000;
  --primary-soft: #f3f4f6;
  --primary-ring: rgba(17, 24, 39, 0.14);
  --success-soft: #ecfdf5;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 24px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.16);
}

body {
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f8 100%);
}

body::before { display: none; }

.sidebar {
  background: rgba(255, 255, 255, 0.94);
  border-right-color: var(--border);
  box-shadow: 10px 0 30px rgba(16, 24, 40, 0.035);
}

.sidebar::after { background: #111827; height: 2px; }

.sidebar-logo::before {
  background: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
}

.sidebar-logo span,
.nav-item.active svg,
.stat-value.blue,
.table a:hover { color: #111827; }

.nav-item:hover {
  background: #f9fafb;
  border-color: var(--border);
  color: #111827;
}

.nav-item.active {
  color: #111827;
  background: #f3f4f6;
  border-color: #e5e7eb;
  box-shadow: inset 3px 0 0 #111827;
}

.sidebar > div:last-child,
.card,
.stat-card,
.steps,
.login-card,
.modal {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--border);
}

.card:hover {
  border-color: #d1d5db;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
}

.btn-primary {
  color: #ffffff;
  background: #111827;
  border-color: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
}

.btn-primary:hover { background: #000000; box-shadow: 0 10px 22px rgba(17, 24, 39, 0.2); }

.btn-secondary {
  color: #111827;
  background: #ffffff;
  border-color: var(--border-strong);
}

.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }

.form-input:focus,
.form-select:focus,
.btn:focus-visible {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.12);
}

.table th {
  background: #f9fafb;
  color: #6b7280;
}

.table tr:hover td { background: #fafafa; }

.toggle.on {
  border-color: #111827;
  background: #111827;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.16);
}

.stat-card::after { background: radial-gradient(circle, rgba(17,24,39,0.06), transparent 68%); }

.steps {
  background: #ffffff;
}

.step-num { background: #111827; }

code {
  background: #f3f4f6;
  color: #111827;
  border-color: #e5e7eb;
}

.code-block {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.toast {
  color: #111827;
  background: #ffffff;
  border-color: #e5e7eb;
}

.toast-success::before { color: var(--success); }

.login-page::before,
.login-page::after { display: none; }

.login-card::before { background: #111827; height: 3px; }

.tabs { background: #f3f4f6; border-color: #e5e7eb; }

.tab.active {
  color: #111827;
  background: #ffffff;
}

.modal-overlay { background: rgba(17, 24, 39, 0.34); }

.empty svg {
  color: #111827;
  background: #f3f4f6;
}

.badge-dark { background: #111827; color: #ffffff; }

.skeleton-row { background: #f9fafb; }

.skeleton-row span {
  background: linear-gradient(90deg, #e5e7eb 0%, #f9fafb 42%, #e5e7eb 84%);
  background-size: 220% 100%;
}
