/* =====================================================================
   HCF Admin Dashboard — Styles
   ===================================================================== */
:root {
  --primary: #0B3D2E;
  --primary-600: #0e4a38;
  --primary-300: #2f7a5f;
  --secondary: #D4AF37;
  --secondary-600: #c39f2c;
  --bg: #F7F8F9;
  --ink: #16241d;
  --muted: #5b6b63;
  --line: #e4e8e6;
  --danger: #d7433b;
  --success: #1f9d63;
  --amber: #e0951f;
  --glass-bg: rgba(255,255,255,0.78);
  --glass-brd: rgba(255,255,255,0.6);
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px -18px rgba(11,61,46,.28);
  --shadow-sm: 0 8px 24px -12px rgba(11,61,46,.25);
  --ring: 0 0 0 4px rgba(212,175,55,.22);
  --ease: cubic-bezier(.22,.61,.36,1);
  --sidebar-w: 250px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; }
h1,h2,h3 { font-weight: 700; letter-spacing: -.01em; margin: 0; }
a { text-decoration: none; cursor: pointer; }
code { background: rgba(11,61,46,.08); padding: 1px 6px; border-radius: 6px; color: var(--primary); font-size: .85em; }

.glass { background: var(--glass-bg); backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%); border: 1px solid var(--glass-brd);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.d-none { display: none !important; }

.brand-logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--primary), #14664c); box-shadow: var(--shadow-sm); }

/* ==================== LOGIN ==================== */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, #0b3d2e 0%, #0a2e23 100%); position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; }
.login-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.login-bg span:nth-child(1) { width: 380px; height: 380px; top: -80px; left: -60px; background: #2f7a5f; }
.login-bg span:nth-child(2) { width: 420px; height: 420px; bottom: -120px; right: -80px; background: #D4AF37; opacity: .3; }
.login-bg span:nth-child(3) { width: 300px; height: 300px; top: 40%; left: 55%; background: #58b88f; opacity: .25; }
.login-card { position: relative; z-index: 2; width: min(420px, 94vw); padding: 38px 34px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand h1 { color: var(--primary); font-size: 1.4rem; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.lf { position: relative; margin-bottom: 16px; }
.lf > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--primary-300); }
.lf input { width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 44px; font-size: .96rem; background: #fff; transition: all .2s var(--ease); }
.lf input:focus { outline: none; border-color: var(--secondary); box-shadow: var(--ring); }
.toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none;
  background: none; color: var(--muted); cursor: pointer; padding: 8px; }
.login-error { display: none; color: var(--danger); font-size: .82rem; margin: -4px 0 12px; }
.login-error.show { display: block; animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.login-hint { margin-top: 18px; text-align: center; font-size: .76rem; color: var(--muted); }
.btn { font-weight: 600; border-radius: 14px; transition: all .25s var(--ease); border: none; }
.btn-gold { background: linear-gradient(135deg, var(--secondary), #b8860b); color: #1c1403;
  box-shadow: 0 12px 28px -12px rgba(212,175,55,.7); }
.btn-gold:hover { transform: translateY(-2px); color: #1c1403; }
.btn-ghost-dark { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 9px 16px; }
.btn-ghost-dark:hover { color: var(--primary); border-color: var(--primary-300); }

/* ==================== APP SHELL ==================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--primary);
  color: #dfeae4; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0;
  height: 100vh; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 22px; }
.side-brand .brand-logo { background: rgba(255,255,255,.14); }
.side-brand-tx strong { display: block; font-size: .98rem; color: #fff; }
.side-brand-tx small { color: #9dbdb0; font-size: .72rem; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  color: #cfe0d8; font-weight: 500; font-size: .92rem; transition: all .2s var(--ease); }
.side-link i { width: 20px; text-align: center; color: #9dbdb0; transition: color .2s; }
.side-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-link.active { background: rgba(212,175,55,.18); color: #fff; }
.side-link.active i { color: var(--secondary); }
.side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.side-link.text-danger { color: #f3b0ab; }
.side-link.text-danger i { color: #f3b0ab; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { position: sticky; top: 12px; z-index: 20; margin: 12px 16px 0; display: flex; align-items: center;
  gap: 16px; padding: 14px 20px; border-radius: var(--radius); }
.hamburger { display: none; border: none; background: rgba(11,61,46,.06); color: var(--primary);
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-size: 17px; }
.topbar-title h2 { font-size: 1.25rem; color: var(--primary); }
.topbar-title small { color: var(--muted); font-size: .8rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  color: var(--primary); cursor: pointer; transition: all .2s var(--ease); }
.icon-btn:hover { background: var(--primary); color: #fff; transform: rotate(90deg); }
.admin-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(212,175,55,.16); color: var(--primary); font-weight: 600; font-size: .84rem; }

.content { padding: 20px 16px 40px; }
.view { display: none; }
.view.is-active { display: block; }

/* ==================== KPI ==================== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.kpi { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.kpi-ic { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 14px;
  font-size: 21px; color: #fff; }
.kpi-ic.green { background: linear-gradient(135deg, var(--primary), #14664c); }
.kpi-ic.gold { background: linear-gradient(135deg, var(--secondary), #b8860b); color: #1c1403; }
.kpi-ic.teal { background: linear-gradient(135deg, #2f7a5f, #1f9d63); }
.kpi-ic.amber { background: linear-gradient(135deg, #e0951f, #c47a10); }
.kpi-body small { color: var(--muted); font-size: .8rem; display: block; }
.kpi-body strong { font-size: 1.7rem; color: var(--primary); line-height: 1.1; }

/* ==================== PANELS / CHARTS ==================== */
.panel { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h3 { font-size: 1.05rem; color: var(--primary); display: flex; align-items: center; gap: 9px; }
.panel-head h3 i { color: var(--secondary-600); }
.chart-box { position: relative; }
.mini-link { color: var(--primary-300); font-weight: 600; font-size: .84rem; }
.mini-link:hover { color: var(--secondary-600); }

.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.6); transition: all .2s var(--ease); }
.recent-item:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.recent-av { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(11,61,46,.08); color: var(--primary); font-weight: 700; }
.recent-item .ri-main { flex: 1; min-width: 0; }
.recent-item .ri-main strong { font-size: .92rem; display: block; }
.recent-item .ri-main small { color: var(--muted); font-size: .78rem; }
.recent-item .ri-meta { text-align: right; font-size: .8rem; color: var(--muted); }

/* ==================== TOOLBAR + TABLE ==================== */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 260px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0 14px 0 40px; background: #fff; font-size: .9rem; }
.search-box input:focus { outline: none; border-color: var(--secondary); box-shadow: var(--ring); }
.filter-select { height: 44px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px;
  background: #fff; font-size: .88rem; color: var(--ink); cursor: pointer; }
.filter-select:focus { outline: none; border-color: var(--secondary); box-shadow: var(--ring); }
.toolbar-spacer { flex: 1; }

.table-wrap { padding: 8px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 14px 16px; border-bottom: 2px solid var(--line); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(212,175,55,.06); }
.data-table .text-end { text-align: right; }
.data-table .text-center { text-align: center; }
.vol-cell strong { display: block; }
.vol-cell small { color: var(--muted); font-size: .76rem; }

.badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 600; }
.badge-status.Pending { background: rgba(224,149,31,.15); color: #b06f0f; }
.badge-status.Approved { background: rgba(31,157,99,.15); color: #157a4b; }
.badge-status.Rejected { background: rgba(215,67,59,.15); color: #b6322b; }
.chip-chapter { background: rgba(11,61,46,.07); color: var(--primary); padding: 4px 10px; border-radius: 8px;
  font-size: .78rem; font-weight: 600; }

.file-links { display: inline-flex; gap: 8px; }
.file-links a { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(11,61,46,.06); color: var(--primary); font-size: .8rem; }
.file-links a:hover { background: var(--primary); color: #fff; }
.file-links a.dim { opacity: .35; pointer-events: none; }

.row-actions { display: inline-flex; gap: 6px; }
.act-btn { width: 34px; height: 34px; border-radius: 9px; border: none; cursor: pointer; font-size: .8rem;
  transition: all .18s var(--ease); }
.act-btn.view { background: rgba(11,61,46,.08); color: var(--primary); }
.act-btn.ok { background: rgba(31,157,99,.13); color: var(--success); }
.act-btn.no { background: rgba(215,67,59,.13); color: var(--danger); }
.act-btn:hover { transform: translateY(-2px); filter: brightness(.95); }
.act-btn.ok:hover { background: var(--success); color: #fff; }
.act-btn.no:hover { background: var(--danger); color: #fff; }
.act-btn.view:hover { background: var(--primary); color: #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 44px; color: var(--line); margin-bottom: 14px; }

/* ==================== EXPORTS ==================== */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.export-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: rgba(255,255,255,.7);
  cursor: pointer; text-align: left; transition: all .2s var(--ease); }
.export-card i { font-size: 26px; color: var(--secondary-600); margin-bottom: 6px; }
.export-card span { font-weight: 700; color: var(--primary); }
.export-card small { color: var(--muted); font-size: .8rem; }
.export-card:hover { transform: translateY(-3px); border-color: var(--secondary); box-shadow: var(--shadow-sm); }

/* ==================== MODAL ==================== */
.modal-backdrop-hcf { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 20px;
  background: rgba(11,61,46,.4); backdrop-filter: blur(6px); }
.modal-backdrop-hcf.show { display: grid; }
.detail-card { position: relative; width: min(680px, 96vw); max-height: 90vh; overflow-y: auto; padding: 32px; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 11px;
  border: none; background: rgba(11,61,46,.06); color: var(--primary); cursor: pointer; }
.modal-close:hover { background: var(--danger); color: #fff; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.detail-head .brand-logo { flex: 0 0 48px; }
.detail-head h3 { color: var(--primary); font-size: 1.3rem; }
.detail-head small { color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-cell { background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.detail-cell small { color: var(--muted); font-size: .72rem; display: block; }
.detail-cell strong { color: var(--ink); font-size: .94rem; }
.detail-full { grid-column: 1 / -1; }
.need-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.need-tag { background: rgba(212,175,55,.16); color: var(--secondary-600); padding: 4px 10px; border-radius: 8px;
  font-size: .76rem; font-weight: 600; }
.detail-actions { display: flex; gap: 10px; margin-top: 22px; }
.detail-actions .btn { flex: 1; padding: 12px; }
.btn-approve { background: var(--success); color: #fff; }
.btn-reject { background: var(--danger); color: #fff; }
.btn-open { background: var(--primary); color: #fff; }

/* ==================== TOASTS ==================== */
.toast-host { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column;
  gap: 12px; max-width: 360px; }
.hcf-toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: #fff; box-shadow: var(--shadow); border-left: 4px solid var(--primary); animation: toastIn .35s var(--ease); }
.hcf-toast.success { border-left-color: var(--success); }
.hcf-toast.error { border-left-color: var(--danger); }
.hcf-toast.info { border-left-color: var(--secondary); }
.hcf-toast .t-ic { font-size: 18px; }
.hcf-toast.success .t-ic { color: var(--success); }
.hcf-toast.error .t-ic { color: var(--danger); }
.hcf-toast.info .t-ic { color: var(--secondary-600); }
.hcf-toast .t-title { font-weight: 700; font-size: .9rem; }
.hcf-toast .t-msg { font-size: .82rem; color: var(--muted); }
.hcf-toast .t-close { border: none; background: none; color: var(--muted); cursor: pointer; margin-left: auto; }
@keyframes toastIn { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform: translateX(0); } }
.hcf-toast.leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastOut { to { opacity:0; transform: translateX(30px); } }

/* ==================== SKELETON ==================== */
.skeleton { position: relative; overflow: hidden; background: #edf1ef; border-radius: 8px; }
.skeleton::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .3s var(--ease);
    box-shadow: 0 0 60px rgba(0,0,0,.3); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: grid; place-items: center; }
  .main-area { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .topbar { margin: 12px 10px 0; padding: 12px 14px; }
  .content { padding: 16px 10px 34px; }
  .admin-chip span { display: none; }
  .toast-host { left: 10px; right: 10px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
