/* =============================================
   LIPI AI — Main Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Devanagari:wght@400;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
  --brand:       #1a5cff;
  --brand-dark:  #0a3bbf;
  --brand-light: #e8effe;
  --brand-mid:   #4a7fff;
  --accent:      #f97316;
  --success:     #16a34a;
  --danger:      #dc2626;
  --warning:     #d97706;

  --bg:       #ffffff;
  --bg2:      #f8f9fb;
  --bg3:      #f0f2f5;
  --text1:    #0f1117;
  --text2:    #4a5068;
  --text3:    #9099b0;
  --border:   rgba(0,0,0,0.08);
  --border2:  rgba(0,0,0,0.14);

  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow:    0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.10);

  --font: 'Plus Jakarta Sans', sans-serif;
  --font-deva: 'Noto Serif Devanagari', serif;
}

body {
  font-family: var(--font);
  background: var(--bg2);
  color: var(--text1);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- NAV ---- */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-deva);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
}

.nav-logo .ai-tag {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--bg2); color: var(--text1); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pages-badge {
  background: var(--brand-light);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(26,92,255,0.2);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 32px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text1);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,92,255,0.12);
}
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }

/* ---- CARDS ---- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-body { padding: 24px; }
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 700; }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: var(--brand-light); color: var(--brand); border: 1px solid rgba(26,92,255,0.2); }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---- BADGE ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-blue    { background: var(--brand-light); color: var(--brand); }
.badge-green   { background: #dcfce7; color: #166534; }
.badge-orange  { background: #ffedd5; color: #c2410c; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-gray    { background: var(--bg3); color: var(--text2); }

/* ---- PROGRESS ---- */
.progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.4s;
}

/* ---- SPINNER ---- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- LAYOUT ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.page-content { padding: 32px 0; }
.section { margin-bottom: 40px; }

/* ---- STATS ROW ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-card .label { font-size: 12px; color: var(--text3); font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; margin-bottom: 6px; }
.stat-card .value { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1; }
.stat-card .sub   { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; color: var(--text3); letter-spacing: 0.5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: var(--bg2); }
td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text1); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg2); }

/* ---- DROP ZONE ---- */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  background: var(--bg2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.drop-zone .drop-icon {
  width: 56px;
  height: 56px;
  background: var(--brand-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.drop-zone h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.drop-zone p  { font-size: 13px; color: var(--text2); }

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fb 100%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-text {
  font-family: var(--font-deva);
  font-size: 30px;
  font-weight: 700;
  color: var(--brand);
}
.auth-logo .tagline { font-size: 13px; color: var(--text2); margin-top: 4px; }
.auth-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.auth-sub   { font-size: 13px; color: var(--text2); margin-bottom: 24px; }
.auth-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  margin: 20px 0;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: var(--bg);
  padding: 0 10px;
  position: relative;
}
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-top: 20px;
}
.auth-footer a { color: var(--brand); font-weight: 600; text-decoration: none; }

/* ---- MODALS ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text3); padding: 4px; }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Password strength */
.strength-bar { display: flex; gap: 4px; margin-top: 6px; }
.strength-seg { flex: 1; height: 3px; background: var(--border2); border-radius: 999px; transition: background 0.3s; }
.strength-seg.weak   { background: var(--danger); }
.strength-seg.medium { background: var(--warning); }
.strength-seg.strong { background: var(--success); }
.strength-label { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .container { padding: 0 16px; }
  .nav-links a[data-hide-mobile] { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
