/* ================================================================
   ADMIN PANEL - Modern Design with Palatino
   ================================================================ */

/* ── Variables ── */
:root {
  --adm-sidebar-w   : 260px;
  --adm-bg          : #f0f2f5;
  --adm-sidebar-bg  : #16213e;
  --adm-sidebar-hover: rgba(255,255,255,.07);
  --adm-sidebar-active-bg: rgba(255,255,255,.12);
  --adm-accent      : var(--primary, #2EAA4B);
  --adm-accent2     : #e8a020;
  --adm-text        : #2d3748;
  --adm-text-muted  : #718096;
  --adm-border      : #e2e8f0;
  --adm-card-shadow : 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  --adm-radius      : 14px;
  --adm-topbar-h    : 64px;
}

/* ── Base ── */
.admin-body {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Nunito', sans-serif;
  background: var(--adm-bg);
  color: var(--adm-text);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ── Sidebar ── */
.admin-sidebar {
  width: var(--adm-sidebar-w);
  background: var(--adm-sidebar-bg);
  position: fixed; top: 0; left: 0;
  height: 100vh; overflow-y: auto; z-index: 1040;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* Sidebar Logo */
.admin-sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.admin-sidebar-logo .logo-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--adm-accent), #1d8a38);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(46,170,75,.4);
}
.admin-sidebar-logo .site-name {
  font-size: 13.5px; font-weight: 700; color: #fff;
  font-family: 'Palatino Linotype', Palatino, serif;
  line-height: 1.3;
}
.admin-sidebar-logo .site-tagline {
  font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px;
}

/* Sidebar Nav */
.admin-nav { padding: 12px 0 20px; flex: 1; }

.admin-nav-section {
  padding: 14px 20px 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  font-family: 'Nunito', sans-serif;
}

.admin-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px 10px 18px;
  color: rgba(255,255,255,.6); font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s; text-decoration: none;
  margin: 1px 10px; border-radius: 8px; border-left: none;
  font-family: 'Palatino Linotype', Palatino, serif;
}
.admin-nav-item i {
  width: 20px; text-align: center; font-size: 14px;
  color: rgba(255,255,255,.4); transition: color .2s;
}
.admin-nav-item:hover {
  color: #fff; background: var(--adm-sidebar-hover);
  transform: translateX(3px);
}
.admin-nav-item:hover i { color: rgba(255,255,255,.8); }
.admin-nav-item.active {
  color: #fff; background: var(--adm-sidebar-active-bg);
  box-shadow: inset 3px 0 0 var(--adm-accent);
  padding-left: 21px;
}
.admin-nav-item.active i { color: var(--adm-accent); }

/* ── Main Area ── */
.admin-main {
  margin-left: var(--adm-sidebar-w);
  min-height: 100vh; background: var(--adm-bg);
  display: flex; flex-direction: column;
}

/* ── Topbar ── */
.admin-topbar {
  height: var(--adm-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--adm-border);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--adm-border);
}
.admin-topbar-title {
  font-size: 18px; font-weight: 700; color: var(--adm-text);
  font-family: 'Palatino Linotype', Palatino, serif;
  letter-spacing: -.2px;
}
.admin-topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 40px; background: #f7f9fc;
  border: 1px solid var(--adm-border); cursor: pointer;
  transition: background .2s;
}
.admin-topbar-user:hover { background: #eef2f8; }
.admin-topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--adm-accent), #1d8a38);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.admin-topbar-name { font-size: 13px; font-weight: 600; color: var(--adm-text); }

/* ── Content ── */
.admin-content { padding: 28px; flex: 1; }

/* ── Cards ── */
.admin-card {
  background: #fff; border-radius: var(--adm-radius);
  box-shadow: var(--adm-card-shadow);
  padding: 24px; margin-bottom: 24px;
  border: 1px solid rgba(0,0,0,.04);
}
.admin-card > h6,
.admin-card > .fw-800 { font-family: 'Palatino Linotype', Palatino, serif; }

/* ── Stat Cards ── */
.stat-card {
  background: #fff; border-radius: var(--adm-radius);
  box-shadow: var(--adm-card-shadow);
  padding: 20px 22px; display: flex; align-items: center; gap: 16px;
  border: 1px solid rgba(0,0,0,.04);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.stat-card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.fi-orange { background: linear-gradient(135deg,#ff9a5c,#ff6b35); }
.fi-teal   { background: linear-gradient(135deg,#6ee7e0,#4ecdc4); }
.fi-blue   { background: linear-gradient(135deg,#5ab8d4,#118ab2); }
.fi-green  { background: linear-gradient(135deg,#5de8c5,#06d6a0); }
.stat-card-num {
  font-size: 26px; font-weight: 800; line-height: 1;
  font-family: 'Palatino Linotype', Palatino, serif;
}
.stat-card-label { font-size: 12.5px; color: var(--adm-text-muted); margin-top: 3px; }

/* ── Table ── */
.admin-table { border-collapse: separate; border-spacing: 0; }
.admin-table thead tr th {
  background: #f8fafc; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--adm-text-muted); padding: 10px 14px;
  border-bottom: 2px solid var(--adm-border);
  font-family: 'Nunito', sans-serif;
}
.admin-table tbody tr td {
  padding: 12px 14px; vertical-align: middle;
  border-bottom: 1px solid #f0f4f8; font-size: 14px;
  font-family: 'Palatino Linotype', Palatino, serif;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #fafbff; }

/* ── Badges ── */
.badge-status-1 {
  background: #d1fae5; color: #065f46; font-size: 11.5px; font-weight: 600;
  border-radius: 20px; padding: 3px 10px;
}
.badge-status-0 {
  background: #fee2e2; color: #991b1b; font-size: 11.5px; font-weight: 600;
  border-radius: 20px; padding: 3px 10px;
}

/* ── Form elements ── */
.card-label {
  font-size: 12.5px; font-weight: 700; color: var(--adm-text);
  margin-bottom: 6px; display: block;
  font-family: 'Palatino Linotype', Palatino, serif;
  letter-spacing: .01em;
}
.admin-body .form-control,
.admin-body .form-select {
  border-radius: 8px; border: 1.5px solid var(--adm-border);
  font-family: 'Palatino Linotype', Palatino, serif;
  font-size: 14px; transition: border-color .2s, box-shadow .2s;
  padding: 9px 13px;
}
.admin-body .form-control:focus,
.admin-body .form-select:focus {
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 3px rgba(46,170,75,.15);
  outline: none;
}
.admin-body .form-text { font-size: 12px; color: var(--adm-text-muted); }
.admin-body .form-check-input:checked { background-color: var(--adm-accent); border-color: var(--adm-accent); }

/* ── Buttons ── */
.btn-primary-custom {
  background: var(--adm-accent); color: #fff; border: none;
  border-radius: 8px; padding: 9px 20px; font-weight: 600;
  font-family: 'Palatino Linotype', Palatino, serif;
  transition: all .2s; box-shadow: 0 2px 8px rgba(46,170,75,.35);
}
.btn-primary-custom:hover {
  background: var(--primary-d, #1d8a38); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 14px rgba(46,170,75,.4);
}

/* ── Text utilities ── */
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fw-600 { font-weight: 600 !important; }
.text-primary-custom { color: var(--adm-accent) !important; }

/* ── Alert ── */
.admin-body .alert {
  border-radius: 10px; font-size: 14px;
  font-family: 'Palatino Linotype', Palatino, serif;
}
.admin-body .alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.admin-body .alert-danger  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ── Editor / Preview tabs ── */
#tabEditor, #tabPreview {
  font-family: 'Palatino Linotype', Palatino, serif;
  font-size: 13px; font-weight: 600;
  border-radius: 8px 8px 0 0;
  padding: 6px 16px;
  transition: all .2s;
}
#tabEditor.active  { background: var(--adm-accent); color: #fff; border-color: var(--adm-accent); }
#tabPreview.active { background: #16213e; color: #fff; border-color: #16213e; }
#tabPreview:not(.active) { border-color: var(--adm-border); color: var(--adm-text-muted); }

/* Summernote override */
.note-editor.note-frame { border-radius: 0 0 10px 10px; border-color: var(--adm-border) !important; }
.note-toolbar { background: #f8fafc !important; border-bottom: 1px solid var(--adm-border) !important; }
.note-editor .note-editing-area .note-editable {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px; line-height: 1.85; color: #444;
  padding: 20px 24px !important;
}

/* ── Login Page ── */
.admin-login-body {
  background: linear-gradient(135deg, #16213e 0%, #0f3460 60%, #1a1a2e 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  font-family: 'Palatino Linotype', Palatino, serif;
}
.admin-login-card {
  background: #fff; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 44px 40px; width: 100%; max-width: 400px;
}
.admin-login-logo {
  width: 68px; height: 68px; border-radius: 18px;
  background: linear-gradient(135deg, var(--adm-accent, #2EAA4B), #1d8a38);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 20px;
  box-shadow: 0 8px 20px rgba(46,170,75,.4);
}
.admin-login-title {
  font-size: 24px; font-weight: 800; text-align: center;
  color: var(--adm-text); margin-bottom: 6px;
  font-family: 'Palatino Linotype', Palatino, serif;
}
.admin-login-sub {
  font-size: 13px; color: var(--adm-text-muted); text-align: center; margin-bottom: 28px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(calc(-1 * var(--adm-sidebar-w))); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
@media (max-width: 575px) {
  .admin-content { padding: 16px; }
  .admin-login-card { padding: 32px 22px; }
}
