/* ============================================================
   Sayaw Pilipinas — Admin CMS Stylesheet (Elegant Orange Theme)
   ============================================================ */

:root {
  --gold: #F97316;
  --gold-lt: #FB923C;
  --gold-soft: #FFF1E9;
  --deep: #111827;
  --ink: #2B2D34;
  --muted: #6B7280;
  --line: #ECEEF3;
  --sidebar-w: 250px;
  --sidebar-bg: #FAFBFD;
  --topbar-h: 72px;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(17, 24, 39, .08);
  --font: 'DM Sans', system-ui, sans-serif;
  --content-bg: #F4F6FB;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: var(--font);
  background:
    radial-gradient(circle at 10% 0%, #FFF3EC 0%, transparent 32%),
    radial-gradient(circle at 100% 100%, #EEF2FF 0%, transparent 32%),
    var(--content-bg);
  color: var(--ink);
  margin: 0;
}

/* ── Admin Wrapper ─────────────────────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: width .25s;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.admin-sidebar.collapsed { width: 60px; }
.admin-sidebar.collapsed .brand-name,
.admin-sidebar.collapsed .sidebar-link span,
.admin-sidebar.collapsed .nav-section-label,
.admin-sidebar.collapsed .user-info,
.admin-sidebar.collapsed .sidebar-promo { display: none; }
.admin-sidebar.collapsed .sidebar-link { justify-content: center; padding: .75rem; margin: 0 .4rem; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.2rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.brand-mark { color: var(--gold); font-size: 1.1rem; flex-shrink: 0; }
.brand-name { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: #0F172A; white-space: nowrap; }
.brand-name em { color: var(--gold); font-style: italic; }

.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #98A2B3;
  padding: .9rem 1.2rem .3rem;
  white-space: nowrap;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.1rem;
  color: #344054;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  transition: all .18s;
  white-space: nowrap;
  border-left: 3px solid transparent;
  margin: 0 .65rem;
  border-radius: 12px;
}
.sidebar-link i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.sidebar-link:hover { color: #101828; background: #F2F4F7; }
.sidebar-link.active {
  color: #B54708;
  background: linear-gradient(90deg, #FFF1E9 0%, #FFE4D6 100%);
  border-left-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(249,115,22,.08);
}
.sidebar-link.text-danger-soft { color: #C2410C; }
.sidebar-link.text-danger-soft:hover { color: #9A3412; background: #FFF1F2; }

.sidebar-promo {
  margin: 1rem .9rem 0;
  border-radius: 14px;
  padding: .9rem;
  background: linear-gradient(145deg, #FFF7F1, #FFEDE1);
  border: 1px solid #FFD7BF;
}
.promo-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: #fff;
  margin-bottom: .55rem;
}
.promo-title { font-weight: 700; font-size: .85rem; color: #7C2D12; }
.promo-text { color: #9A3412; font-size: .75rem; line-height: 1.45; margin-top: .2rem; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem; color: #fff;
  flex-shrink: 0;
}
.user-name { color: #111827; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.user-role { color: #98A2B3; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }

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

.admin-topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(15,23,42,.05);
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #475467;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
}
.topbar-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0;
  color: #111827;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: min(360px, 40vw);
  background: #fff;
  border: 1px solid #E4E7EC;
  border-radius: 999px;
  padding: .45rem .85rem;
}
.topbar-search i { color: #98A2B3; }
.topbar-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: .88rem;
  color: #344054;
}
.topbar-icons { display: flex; align-items: center; gap: .5rem; }
.icon-btn,
.avatar-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #E4E7EC;
  border-radius: 50%;
  background: #fff;
  color: #475467;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-btn { color: var(--gold); font-size: 1.1rem; }

.admin-content { padding: 1.5rem; flex: 1; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFD 100%);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid #EAECF0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(15,23,42,.1); }
.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-icon.gold  { background: rgba(249,115,22,.12); color: var(--gold); }
.stat-icon.blue  { background: rgba(59,130,246,.12); color: #2563EB; }
.stat-icon.red   { background: rgba(239,68,68,.12); color: #DC2626; }
.stat-icon.green { background: rgba(16,185,129,.12); color: #059669; }
.stat-num { font-family: 'Playfair Display', serif; font-size: 2rem; line-height: 1; color: var(--deep); }
.stat-label { font-size: .75rem; color: #98A2B3; text-transform: uppercase; letter-spacing: .1em; margin-top: .2rem; }

/* ── Content Cards ─────────────────────────────────────────── */
.admin-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid #EAECF0;
  overflow: hidden;
}
.admin-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #EAECF0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFCFD 100%);
}
.admin-card-title { font-size: .95rem; font-weight: 700; color: #101828; margin: 0; }
.admin-card-body  { padding: 1.25rem; }

/* ── Tables ─────────────────────────────────────────────────── */
.table { font-size: .875rem; }
.table thead th { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #98A2B3; border-bottom-width: 2px; }
.table > :not(caption) > * > * { border-color: #F0F2F5; }
.status-badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.status-badge.published { background: rgba(16,185,129,.12); color: #047857; }
.status-badge.draft     { background: rgba(249,115,22,.12); color: #C2410C; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-label { font-size: .78rem; font-weight: 700; color: #475467; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }
.form-control, .form-select {
  border-color: #D0D5DD;
  font-size: .9rem;
  border-radius: 10px;
}
.form-control:focus, .form-select:focus {
  border-color: #FDBA74;
  box-shadow: 0 0 0 4px rgba(249,115,22,.14);
}
.form-text { font-size: .75rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(249,115,22,.35);
}
.btn-gold:hover { filter: brightness(1.03); color: #fff; }
.btn-outline-gold { border: 1.5px solid #FDBA74; color: #C2410C; background: #fff; border-radius: 10px; }
.btn-outline-gold:hover { background: #FFF7ED; color: #9A3412; }

/* ── Upload Preview ─────────────────────────────────────────── */
.img-preview-wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.img-preview-item {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #E4E7EC;
}
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-item .remove-img {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px;
  background: rgba(17,24,39,.72);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: .7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── Login page ─────────────────────────────────────────────── */
.login-page { min-height: 100vh; background: var(--deep); display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .mark { font-size: 2.5rem; color: var(--gold); }
.login-logo h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--deep); margin: .5rem 0 .25rem; }
.login-logo p { color: #9B8880; font-size: .85rem; margin: 0; }

.text-gold { color: var(--gold) !important; }

.dataTables_wrapper {
  font-size: .92rem;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: #667085;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-weight: 600;
  color: #475467;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
  border: 1px solid #D0D5DD;
  border-radius: 10px;
  padding: .35rem .65rem;
  min-height: 36px;
  width: auto !important;
  display: inline-block;
  background: #fff;
  color: #344054;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: #FDBA74;
  box-shadow: 0 0 0 3px rgba(249,115,22,.14);
  outline: none;
}

.dataTables_wrapper .dataTables_info {
  font-size: .86rem;
  padding-top: .25rem;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 .15rem;
  padding: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button,
.pagination .page-link {
  border: 1px solid #E4E7EC;
  color: #475467;
  background: #fff;
  border-radius: 10px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-lt)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current .page-link,
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  border-color: transparent;
  color: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover .page-link,
.pagination .page-link:hover {
  background: #FFF7ED;
  color: #9A3412;
  border-color: #FDBA74;
}

.dataTables_wrapper .dataTables_processing {
  border-radius: 10px;
  border: 1px solid #F3D7C4;
  color: #9A3412;
  background: #FFF7ED;
}

@media (max-width: 768px) {
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    text-align: left !important;
  }

  .dataTables_wrapper .dataTables_filter label,
  .dataTables_wrapper .dataTables_length label {
    width: 100%;
  }

  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    width: 100% !important;
  }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .topbar-search { width: 240px; }
}

@media (max-width: 768px) {
  .admin-sidebar { left: calc(-1 * var(--sidebar-w)); }
  .admin-sidebar.mobile-open { left: 0; }
  .admin-main { margin-left: 0; }
  .topbar-search,
  .topbar-icons,
  .topbar-actions { display: none; }
  .topbar-title { font-size: 1.2rem; }
}
