:root {
  --ink: #0A192F;
  --ink-soft: #4C5C74;
  --ink-faint: #8895AB;
  --accent: #0066CC;
  --accent-bright: #00D2FF;
  --white: #FFFFFF;
  --bg-app: #F4F7FA;
  --bg-alt: #F0F6FB;
  --line: #E1E9F1;
  --danger: #E0554F;
  --success: #1E8449;
  --success-bg: #E4F5E9;
  --warning: #B8860B;
  --warning-bg: #FDF3DC;
  --grad-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.22,.9,.32,1);
  --sidebar-w: 268px;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p, ul, form { margin: 0; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--font-body);
  background: var(--bg-app);
  color: var(--ink);
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; color: var(--ink); }

:focus-visible { outline: 2.5px solid var(--accent-bright); outline-offset: 2px; border-radius: 4px; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  color: #C7D5E5;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 60;
  transition: transform 0.35s var(--ease);
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 30px; }
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--white); display: flex; align-items: baseline; gap: 8px; }
.brand-text em { color: var(--accent-bright); font-style: normal; }
.brand-text small { font-weight: 500; font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5A6E8C;
  padding: 18px 12px 8px;
}
.nav-group-label:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: #B9C8DE;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.25s ease, color 0.25s ease;
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.is-active { background: var(--grad-accent); color: var(--white); box-shadow: 0 10px 20px -10px rgba(0,102,204,0.6); }
.nav-item.is-active svg { opacity: 1; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; }
.user-meta strong { color: var(--white); font-size: 0.88rem; }
.user-meta small { color: var(--ink-faint); font-size: 0.75rem; }

.main-wrap { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-title h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 2px; }
.topbar-title p { color: var(--ink-soft); font-size: 0.92rem; }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--success-bg); color: var(--success);
  font-weight: 700; font-size: 0.8rem;
  padding: 8px 14px; border-radius: 100px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(30,132,73,0.18); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.content { padding: 32px 40px 80px; flex: 1; }

.tab-panel { display: none; animation: fadeIn 0.4s var(--ease); }
.tab-panel.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.stat-box-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.icon-blue { background: #E3F0FE; color: var(--accent); }
.icon-teal { background: #E1F7F5; color: #0E9488; }
.icon-green { background: var(--success-bg); color: var(--success); }
.icon-ink { background: #EAF0F7; color: var(--ink); }

.stat-box-num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; }
.stat-box-label { display: block; color: var(--ink-soft); font-size: 0.85rem; font-weight: 500; }
.stat-box-delta { font-size: 0.78rem; font-weight: 600; }
.stat-box-delta.up { color: var(--success); }
.stat-box-delta.neutral { color: var(--ink-faint); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 26px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.15rem; font-weight: 700; }
.panel-head.standalone { margin-bottom: 22px; }
.panel-hint { font-size: 0.82rem; color: var(--ink-faint); }

.inquiry-list { display: flex; flex-direction: column; gap: 4px; }
.inquiry-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
}
.inquiry-item:last-child { border-bottom: none; }
.inquiry-main { display: flex; align-items: center; gap: 14px; }
.inquiry-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-alt); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}
.inquiry-text strong { display: block; font-size: 0.92rem; }
.inquiry-text span { display: block; font-size: 0.8rem; color: var(--ink-faint); }
.inquiry-meta { display: flex; align-items: center; gap: 14px; }
.inquiry-date { font-size: 0.8rem; color: var(--ink-faint); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; padding: 5px 12px; border-radius: 100px; }
.badge-new { background: #E3F0FE; color: var(--accent); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-resolved { background: var(--success-bg); color: var(--success); }

.edit-form { display: flex; flex-direction: column; gap: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }

.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field label { font-size: 0.83rem; font-weight: 700; color: var(--ink); }
.form-field input, .form-field select, .form-field textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
  resize: vertical;
  width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--accent);
  background: var(--white);
  outline: none;
}

.form-actions { display: flex; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn-primary { background: var(--grad-accent); color: var(--white); box-shadow: 0 10px 20px -10px rgba(0,102,204,0.5); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { background: var(--white); color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

.pricing-editor-grid, .hosting-editor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hosting-editor-grid { grid-template-columns: repeat(2, 1fr); }

.editor-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor-card-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.editor-card-tag { align-self: flex-start; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 11px; border-radius: 100px; background: var(--bg-alt); color: var(--accent); }
.editor-card-head h3 { font-size: 1.1rem; }

.chip-input {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-app);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip-list:empty { margin-bottom: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 8px 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
}
.chip button { background: none; border: none; color: var(--ink-faint); width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.75rem; line-height: 1; }
.chip button:hover { background: var(--danger); color: var(--white); }
.chip-text-input { width: 100%; border: none; background: transparent; padding: 6px 4px; }
.chip-text-input:focus { outline: none; }

.table-wrap { overflow-x: auto; }
.leads-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.leads-table th, .leads-table td { text-align: left; padding: 14px 16px; font-size: 0.88rem; }
.leads-table thead th { color: var(--ink-faint); font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; border-bottom: 1.5px solid var(--line); }
.leads-table tbody td { border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.leads-table tbody td:first-child { color: var(--ink); font-weight: 600; }
.leads-table tbody tr:hover td { background: var(--bg-app); }
.leads-table select.status-select {
  border: 1.5px solid var(--line);
  border-radius: 100px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--white);
}

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.toggle-copy { display: flex; flex-direction: column; gap: 3px; }
.toggle-copy strong { font-size: 0.92rem; }
.toggle-copy span { font-size: 0.82rem; color: var(--ink-faint); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #D6DFEA; border-radius: 100px; transition: background 0.25s ease; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--white); border-radius: 50%; transition: transform 0.25s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.switch input:checked + .slider { background: var(--grad-accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.toast-stack { position: fixed; top: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 40px -18px rgba(10,25,47,0.5);
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 260px;
  animation: toastIn 0.35s var(--ease);
}
.toast.toast-out { animation: toastOut 0.3s var(--ease) forwards; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--grad-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

.mobile-toggle {
  display: none;
  position: fixed;
  top: 18px; left: 18px;
  z-index: 70;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--ink);
  border: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.mobile-toggle span { width: 20px; height: 2px; background: var(--white); border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(10,25,47,0.5); z-index: 50; }
.sidebar-overlay.is-visible { display: block; }

@media (max-width: 1180px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .pricing-editor-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .mobile-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); box-shadow: 30px 0 60px -30px rgba(0,0,0,0.4); }
  .sidebar.is-open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .topbar { padding: 20px 24px 20px 72px; }
  .content { padding: 24px 24px 60px; }
  .hosting-editor-grid, .pricing-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .stat-cards { grid-template-columns: 1fr; }
  .form-grid, .form-grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .panel { padding: 20px; }
  .topbar-title p { display: none; }
  .toast-stack { left: 16px; right: 16px; top: 16px; }
  .toast { min-width: 0; width: 100%; }
}

/* Login Screen Styles */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ink) 0%, #112542 100%);
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 40px 80px -30px rgba(10, 25, 47, 0.8);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-mark {
  display: inline-flex;
  margin-bottom: 16px;
}

.login-brand h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-brand p {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}
