/* KAPAK — Pixel-Accurate Soft Bento UI */
:root {
  --outer-blue: #2f7bf6;
  --canvas-bg: #eef4fb;
  --surface: #ffffff;
  --surface-soft: #f6f9fe;

  --text: #161d2b;
  --text-secondary: #4a5568;
  --muted: #8d99ae;

  --primary: #2e7cf6;
  --primary-hover: #1c64dc;
  --primary-soft: #ebf3ff;

  --teal: #34d399;
  --teal-btn: #58c9b9;
  --teal-hover: #42b5a4;

  --coral: #f87171;
  --coral-hover: #ef4444;
  --coral-bg: #fff1f2;

  --orange: #fb923c;
  --border: #e7eef8;
  --border-strong: #d5e1f0;

  --shadow-shell: 0 32px 80px rgba(13, 46, 114, 0.34);
  --shadow-card: 0 10px 28px rgba(145, 169, 204, 0.14);
  --shadow-pill: 0 10px 24px rgba(46, 124, 246, 0.15);

  --radius-shell: 30px;
  --radius-card: 22px;
  --sidebar-width: 224px;
  --right-rail-width: 292px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--canvas-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }
p { margin: 0 0 10px; }

.muted {
  color: var(--muted);
  font-size: 0.8rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82em;
  background: var(--primary-soft);
  color: var(--primary-hover);
  padding: 2px 7px;
  border-radius: 6px;
}

/* ===========================
   LOGIN PAGE (SOFT BENTO)
   =========================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--canvas-bg);
  border-radius: var(--radius-shell);
  overflow: hidden;
  box-shadow: var(--shadow-shell);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.login-hero {
  background: linear-gradient(160deg, #ffffff 0%, #eaf2ff 100%);
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
}

.login-hero h2 {
  font-size: 1.65rem;
  line-height: 1.22;
  margin-top: 22px;
  margin-bottom: 12px;
}

.login-hero p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 12px;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  padding: 11px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  font-size: 0.86rem;
  font-weight: 500;
}

.login-features svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.login-hero-footer {
  padding-top: 20px;
  font-size: 0.78rem;
  color: var(--muted);
}

.login-card {
  background: var(--surface);
  padding: 46px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ===========================
   APP SHELL (FULLSCREEN WEB)
   =========================== */
.app-shell {
  width: 100%;
  min-height: 100vh;
  background: var(--canvas-bg);
  display: flex;
}

/* ===========================
   LEFT SIDEBAR (WHITE)
   =========================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  padding: 28px 16px 22px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 26px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(46, 124, 246, 0.22);
  flex-shrink: 0;
}

.brand-wordmark-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2e7cf6 0%, #1c64dc 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(46, 124, 246, 0.35);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
}

.brand-name {
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.sidebar-close {
  display: none;
  background: var(--canvas-bg);
  border: 0;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.18s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pill);
}

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

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
}

.profile-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(145, 169, 204, 0.18);
  border: 1px solid var(--border);
}

.profile-avatar-img {
  width: 82px;
  height: 82px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  margin: 0 auto 10px;
  box-shadow: 0 10px 22px rgba(45, 212, 191, 0.28);
}

.user-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 2px;
}

.user-role {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 40;
}

.sidebar-backdrop.open {
  display: block;
}

/* ===========================
   MAIN WORKSPACE + RIGHT RAIL
   =========================== */
.main-workspace {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 24px 22px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--right-rail-width);
  gap: 20px;
  align-items: stretch;
  flex: 1;
}

.center-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===========================
   HERO BANNER (PLAYSTATION STYLE)
   =========================== */
.hero-banner {
  background: var(--surface);
  border-radius: 26px;
  padding: 26px 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: visible;
  min-height: 168px;
}

.hero-text {
  max-width: 320px;
  position: relative;
  z-index: 2;
}

.hero-text h1 {
  font-size: 1.95rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  color: #161d2b;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: 16px;
  padding: 9px 10px 9px 22px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 12px 24px rgba(46, 124, 246, 0.34);
  transition: transform 0.15s ease, background 0.15s ease;
}

.hero-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.hero-cta-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

.hero-mascot-wrap {
  position: relative;
  width: 210px;
  height: 130px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-mascot-img {
  height: 196px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  margin-top: -42px;
  pointer-events: none;
}

/* ===========================
   3 MINI BENTO KPI CARDS
   =========================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 12px;
}

.kpi-art {
  width: 52px;
  height: 52px;
  object-fit: contain;
  mix-blend-mode: multiply;
  flex-shrink: 0;
}

.kpi-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-body {
  min-width: 0;
  flex: 1;
}

.kpi-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-bar {
  height: 4px;
  background: #edf2f8;
  border-radius: 999px;
  margin: 6px 0 4px;
  overflow: hidden;
}

.kpi-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.kpi-delta {
  font-size: 0.72rem;
  font-weight: 700;
}

/* ===========================
   CARDS, BENTO LISTS & TABS
   =========================== */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  min-width: 0;
}

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

.card-header h2 {
  margin: 0;
}

/* Clean PlayStation "Last purchases"-style list rows (no clipped tables!) */
.bento-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 470px;
  overflow-y: auto;
  padding-right: 4px;
}

.bento-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface-soft);
  transition: background 0.15s ease;
}

.bento-row:hover {
  background: #edf4fd;
}

.bento-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.bento-thumb {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.bento-row-info {
  min-width: 0;
  flex: 1;
}

.bento-row-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-row-sub {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ===========================
   RIGHT RAIL (FULL-HEIGHT PANEL)
   =========================== */
.right-rail {
  background: var(--surface);
  border-radius: 26px;
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.rail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail-section-header h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.rail-arrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.rail-list {
  display: grid;
  gap: 13px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rail-thumb {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.thumb-red    { background: linear-gradient(135deg, #fb7185, #e11d48); }
.thumb-green  { background: linear-gradient(135deg, #a3e635, #16a34a); }
.thumb-pink   { background: linear-gradient(135deg, #f9a8d4, #ec4899); }
.thumb-blue   { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.thumb-teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.thumb-amber  { background: linear-gradient(135deg, #fbbf24, #d97706); }

.rail-info {
  flex: 1;
  min-width: 0;
}

.rail-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-sub {
  font-size: 0.74rem;
  color: var(--muted);
}

.rail-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(145, 169, 204, 0.12);
}

/* ===========================
   FORMS & INPUTS
   =========================== */
label {
  display: block;
  margin: 10px 0 5px;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 124, 246, 0.14);
}

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

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

/* ===========================
   PILL BUTTONS (SOFT BENTO)
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary,
.btn-gold {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(46, 124, 246, 0.28);
}

.btn-primary:hover,
.btn-gold:hover {
  background: var(--primary-hover);
}

.btn-teal {
  background: var(--teal-btn);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(88, 201, 185, 0.28);
}

.btn-teal:hover {
  background: var(--teal-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border-color: #cfe0fc;
}

.btn-secondary:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--coral);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--coral-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 9px;
}

.btn-full {
  width: 100%;
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: 14px;
}

/* ===========================
   TABLES (PLAYERS)
   =========================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: var(--surface-soft);
}

.search-box {
  max-width: 240px;
  min-width: 170px;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===========================
   PAGINATION (SOFT BENTO)
   =========================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(46, 124, 246, 0.28);
}

.page-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ===========================
   ODOMETER USER COUNTER
   =========================== */
.counter-card {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.counter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.counter-header h2 {
  margin-bottom: 2px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.76rem;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.odometer-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f3f7fe 0%, #e9f1fc 100%);
  border: 1px solid var(--border);
}

.digit-tile {
  position: relative;
  height: 92px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid #dbe6f6;
  box-shadow: 0 10px 22px rgba(46, 124, 246, 0.10), inset 0 -3px 0 #e6eef8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow: hidden;
}

.digit-tile::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(148, 163, 184, 0.22);
  pointer-events: none;
}

.digit-tile.is-muted span {
  color: #cbd5e1;
}

.digit-tile.is-active {
  border-color: #bfd8fc;
  box-shadow: 0 12px 26px rgba(46, 124, 246, 0.18), inset 0 -3px 0 #dbeafe;
}

.digit-tile.is-active span {
  background: linear-gradient(180deg, #1d4ed8 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.counter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .counter-card {
    padding: 18px 16px;
  }
  .odometer-row {
    gap: 6px;
    padding: 10px;
    border-radius: 16px;
  }
  .digit-tile {
    height: 60px;
    border-radius: 11px;
    font-size: 1.55rem;
  }
}

/* ===========================
   QUESTION & OPTION IMAGES
   =========================== */
.file-input-sm {
  margin-top: 6px;
  padding: 6px 9px !important;
  font-size: 0.78rem !important;
}

.q-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.q-thumb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}

.q-thumb-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.q-thumb {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
  display: block;
}

/* ===========================
   BADGES & ALERTS
   =========================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok {
  background: #dcfce7;
  color: #15803d;
}

.badge-danger {
  background: var(--coral-bg);
  color: #dc2626;
}

.badge-neutral {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.alert {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.alert-ok {
  background: #dcfce7;
  color: #166534;
}

.alert-error {
  background: var(--coral-bg);
  color: #991b1b;
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.endpoint-method {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
}

/* ===========================
   RESPONSIVE BREAKPOINTS
   =========================== */
@media (max-width: 1220px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .right-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 1024px) {
  body {
    padding: 0;
    background: var(--canvas-bg);
  }
  .app-shell {
    border-radius: 0;
    min-height: 100vh;
    box-shadow: none;
    border: 0;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-shell);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: inline-flex;
  }
  .topbar {
    display: flex;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .right-rail {
    grid-template-columns: 1fr;
  }
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
  .login-hero {
    display: none;
  }
}

@media (max-width: 720px) {
  .main-workspace {
    padding: 14px;
  }
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    min-height: auto;
  }
  .hero-mascot-wrap {
    display: none;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .search-box {
    max-width: 100%;
    width: 100%;
  }
  .bento-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .bento-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .login-card {
    padding: 32px 24px;
  }
}
