@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #16213E;
  --ink-soft: #3B4A6B;
  --teal: #2FB6A5;
  --amber: #F2A93B;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --line: #E4E8F0;
  --text: #1B2233;
  --text-muted: #667085;
  --danger: #D64545;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(22,33,62,0.06), 0 1px 2px rgba(22,33,62,0.05);
}

* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display {
  font-family: 'Sora', 'Inter', sans-serif;
  color: var(--ink);
  letter-spacing: -0.01em;
}

a { color: inherit; }

.gradient-rule {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--teal) 55%, var(--amber) 100%);
}
.gradient-rule.thin { height: 3px; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand-mark .dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  display: inline-block;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Sora', sans-serif; font-weight: 600; font-size: 0.92rem;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(22,33,62,0.25); }
.btn-accent { background: var(--amber); color: #201200; }
.btn-accent:hover { box-shadow: 0 6px 18px rgba(242,169,59,0.35); }
.btn-teal { background: var(--teal); color: #06231F; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: #FDECEC; color: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 7px 13px; font-size: .82rem; border-radius: 8px; }

.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font-family: 'Inter', sans-serif; font-size: .93rem; color: var(--text);
  outline: none; transition: border-color .12s ease;
}
.input:focus { border-color: var(--teal); }
label.field-label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; font-family: 'Sora', sans-serif;
}
.badge-teal { background: #E4F7F4; color: #0E7A6B; }
.badge-amber { background: #FDF1DE; color: #A9660D; }
.badge-red { background: #FDECEC; color: var(--danger); }
.badge-gray { background: #EEF0F4; color: var(--text-muted); }

/* App shell */
#app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--ink); color: #fff;
  display: flex; flex-direction: column; padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand-mark { color: #fff; margin-bottom: 26px; padding: 0 6px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar a.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: rgba(255,255,255,0.72); text-decoration: none; font-size: .89rem; font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar a.nav-link.active { background: rgba(255,255,255,0.14); color: #fff; }
.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,0.4); margin: 16px 12px 6px; font-weight: 700; }
.sidebar .sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 12px; margin-top: 12px; }

.main-area { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.content { padding: 28px; max-width: 1180px; }

@media (max-width: 900px) {
  #app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; overflow-x: auto; padding: 12px; }
  .sidebar .brand-mark { margin-bottom: 0; margin-right: 10px; }
  .sidebar nav { flex-direction: row; }
  .sidebar .nav-section, .sidebar .sidebar-footer { display: none; }
  .content { padding: 18px; }
  .topbar { padding: 14px 18px; }
}

.color-swatch-input { display: flex; align-items: center; gap: 10px; }
.color-swatch-input input[type=color] { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); padding: 2px; background: #fff; cursor: pointer; }

.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 50;
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 10px;
  font-size: .88rem; box-shadow: var(--shadow); max-width: 320px;
  display: flex; align-items: start; gap: 10px;
}
.toast.error { background: var(--danger); }
.toast.success { background: #1E7A5F; }

.skeleton { background: linear-gradient(90deg, #EEF0F4 25%, #E4E8F0 37%, #EEF0F4 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 10px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.auth-wrap { min-height: 100vh; display: flex; }
.auth-side { flex: 1; background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.auth-side::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(600px circle at 80% 20%, rgba(47,182,165,0.35), transparent 60%),
              radial-gradient(500px circle at 10% 90%, rgba(242,169,59,0.28), transparent 55%);
}
.auth-side .auth-copy { position: relative; z-index: 1; max-width: 420px; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
@media (max-width: 860px) { .auth-side { display: none; } }
