/* ============================================================
   DARPAN CMS — Admin Panel Stylesheet (English Version)
============================================================ */

:root {
  --sky-50:  #f0f8ff; --sky-100: #e0f0fe; --sky-200: #bae0fd;
  --sky-400: #38adf1; --sky-500: #0e93de; --sky-600: #0274bc;
  --sky-700: #025d99; --sky-800: #064e80; --sky-900: #0a3d61;
  --navy:    #0a2540; --red: #c0392b; --gold: #d4a820;
  --white:   #ffffff; --off: #f4f8fc;
  --ink:     #1a1a2e; --ink-lt: #5a6a7e; --border: #d0e4f0;

  --sidebar-w: 240px;
  --topbar-h:  62px;
  --font-di:   'Playfair Display', serif;
  --font:      'Source Sans 3', sans-serif;
  --radius:    8px;
  --shadow:    0 2px 12px rgba(2,116,188,.10);
  --shadow-md: 0 6px 24px rgba(2,116,188,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Login Page ─────────────────────────────────────────────── */
.admin-login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sky-900) 0%, var(--navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  padding: 20px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(10,37,64,.4);
  overflow: hidden;
}
.login-brand {
  background: linear-gradient(135deg, var(--sky-800), var(--navy));
  padding: 32px 32px 26px;
  text-align: center;
  color: #fff;
}
.lb-main {
  font-family: var(--font-di);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #fff, var(--sky-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lb-sub-title {
  font-size: .78rem;
  color: var(--sky-200);
  margin-top: 6px;
  letter-spacing: .5px;
}
.lb-sub { font-size: .68rem; color: rgba(255,255,255,.45); margin-top: 3px; letter-spacing: 1px; }
.login-error {
  margin: 16px 32px 0;
  background: #fde8e8;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .85rem;
}
.login-form { padding: 26px 32px 16px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  font-family: var(--font);
}
.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .9rem;
  font-family: var(--font);
  color: var(--ink);
  background: var(--off);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(14,147,222,.15);
  background: #fff;
}
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: .5px;
  transition: opacity .2s;
}
.btn-login:hover { opacity: .9; }
.login-footer {
  text-align: center;
  padding: 14px 32px 22px;
  font-size: .8rem;
  border-top: 1px solid var(--border);
  font-family: var(--font);
}
.login-footer a { color: var(--sky-600); }

/* ── Admin Layout ───────────────────────────────────────────── */
.admin-body {
  font-family: var(--font);
  background: var(--off);
  color: var(--ink);
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
  transition: transform .3s;
}
.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-main {
  font-family: var(--font-di);
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
}
.sb-sub {
  font-size: .62rem;
  letter-spacing: 3px;
  color: var(--sky-400);
  text-transform: uppercase;
  margin-top: 3px;
}
.sidebar-nav { flex: 1; padding: 12px 0; display: flex; flex-direction: column; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
  border-left-color: var(--sky-400);
}
.sidebar-nav a.active {
  color: #fff;
  background: rgba(14,147,222,.2);
  border-left-color: var(--gold);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-divider { border-top: 1px solid rgba(255,255,255,.08); margin: 10px 20px; }
.logout-link { color: rgba(255,100,100,.7) !important; }
.logout-link:hover { color: #ff8080 !important; background: rgba(255,50,50,.1) !important; }

/* ── Main Area ──────────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.admin-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}
.sidebar-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.topbar-left { flex: 1; }
.topbar-date { font-size: .82rem; color: var(--ink-lt); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-user { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--ink); font-weight: 500; }
.user-avatar { font-size: 1.2rem; }

/* ── Content Area ───────────────────────────────────────────── */
.admin-content { flex: 1; padding: 28px; }
.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title h1 { font-size: 1.55rem; font-weight: 700; color: var(--sky-900); }
.page-title p  { color: var(--ink-lt); font-size: .86rem; margin-top: 3px; }

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  border-top: 4px solid transparent;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.sky  { border-top-color: var(--sky-400); }
.stat-card.blue { border-top-color: var(--sky-600); }
.stat-card.navy { border-top-color: var(--navy); }
.stat-card.red  { border-top-color: var(--red); }
.stat-icon  { font-size: 1.7rem; margin-bottom: 8px; }
.stat-num   { font-size: 1.9rem; font-weight: 700; color: var(--sky-800); line-height: 1; }
.stat-label { font-size: .72rem; color: var(--ink-lt); margin-top: 6px; line-height: 1.6; }

/* ── Admin Card ─────────────────────────────────────────────── */
.admin-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sky-50);
}
.card-head h2 { font-size: .95rem; font-weight: 700; color: var(--sky-800); }
.card-body-form,
.card-body-pad { padding: 20px 22px; }
.date-select-form,
.search-form { padding: 18px 22px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-admin-primary {
  background: var(--sky-600);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  transition: background .2s;
}
.btn-admin-primary:hover { background: var(--sky-800); color: #fff; }
.btn-admin-primary.btn-large { padding: 12px 28px; font-size: .95rem; }
.btn-admin-primary.btn-sm    { padding: 6px 14px; font-size: .78rem; }
.btn-admin-ghost {
  background: transparent;
  color: var(--sky-600);
  border: 1px solid var(--sky-400);
  border-radius: 6px;
  padding: 9px 20px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-family: var(--font);
  transition: all .2s;
}
.btn-admin-ghost:hover { background: var(--sky-50); color: var(--sky-800); }
.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity .2s;
}
.btn-danger:hover { opacity: .88; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.admin-table th {
  background: var(--sky-50);
  color: var(--sky-800);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--sky-50);
  color: var(--ink);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--sky-50); }
.admin-table tr.row-inactive td { opacity: .5; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge-pages {
  display: inline-block;
  background: var(--sky-100);
  color: var(--sky-800);
  border: 1px solid var(--sky-300);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-uploaded {
  background: #d4edda;
  color: #155724;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #c3e6cb;
}

/* ── Action Buttons ─────────────────────────────────────────── */
.action-cell { white-space: nowrap; }
.act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  font-size: .88rem;
  text-decoration: none;
  transition: opacity .2s;
  cursor: pointer;
  border: none;
  background: none;
  margin: 1px;
}
.act-btn:hover { opacity: .7; }
.act-btn.edit { background: var(--sky-100); }
.act-btn.view { background: #e8f5e9; }
.act-btn.del  { background: #fde8e8; color: var(--red); }

/* ── Cover Thumb ────────────────────────────────────────────── */
.cover-thumb {
  width: 40px; height: 52px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
}
.no-cover {
  width: 40px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--sky-50);
  border-radius: 3px;
}

/* ── Page Status Dots ───────────────────────────────────────── */
.page-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 4px; }
.dot {
  width: 20px; height: 20px;
  border-radius: 3px;
  font-size: .63rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dot.filled { background: var(--sky-600); color: #fff; }
.dot.empty  { background: var(--sky-50); color: var(--ink-lt); border: 1px solid var(--border); }

/* ── Form Layouts ───────────────────────────────────────────── */
.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ── Upload Grid ────────────────────────────────────────────── */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  padding: 20px 22px 0;
}
.upload-cell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--off);
}
.upload-cell.has-file { border-color: var(--sky-400); }
.upload-cell-label {
  padding: 9px 12px;
  background: var(--sky-50);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pg-num { font-size: .76rem; font-weight: 700; color: var(--sky-800); }
.current-thumb { padding: 8px; background: #fff; border-bottom: 1px solid var(--border); }
.current-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}
.pdf-indicator {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--sky-50);
  border-radius: 4px;
  color: var(--ink-lt);
}
.upload-drop-zone { display: block; padding: 10px; cursor: pointer; }
.upload-input { display: none; }
.drop-zone-inner {
  border: 2px dashed var(--sky-300);
  border-radius: 6px;
  padding: 16px 10px;
  text-align: center;
  transition: all .2s;
  background: var(--sky-50);
}
.upload-drop-zone:hover .drop-zone-inner {
  border-color: var(--sky-600);
  background: var(--sky-100);
}
.dz-icon  { display: block; font-size: 1.5rem; margin-bottom: 6px; }
.dz-text  { display: block; font-size: .78rem; font-weight: 600; color: var(--sky-700); }
.dz-hint  { display: block; font-size: .67rem; color: var(--ink-lt); margin-top: 3px; }
.dz-preview { padding: 8px; text-align: center; }
.dz-preview img { max-height: 90px; border-radius: 4px; margin: 0 auto; }
.preview-name { font-size: .68rem; color: var(--ink-lt); margin-top: 4px; word-break: break-all; }
.upload-actions {
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--sky-50);
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert-success,
.alert-error {
  padding: 13px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .86rem;
  line-height: 1.7;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #fde8e8; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Toggle Button ──────────────────────────────────────────── */
.toggle-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}
.toggle-btn.on  { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.toggle-btn.off { background: #f8f9fa; color: #6c757d; border-color: #dee2e6; }

/* ── Code Block ─────────────────────────────────────────────── */
.code-block {
  background: var(--navy);
  color: var(--sky-300);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  overflow-x: auto;
  white-space: nowrap;
}

/* ── Utilities ──────────────────────────────────────────────── */
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.mb-3 { margin-bottom: 14px; }
.mt-2 { margin-top: 8px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.py-5 { padding-top: 40px; padding-bottom: 40px; }
.text-center { text-align: center; }
.text-muted  { color: var(--ink-lt); }
.small       { font-size: .82rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row-3 { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-right .btn-admin-primary { display: none; }
}
@media (max-width: 480px) {
  .admin-content { padding: 16px; }
  .upload-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
