/* ═══════════════════════════════════════════════════════════════
   Daily Nation — Admin Panel Stylesheet
═══════════════════════════════════════════════════════════════ */

:root {
  --adm-bg:      #0f172a;
  --adm-sidebar: #1e293b;
  --adm-border:  #334155;
  --adm-text:    #f1f5f9;
  --adm-muted:   #94a3b8;
  --adm-accent:  #FE0000;
  --adm-surface: #ffffff;
  --adm-radius:  8px;
  --adm-trans:   0.2s ease;
  --font-body:   'IBM Plex Sans Devanagari', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); font-size: .9rem; line-height: 1.5; }
img  { display: block; max-width: 100%; }
a    { text-decoration: none; }
ul   { list-style: none; }

/* ─── Admin Layout ───────────────────────────────────────────── */
.admin-body    { background: #f1f5f9; min-height: 100vh; }
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-main    { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
  width: 240px; background: var(--adm-sidebar); color: var(--adm-text);
  display: flex; flex-direction: column;
  transition: transform var(--adm-trans);
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 50;
  overflow-y: auto;
}
@media (max-width: 1023px) {
  .admin-sidebar              { transform: translateX(-100%); }
  .admin-sidebar.is-open      { transform: translateX(0); }
  .admin-main                 { margin-left: 0 !important; }
}
@media (min-width: 1024px) {
  .admin-sidebar { position: sticky; top: 0; }
  .admin-main    { margin-left: 0; }
}

.sidebar-brand { padding: 1.25rem 1rem; border-bottom: 1px solid var(--adm-border); text-align: center; }
.sidebar-logo  { font-family: var(--font-display); font-size: 1.4rem; font-weight: 900; color: #fff; letter-spacing: 0.5px; }
.sidebar-logo:hover { color: var(--adm-accent); }

.sidebar-nav { display: flex; flex-direction: column; padding: .75rem 0; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 1rem; color: var(--adm-muted); font-size: .88rem;
  border-left: 3px solid transparent; transition: all var(--adm-trans);
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--adm-text); background: rgba(255,255,255,.06);
  border-left-color: var(--adm-accent);
}
.sidebar-link .icon { font-size: 1.2rem; width: 24px; }

.sidebar-user { padding: .75rem 1rem; border-top: 1px solid var(--adm-border);
                 display: flex; align-items: center; gap: .6rem; }
.user-avatar  { width: 32px; height: 32px; border-radius: 50%;
                 background: var(--adm-accent); color: #fff;
                 display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-info    { flex: 1; line-height: 1.2; }
.user-info strong { font-size: .85rem; color: var(--adm-text); display: block; }
.user-info span   { font-size: .72rem; color: var(--adm-muted); }
.logout-btn   { color: var(--adm-muted); font-size: 1.1rem; transition: color var(--adm-trans); }
.logout-btn:hover { color: var(--adm-accent); }

/* ─── Topbar ─────────────────────────────────────────────────── */
.admin-topbar {
  background: var(--adm-surface); border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 40;
}
.sidebar-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer;
                   display: none; }
@media (max-width: 1023px) { .sidebar-toggle { display: block; } }
.admin-page-title { font-size: 1rem; font-weight: 700; flex: 1; }
.admin-topbar__actions { margin-left: auto; }

/* ─── Content ────────────────────────────────────────────────── */
.admin-content { padding: 1.5rem; flex: 1; }

/* ─── Stat Cards ─────────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .stat-cards { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--adm-surface); border-radius: var(--adm-radius);
  padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.stat-icon  { font-size: 2.2rem; color: var(--adm-accent); opacity: 0.8; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: #0f172a; line-height: 1; }
.stat-label { font-size: .75rem; color: #64748b; margin-top: 2px; }

/* ─── Quick Actions ──────────────────────────────────────────── */
.quick-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }

/* ─── Admin Section ──────────────────────────────────────────── */
.admin-section       { background: var(--adm-surface); border-radius: var(--adm-radius);
                        padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.admin-section-title { font-size: .95rem; font-weight: 700; margin-bottom: 1rem;
                        padding-bottom: .5rem; border-bottom: 1px solid #e2e8f0; }

/* ─── Table ──────────────────────────────────────────────────── */
.admin-table-wrap { background: var(--adm-surface); border-radius: var(--adm-radius);
                     overflow-x: auto; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th {
  background: #f8fafc; text-align: left; padding: .7rem .9rem;
  border-bottom: 1px solid #e2e8f0; font-size: .78rem;
  font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em;
}
.admin-table td { padding: .7rem .9rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }

.post-title-cell { max-width: 280px; }
.actions-cell    { display: flex; gap: .4rem; align-items: center; }

.btn-link { background: none; border: none; cursor: pointer; font-size: 1rem;
             transition: transform var(--adm-trans); }
.btn-link:hover { transform: scale(1.15); }
.btn-danger { color: #FE0000; }

/* Status Badges */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px;
                  font-size: .72rem; font-weight: 700; }
.status-published { background: #dcfce7; color: #166534; }
.status-draft     { background: #fef9c3; color: #854d0e; }

/* Role Badges */
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.role-admin  { background: #fee2e2; color: #991b1b; }
.role-editor { background: #dbeafe; color: #1e40af; }

/* ─── Admin Toolbar ──────────────────────────────────────────── */
.admin-toolbar { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ─── Admin Card ─────────────────────────────────────────────── */
.admin-card { background: var(--adm-surface); border-radius: var(--adm-radius);
               padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.admin-card-title { font-size: .85rem; font-weight: 700; margin-bottom: .75rem;
                     padding-bottom: .5rem; border-bottom: 1px solid #e2e8f0; }

/* ─── Post Form Grid ─────────────────────────────────────────── */
.post-form-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) { .post-form-grid { grid-template-columns: 1fr 300px; } }
.post-form-sidebar { display: flex; flex-direction: column; gap: 0; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group    { margin-bottom: 1rem; }
.form-label    { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: #374151; }
.form-control  {
  width: 100%; padding: .55rem .75rem; border: 1px solid #d1d5db;
  border-radius: var(--adm-radius); font-family: var(--font-body); font-size: .88rem;
  transition: border-color var(--adm-trans), box-shadow var(--adm-trans);
  background: #fff;
}
.form-control:focus { outline: none; border-color: #FE0000; box-shadow: 0 0 0 3px rgba(254,0,0,.12); }
.form-control-lg { font-size: 1.05rem; padding: .65rem .85rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control-file { font-size: .83rem; margin-top: .3rem; }
.form-hint  { font-size: .75rem; color: #94a3b8; margin-top: .25rem; display: block; }
.required   { color: var(--adm-accent); }
.form-row   { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; margin-top: .75rem; }
.form-narrow  { max-width: 560px; }

/* Input group */
.input-group { display: flex; align-items: center; border: 1px solid #d1d5db; border-radius: var(--adm-radius); overflow: hidden; }
.input-group .form-control { border: none; border-radius: 0; }
.input-prefix { background: #f8fafc; padding: .55rem .7rem; font-size: .8rem; color: #94a3b8; white-space: nowrap; border-right: 1px solid #d1d5db; }
.input-eye    { background: #f8fafc; border: none; padding: 0 .75rem; cursor: pointer; display: flex; align-items: center; border-left: 1px solid #d1d5db; color: #64748b; }

/* CSS Eye Icon */
.eye-icon {
  width: 18px; height: 10px; border: 2px solid currentColor; border-radius: 50% / 50%;
  position: relative; display: inline-block; transition: all .2s;
}
.eye-icon::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px; background: currentColor; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.eye-icon::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 0; height: 2px; background: currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
  transition: width .2s;
}
.is-visible .eye-icon::before { width: 22px; }
.is-visible .eye-icon::after  { opacity: 0.5; }

/* Image Preview */
.img-preview-wrap { margin-bottom: .6rem; border-radius: var(--adm-radius); overflow: hidden; }
.img-preview { width: 100%; max-height: 180px; object-fit: cover; }

/* Quill override */
.ql-editor { min-height: 380px; font-family: var(--font-body); font-size: 1rem; }

/* ─── Admin Two-col layout ───────────────────────────────────── */
.admin-two-col { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .admin-two-col { grid-template-columns: 320px 1fr; align-items: start; } }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
  align-items: center; justify-content: center;
}
.modal { background: #fff; border-radius: var(--adm-radius); padding: 1.5rem;
          width: 90%; max-width: 480px; box-shadow: 0 20px 40px rgba(0,0,0,.2); }
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }

/* ─── Media Grid ─────────────────────────────────────────────── */
.media-header { margin-bottom: 1rem; }
.media-count  { font-size: .85rem; color: #64748b; }
.media-grid   { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .media-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .media-grid { grid-template-columns: repeat(6, 1fr); } }
.media-item {
  border-radius: var(--adm-radius); overflow: hidden; background: #fff;
  border: 1px solid #e2e8f0; cursor: pointer; position: relative;
  transition: box-shadow var(--adm-trans);
}
.media-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.media-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; }
.media-item__info { padding: .3rem .4rem; }
.media-name  { display: block; font-size: .7rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-size  { font-size: .68rem; color: #94a3b8; }
.media-item__overlay {
  position: absolute; inset: 0; background: rgba(254,0,0,.85); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  opacity: 0; transition: opacity var(--adm-trans);
}
.media-item:hover .media-item__overlay { opacity: 1; }

/* Copy Toast */
.copy-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: .6rem 1.2rem;
  border-radius: 999px; font-size: .85rem; z-index: 999; box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert { padding: .8rem 1.2rem; border-radius: var(--adm-radius); margin-bottom: 1rem; font-size: .88rem; }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #FE0000; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert ul      { padding-left: 1.2rem; margin: 0; }

/* Buttons (admin) */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1.1rem; border-radius: var(--adm-radius);
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent; transition: all var(--adm-trans);
}
.btn .material-symbols-rounded { font-size: 1.25rem; }
.btn-primary { background: #FE0000; color: #fff; border-color: #FE0000; }
.btn-primary:hover { background: #E60000; }
.btn-outline { background: transparent; color: #374151; border-color: #d1d5db; }
.btn-outline:hover { border-color: #FE0000; color: #FE0000; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: .3rem .8rem; font-size: .8rem; }

/* ─── Login Page ─────────────────────────────────────────────── */
.login-body { background: #0f172a; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 420px; padding: 1rem; }
.login-card { background: #1e293b; border-radius: 14px; padding: 2.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo  { font-size: 1.6rem; font-weight: 800; color: #FE0000; }
.login-tagline { font-size: .82rem; color: #64748b; margin-top: .25rem; }
.login-form  { display: flex; flex-direction: column; gap: .6rem; }
.login-form .form-label   { color: #94a3b8; }
.login-form .form-control { background: #0f172a; color: #f1f5f9; border-color: #334155; }
.login-form .input-group { border-color: #334155; }
.login-form .input-eye   { background: #1e293b; border-left-color: #334155; color: #64748b; }
.login-form .input-eye:hover { color: #f1f5f9; }
.login-form .btn-primary  { margin-top: .5rem; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty-state a { color: #FE0000; }

/* Pagination */
.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1.5rem; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 6px; border: 1px solid #d1d5db; font-size: .82rem;
  transition: all var(--adm-trans);
}
.page-btn:hover, .page-btn.active { background: #FE0000; color: #fff; border-color: #FE0000; }

/* Dashboard */
.dashboard { display: flex; flex-direction: column; gap: 1.5rem; }
