:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #7c3aed;
  --secondary-light: #ede9fe;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Landing ── */
.landing-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.landing-screen::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.08), transparent 70%);
  pointer-events: none;
}

.landing-screen::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.06), transparent 70%);
  pointer-events: none;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.landing-actions { display: flex; gap: 8px; }

.ghost-action, .solid-action {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ghost-action {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.ghost-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.solid-action {
  border: 0;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.solid-action:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.landing-hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-copy { max-width: 600px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 20px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-copy h1 {
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -1.5px;
  font-weight: 900;
  color: var(--text);
}

.hero-copy > p {
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 480px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-primary, .hero-secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.hero-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

.hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}

.hero-secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
}

.hero-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hero-metrics {
  display: grid;
  gap: 12px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.hero-metrics div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: transform 0.15s ease;
}

.hero-metrics div:hover {
  transform: translateX(4px);
}

.hero-metrics strong {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 800;
}

.hero-metrics span {
  font-size: 0.85rem;
  color: var(--muted);
}

.landing-feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px 80px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.landing-feature-row article {
  padding: 32px 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.landing-feature-row article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.landing-feature-row article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.landing-feature-row article:hover::before {
  opacity: 1;
}

.landing-feature-row article span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.landing-feature-row article strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.landing-feature-row article p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ── Auth ── */
.auth-shell {
  width: min(1100px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: center;
  padding: 28px 0;
}

.brand-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 40%, #2d1b69 100%);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.brand-panel::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.2), transparent 70%);
}

.brand-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
}

.brand-panel h1 {
  max-width: 500px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

.intro {
  max-width: 480px;
  margin-bottom: 0;
  opacity: 0.8;
  font-size: 1.05rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.security-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.security-list span {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}

.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-back:hover { color: var(--primary); }

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.tab-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-button.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

.auth-form { display: grid; gap: 8px; }
.auth-form.hidden { display: none; }

.auth-form h2 {
  margin-bottom: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

h1, h2, p { margin-top: 0; }

label {
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.15s ease;
  background: var(--panel);
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input.invalid {
  border-color: var(--danger);
  background: #fef2f2;
}

input.valid {
  border-color: var(--success);
  background: #f0fdf4;
}

.field-message {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.password-rules {
  margin: 0 0 4px;
  padding: 12px 16px 12px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--bg);
  font-size: 0.84rem;
  line-height: 1.7;
}

.password-rules li.valid {
  color: var(--success);
  font-weight: 600;
}

.submit-button {
  min-height: 46px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.3);
}

.submit-button:active {
  transform: translateY(0);
}

.status-message {
  min-height: 24px;
  margin: 16px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.45;
}

.status-message.success { color: var(--success); }
.status-message.error { color: var(--danger); }

/* ── Dashboard ── */
.dashboard-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0 8px;
}

.dashboard-nav {
  display: grid;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

.logout-button {
  min-height: 40px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logout-button:hover {
  background: #fef2f2;
  border-color: var(--danger);
  color: var(--danger);
}

.dashboard-content {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 92px;
}

.dashboard-header {
  min-height: 200px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 32px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 50%, #2d1b69 100%);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.dashboard-header::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.15), transparent 70%);
}

.dashboard-header * { position: relative; z-index: 1; }

.dashboard-kicker, .panel-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.7;
}

.dashboard-header h1 {
  max-width: 600px;
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
  letter-spacing: -1px;
}

.dashboard-header p {
  margin-bottom: 0;
  opacity: 0.8;
  font-size: 0.95rem;
}

.primary-action, .secondary-action {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.primary-action {
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.secondary-action {
  padding: 0 16px;
  color: #fff;
  background: var(--primary);
}

.notice-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
}

.notice-strip strong {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
}

.notice-strip span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-tile, .workspace-panel, .activity-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat-tile:hover, .workspace-panel:hover, .activity-panel:hover {
  box-shadow: var(--shadow);
}

.stat-tile {
  min-height: 130px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.stat-tile:nth-child(2)::before { background: var(--secondary); }
.stat-tile:nth-child(3)::before { background: var(--accent); }

.stat-tile span, .stat-tile small, .workspace-panel p, .activity-panel span, .plan-row small {
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-tile small { font-size: 0.82rem; }

.stat-tile strong {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
}

.stat-tile.highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.stat-tile.highlight span, .stat-tile.highlight small {
  color: rgba(255,255,255,0.78);
}

.stat-tile.highlight::before { display: none; }

.work-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  margin-top: 16px;
}

.workspace-panel { padding: 24px; }

.workspace-panel h2, .activity-panel h2 {
  margin-bottom: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.workspace-panel p { line-height: 1.6; }

.upload-panel {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: stretch;
}

.upload-box {
  min-height: 140px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-box span {
  padding: 8px 16px;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
}

.upload-box small {
  max-width: 160px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.plan-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.plan-row div { display: grid; gap: 2px; }

.plan-row strong { font-size: 1.8rem; font-weight: 900; letter-spacing: -1px; }

.activity-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 24px;
}

.empty-state {
  min-width: 240px;
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.empty-state strong { font-size: 0.92rem; }
.empty-state span { color: var(--muted); font-size: 0.85rem; }

.contact-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 3;
}

.contact-button {
  padding: 11px 16px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}

.contact-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.contact-button.whatsapp { background: #25d366; }
.contact-button.telegram { background: #0088cc; }

@media (max-width: 860px) {
  .landing-nav { padding: 14px 20px; }
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 40px 20px;
  }
  .hero-copy { max-width: 100%; }
  .hero-copy > p { max-width: 100%; }
  .hero-buttons { justify-content: center; }
  .hero-metrics { max-width: 320px; justify-self: center; }
  .landing-feature-row {
    grid-template-columns: 1fr;
    padding: 10px 20px 40px;
  }
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0;
  }
  .brand-panel { min-height: 340px; padding: 28px; }
  .auth-card { padding: 22px; }
  .dashboard-screen { grid-template-columns: 1fr; }
  .dashboard-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }
  .dashboard-nav {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 3;
  }
  .nav-link { text-align: center; padding: 10px 8px; font-size: 0.84rem; justify-content: center; }
  .logout-button { margin-top: 0; margin-left: auto; padding: 0 14px; }
  .dashboard-content { width: min(100% - 24px, 680px); padding: 20px 0 104px; }
  .dashboard-header, .notice-strip, .activity-panel {
    align-items: flex-start;
    flex-direction: column;
  }
  .primary-action { width: 100%; }
  .stats-grid, .work-grid, .upload-panel { grid-template-columns: 1fr; }
  .empty-state { width: 100%; min-width: 0; }
}

@media (max-width: 520px) {
  .auth-shell { width: min(100% - 20px, 460px); }
  .brand-panel { min-height: 300px; padding: 22px; }
  .security-list { display: none; }
  .landing-hero h1 { font-size: 2rem; }
  .dashboard-sidebar { display: grid; grid-template-columns: 1fr auto; }
  .dashboard-nav {
    grid-column: 1 / -1;
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .nav-link { flex: 0 0 auto; min-width: 100px; }
  .dashboard-header { min-height: 260px; padding: 22px; }
  .dashboard-header h1 { font-size: 1.8rem; }
  .stat-tile, .workspace-panel, .activity-panel { padding: 18px; }
  .plan-row { align-items: stretch; flex-direction: column; }
  .secondary-action { width: 100%; }
  .contact-stack { right: 10px; bottom: 10px; }
  .contact-button { padding: 10px 14px; font-size: 0.84rem; }
}
