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

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F2F2FA;
  color: #111827;
}

/* ── Nav ─────────────────────────────────────────────────────── */
nav {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 24px rgba(0,0,0,0.25);
}

nav .nav-logo-link { background: #fff; border-radius: 8px; padding: 4px 12px; display: flex; align-items: center; }
nav .nav-logo { height: 60px; width: auto; display: block; }
nav .nav-tab {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}
nav .nav-tab:hover { background: rgba(255,255,255,0.09); color: #fff; }
nav .nav-tab.nav-active { background: rgba(255,255,255,0.15); color: #fff; }

/* ── Layout ──────────────────────────────────────────────────── */
.container { max-width: 920px; margin: 2rem auto; padding: 0 1.25rem; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 20px rgba(99,102,241,0.07);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-info h2 { font-size: 1rem; margin-bottom: 0.25rem; font-weight: 600; }
.card-info p { font-size: 0.85rem; color: #6B7280; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  padding: 0.28rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge.green  { background: #DCFCE7; color: #166534; }
.badge.yellow { background: #FEF9C3; color: #854D0E; }
.badge.red    { background: #FEE2E2; color: #991B1B; }
.badge.grey   { background: #F3F4F6; color: #374151; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.18s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.30);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #5558E8 0%, #4338CA 100%);
  box-shadow: 0 4px 16px rgba(99,102,241,0.42);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-danger { background: #EF4444; color: #fff; margin-left: 0.5rem; box-shadow: 0 2px 6px rgba(239,68,68,0.25); }
.btn-danger:hover { background: #DC2626; box-shadow: 0 4px 12px rgba(239,68,68,0.35); transform: translateY(-1px); }

.btn-view  { background: #EEF2FF; color: #4338CA; }
.btn-view:hover { background: #E0E7FF; }
.btn-check { background: #F0FDF4; color: #166534; }
.btn-check:hover { background: #DCFCE7; }

/* ── FAB ─────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff;
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(99,102,241,0.45);
  transition: all 0.18s;
  letter-spacing: 0.01em;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(99,102,241,0.55); }

/* ── Forms ───────────────────────────────────────────────────── */
form label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}
form input, form select, form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #111827;
  background: #FAFAFA;
  margin-bottom: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none;
  border-color: #6366F1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ── Upload area ─────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed #D1D5DB;
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
  background: #FAFAFA;
}
.upload-area:hover { border-color: #6366F1; background: #F5F3FF; }
.upload-area p { color: #9CA3AF; margin-top: 0.5rem; font-size: 0.85rem; }

#preview-img { max-width: 100%; border-radius: 10px; margin-bottom: 1rem; display: none; }

.spinner { display: none; text-align: center; padding: 1rem; color: #9CA3AF; }

/* ── Typography ──────────────────────────────────────────────── */
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9CA3AF;
  margin-bottom: 0.75rem;
}

.empty { text-align: center; padding: 4rem; color: #D1D5DB; font-size: 0.9rem; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,30,0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #F3F4F6;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; color: #111827; }

.modal-close {
  background: #F3F4F6;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6B7280;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #E5E7EB; color: #111827; }

.modal-body {
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.doc-section img { width: 100%; border-radius: 10px; border: 1px solid #F3F4F6; }

.doc-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9CA3AF;
  margin-bottom: 0.5rem;
}

/* ── Auth overlay ────────────────────────────────────────────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,30,0.7);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ── Plan badges ─────────────────────────────────────────────── */
.plan-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.plan-badge.plan-free     { background: #F3F4F6; color: #4B5563; }
.plan-badge.plan-pro      { background: linear-gradient(135deg, #6366F1, #4F46E5); color: #fff; box-shadow: 0 2px 6px rgba(99,102,241,0.3); }
.plan-badge.plan-ultimate { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; box-shadow: 0 2px 6px rgba(245,158,11,0.3); }

/* ── Profile dropdown ────────────────────────────────────────── */
.profile-wrapper { margin-left: auto; position: relative; }

.profile-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
}
.profile-avatar:hover { border-color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.22); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.plan-dot {
  position: absolute; bottom: 0; right: 0;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid #1a1a2e;
}
.plan-dot-free     { background: #9CA3AF; }
.plan-dot-pro      { background: #6366F1; }
.plan-dot-ultimate { background: #F59E0B; }

.profile-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 268px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #F3F4F6;
  z-index: 999;
  overflow: hidden;
}
.profile-dropdown.open { display: block; }

.profile-dropdown-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #F8F8FF 0%, #F0EFFF 100%);
}

.profile-avatar-lg {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-name  { font-size: 0.88rem; font-weight: 700; color: #111827; }
.profile-email { font-size: 0.76rem; color: #9CA3AF; margin-top: 0.15rem; }

.profile-divider { height: 1px; background: #F3F4F6; }

.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1rem;
}
.profile-row-label { font-size: 0.82rem; color: #6B7280; font-weight: 500; }

.profile-item {
  display: block; width: 100%; text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.862rem; font-weight: 500;
  color: #374151;
  text-decoration: none;
  background: none; border: none; cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.profile-item:hover { background: #F9FAFB; }
.profile-signout { color: #EF4444; font-weight: 600; }
.profile-signout:hover { background: #FEF2F2; }

/* ── Profile edit modal ──────────────────────────────────────── */
.edit-avatar-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  margin: 0 auto;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.edit-avatar-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.edit-avatar-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 50%;
}
.edit-avatar-wrap:hover .edit-avatar-overlay { opacity: 1; }

/* ── Plan page cards ─────────────────────────────────────────── */
.plan-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  border: 2px solid #F3F4F6;
  text-align: center;
  flex: 1;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.plan-card:hover { box-shadow: 0 8px 32px rgba(99,102,241,0.10); }
.plan-card.current { border-color: #6366F1; box-shadow: 0 4px 24px rgba(99,102,241,0.15); }
.plan-card h2 { font-size: 1.25rem; margin-bottom: 0.5rem; font-weight: 700; }
.plan-card .price { font-size: 2.25rem; font-weight: 800; margin: 0.75rem 0; color: #111827; }
.plan-card ul { list-style: none; font-size: 0.88rem; color: #6B7280; text-align: left; margin-bottom: 1.5rem; }
.plan-card ul li { padding: 0.35rem 0; }
.plan-card ul li::before { content: '✓ '; color: #6366F1; font-weight: 700; }

/* ── Usage bars ──────────────────────────────────────────────── */
.usage-bar-wrap { background: #F3F4F6; border-radius: 20px; height: 7px; margin: 0.4rem 0 0.25rem; overflow: hidden; }
.usage-bar { background: linear-gradient(90deg, #6366F1, #4F46E5); border-radius: 20px; height: 7px; transition: width 0.4s ease; }

/* ── Dashboard grid ──────────────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366F1, #818CF8);
}
.stat-card.stat-warn::before  { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.stat-card.stat-muted::before { background: linear-gradient(90deg, #9CA3AF, #D1D5DB); }
.stat-card.stat-warn  { background: #FFFBEB; }
.stat-card.stat-muted { background: #F9FAFB; }

.stat-num   { font-size: 2.4rem; font-weight: 800; color: #111827; line-height: 1; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: #9CA3AF; font-weight: 700; }

.dash-main {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-link { font-size: 0.8rem; color: #6366F1; text-decoration: none; font-weight: 600; }
.dash-link:hover { text-decoration: underline; }

/* ── Action tiles ────────────────────────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #FAFAFA;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.action-tile:hover {
  border-color: #6366F1;
  background: #F5F3FF;
  color: #4F46E5;
  box-shadow: 0 4px 14px rgba(99,102,241,0.15);
  transform: translateY(-1px);
}
.action-icon { font-size: 1.35rem; line-height: 1; }

/* ── Bell ────────────────────────────────────────────────────── */
.bell-wrapper { position: relative; }

.bell-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.18);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: all 0.15s;
}
.bell-btn:hover { border-color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.18); }

.bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: #EF4444; color: #fff;
  font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid #1a1a2e;
}

.bell-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 308px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #F3F4F6;
  z-index: 999;
  overflow: hidden;
}
.bell-dropdown.open { display: block; }

.bell-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  background: #FAFAFA;
}

.bell-notif-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #F9FAFB;
  cursor: pointer;
  transition: background 0.12s;
}
.bell-notif-item:last-child { border-bottom: none; }
.bell-notif-item:hover { background: #F9FAFB; }
.bell-notif-unread { background: #F5F3FF; }
.bell-notif-unread:hover { background: #EDE9FE; }
.bell-notif-title { font-size: 0.84rem; font-weight: 600; color: #111827; margin-bottom: 0.15rem; }
.bell-notif-body  { font-size: 0.79rem; color: #6B7280; margin-bottom: 0.2rem; }
.bell-notif-time  { font-size: 0.71rem; color: #9CA3AF; }

.bell-view-all {
  display: block; text-align: center;
  padding: 0.75rem;
  font-size: 0.82rem; font-weight: 600; color: #6366F1;
  text-decoration: none;
  border-top: 1px solid #F3F4F6;
  transition: background 0.12s;
}
.bell-view-all:hover { background: #F5F3FF; }

/* ── Notifications page ──────────────────────────────────────── */
.notif-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #F9FAFB;
  cursor: pointer;
  transition: background 0.12s;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: #F9FAFB; }
.notif-unread { background: #F5F3FF; }
.notif-unread:hover { background: #EDE9FE; }

.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6366F1; flex-shrink: 0; margin-top: 0.35rem;
}
.notif-dot-read { background: transparent; }

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #D1D5DB; border-radius: 24px; transition: 0.2s;
}
.toggle-slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: #6366F1; }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle input:disabled + .toggle-slider { cursor: not-allowed; opacity: 0.6; }

/* ── Choice cards ────────────────────────────────────────────── */
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #FAFAFA;
  border: 2px solid #E5E7EB;
  border-radius: 14px;
  padding: 2rem 1.5rem;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: all 0.18s;
}
.choice-card:hover {
  border-color: #6366F1;
  background: #F5F3FF;
  box-shadow: 0 6px 20px rgba(99,102,241,0.14);
  transform: translateY(-2px);
}
.choice-card strong { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; display: block; color: #111827; }
.choice-card p { font-size: 0.84rem; color: #6B7280; margin: 0; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-top: 1px solid #E5E7EB;
  font-size: 0.8rem;
  color: #9CA3AF;
}
.site-footer a {
  color: #6B7280;
  text-decoration: none;
  margin: 0 0.5rem;
}
.site-footer a:hover { color: #4F46E5; }

