* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f1ff;
  --panel: #ffffff;
  --panel-soft: #f8f3ff;
  --border: #e7d9ff;
  --border-strong: #ceb4ff;
  --text: #24113f;
  --muted: #6d5c8f;
  --primary: #8b2bbd;
  --primary-dark: #3d247d;
  --danger: #d946ef;
  --danger-dark: #7c3aed;
  --success-bg: #efe7ff;
  --success-text: #5b21b6;
  --warning-bg: #f3e8ff;
  --warning-text: #6b21a8;
  --error-bg: #fdf2ff;
  --error-text: #86198f;
  --shadow: 0 16px 36px rgba(61, 36, 125, 0.14);
  --radius: 18px;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #f3e8ff 0%, #efe4ff 28%, #ede9fe 54%, #f7f2ff 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f3e8ff;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
}

.topbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 16px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.topbar h1 {
  margin: 6px 0 10px;
  font-size: 32px;
  line-height: 1.1;
}

.topbar p {
  margin: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 24px 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.full-span {
  grid-column: 1 / -1;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(206, 180, 255, 0.75);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.section-title span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title h3 {
  margin: 0;
  font-size: 22px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.alert {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.alert.error {
  background: #fef2f2;
  color: var(--error-text);
  border-color: #fecaca;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
input[type="file"]:focus {
  outline: none;
  border-color: rgba(139, 43, 189, 0.52);
  box-shadow: 0 0 0 4px rgba(139, 43, 189, 0.16);
}

.file-drop {
  border: 1.5px dashed #c4b5fd;
  background: #faf5ff;
  border-radius: 18px;
  padding: 18px;
}

.file-drop span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 11px 16px;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 14px 26px rgba(91, 33, 182, 0.24);
}

.btn-primary:hover {
  opacity: 0.96;
}

.btn-secondary {
  background: #f3e8ff;
  color: #5b21b6;
}

.btn-danger {
  color: white;
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
}

.btn-small {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 12px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 18px 0 4px;
}

.inline-actions.compact {
  margin: 0;
}

.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
}

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

.stat-card strong {
  font-size: 28px;
  line-height: 1;
}

.result-grid .stat-card {
  min-height: 96px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 14px 14px;
  border-bottom: 1px solid #eef2f7;
  font-size: 14px;
}

th {
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: #fafcff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.url-cell {
  min-width: 240px;
  max-width: 320px;
  word-break: break-word;
}

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

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid rgba(206, 180, 255, 0.75);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card h1 {
  margin: 8px 0 10px;
  font-size: 28px;
}

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

.badge {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.stack-xs {
  min-width: 180px;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .panel {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 24px 16px 12px;
  }

  .dashboard-grid {
    padding: 8px 16px 28px;
    gap: 16px;
  }

  .panel {
    border-radius: 18px;
    padding: 16px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .section-title h3 {
    font-size: 20px;
  }

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

  .stat-card strong {
    font-size: 24px;
  }

  th, td {
    padding: 12px;
  }
}


.brand-head { display:flex; align-items:center; gap:14px; }
.brand-mark { width:56px; height:56px; border-radius:18px; box-shadow:0 12px 24px rgba(91,33,182,0.22); }
.login-card { position:relative; overflow:hidden; }
.login-card::before { content:""; position:absolute; inset:0 0 auto 0; height:4px; background:linear-gradient(90deg, #8b2bbd 0%, #5b21b6 55%, #312e81 100%); }
.stat-card { background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%); border:1px solid rgba(206,180,255,0.55); }
.table-wrap table thead th { background:#faf5ff; }
