/* ============================================================
   ESVARBON CMS — Admin Panel Stylesheet
   Bootstrap 5 | Modern CMS UI
   ============================================================ */

:root {
  --adm-navy:    #0D2147;
  --adm-blue:    #1A3A8F;
  --adm-steel:   #1E5CB3;
  --adm-gold:    #B8860B;
  --adm-lgold:   #f5d060;
  --adm-sidebar: #0f1f42;
  --adm-sidebar-hover: rgba(255,255,255,.07);
  --adm-sidebar-active: rgba(255,255,255,.13);
  --adm-bg:      #f0f3f9;
  --adm-card:    #ffffff;
  --adm-border:  rgba(26,58,143,.1);
  --adm-text:    #1a2340;
  --adm-muted:   #5c6b8a;
  --adm-success: #16a34a;
  --adm-danger:  #dc2626;
  --adm-warning: #d97706;
  --adm-info:    #0891b2;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      12px;
  --shadow:      0 2px 16px rgba(26,58,143,.09);
  --shadow-lg:   0 8px 32px rgba(26,58,143,.14);
}

*, *::before, *::after { box-sizing: border-box; }
body.admin-body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--adm-bg);
  color: var(--adm-text);
  overflow-x: hidden;
  margin: 0;
}

/* ═══ SIDEBAR ═══ */
.admin-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--adm-sidebar);
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sb-logo {
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  border: 1.5px solid rgba(201,149,42,.4);
}
.sb-logo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.sb-name { font-size: 14px; font-weight: 700; color: #fff; }
.sb-sub  { font-size: 10px; color: rgba(255,255,255,.45); letter-spacing: .05em; }
.sb-close { margin-left: auto; background: transparent; border: none; color: rgba(255,255,255,.5); font-size: 18px; cursor: pointer; padding: 4px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.3); padding: 14px 10px 6px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,.65); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: all .18s; position: relative;
  margin-bottom: 2px;
}
.nav-item i { font-size: 17px; flex-shrink: 0; }
.nav-item:hover  { background: var(--adm-sidebar-hover); color: #fff; }
.nav-item.active { background: var(--adm-sidebar-active); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--adm-lgold); border-radius: 0 3px 3px 0;
}
.nav-badge {
  margin-left: auto; background: var(--adm-lgold); color: var(--adm-navy);
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
}

.sidebar-footer {
  padding: 14px 10px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
}
.sb-view-site, .sb-logout {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border-radius: 8px; font-size: 12.5px; font-weight: 500; text-decoration: none;
  transition: all .18s; color: rgba(255,255,255,.55);
}
.sb-view-site:hover { background: var(--adm-sidebar-hover); color: #fff; }
.sb-logout { color: rgba(255,100,100,.7); }
.sb-logout:hover { background: rgba(220,38,38,.15); color: #f87171; }
.sb-view-site i, .sb-logout i { font-size: 15px; }

/* ═══ MAIN AREA ═══ */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s ease;
}

/* ═══ TOP BAR ═══ */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--adm-card);
  border-bottom: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 12px rgba(26,58,143,.06);
  flex-shrink: 0;
}
.admin-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.bc-root   { color: var(--adm-muted); }
.bc-sep    { font-size: 11px; color: var(--adm-muted); opacity: .5; }
.bc-current{ font-weight: 600; color: var(--adm-text); }

.topbar-right-actions { display: flex; align-items: center; gap: 10px; }
.topbar-action-btn {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: var(--adm-muted); background: var(--adm-bg);
  text-decoration: none; transition: all .18s; font-size: 16px;
}
.topbar-action-btn:hover { background: var(--adm-blue); color: #fff; }

.topbar-user-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: transparent; border: 1px solid var(--adm-border); border-radius: 10px;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .18s;
}
.topbar-user-btn:hover { background: var(--adm-bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--adm-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--adm-text); line-height: 1.2; }
.user-role { font-size: 11px; color: var(--adm-muted); }

.sidebar-toggle-btn {
  background: transparent; border: 1px solid var(--adm-border); border-radius: 8px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: var(--adm-muted);
}

/* ═══ CONTENT AREA ═══ */
.admin-content { flex: 1; padding: 28px 28px 40px; }

/* ═══ STAT CARDS ═══ */
.stat-card {
  background: var(--adm-card); border: 1px solid var(--adm-border); border-radius: var(--radius);
  padding: 22px; transition: all .22s; cursor: default;
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px;
}
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--adm-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--adm-text); }
.stat-delta { font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.delta-up   { color: var(--adm-success); }
.delta-down { color: var(--adm-danger); }
.delta-neu  { color: var(--adm-muted); }

/* ═══ PANEL / CARD ═══ */
.adm-panel {
  background: var(--adm-card); border: 1px solid var(--adm-border);
  border-radius: var(--radius); overflow: hidden;
}
.adm-panel-header {
  padding: 18px 22px; border-bottom: 1px solid var(--adm-border);
  display: flex; align-items: center; justify-content: space-between;
}
.adm-panel-title { font-size: 14px; font-weight: 700; color: var(--adm-text); display: flex; align-items: center; gap: 8px; }
.adm-panel-title i { color: var(--adm-steel); font-size: 18px; }
.adm-panel-body { padding: 20px 22px; }

/* ═══ TABLE ═══ */
.adm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-table thead th {
  padding: 12px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--adm-muted); background: var(--adm-bg);
  border-bottom: 1px solid var(--adm-border); white-space: nowrap;
}
.adm-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--adm-border); color: var(--adm-text); vertical-align: middle; }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover { background: rgba(26,58,143,.02); }

/* ═══ BADGES ═══ */
.adm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.badge-active   { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #fee2e2; color: #dc2626; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-expired  { background: #f3e8ff; color: #7c3aed; }
.badge-published{ background: #dcfce7; color: #16a34a; }
.badge-draft    { background: #f3f4f6; color: #6b7280; }
.badge-notice   { background: #dbeafe; color: #1d4ed8; }
.badge-event    { background: #dcfce7; color: #166534; }
.badge-update   { background: #fef3c7; color: #92400e; }

/* ═══ BUTTONS ═══ */
.btn-adm-primary {
  background: var(--adm-blue); color: #fff; border: none; border-radius: 8px;
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .18s;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.btn-adm-primary:hover { background: var(--adm-navy); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,58,143,.3); }
.btn-adm-secondary {
  background: var(--adm-bg); color: var(--adm-muted); border: 1px solid var(--adm-border);
  border-radius: 8px; padding: 9px 18px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .18s;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.btn-adm-secondary:hover { background: #fff; color: var(--adm-text); border-color: var(--adm-steel); }
.btn-adm-danger {
  background: #fee2e2; color: var(--adm-danger); border: 1px solid #fca5a5;
  border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .18s;
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
}
.btn-adm-danger:hover { background: var(--adm-danger); color: #fff; }
.btn-adm-icon {
  width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; border: none; transition: all .15s; text-decoration: none;
}
.btn-adm-icon.edit   { background: #dbeafe; color: #1d4ed8; }
.btn-adm-icon.edit:hover   { background: var(--adm-blue); color: #fff; }
.btn-adm-icon.delete { background: #fee2e2; color: var(--adm-danger); }
.btn-adm-icon.delete:hover { background: var(--adm-danger); color: #fff; }
.btn-adm-icon.view   { background: var(--adm-bg); color: var(--adm-muted); }
.btn-adm-icon.view:hover   { background: var(--adm-steel); color: #fff; }

/* ═══ FORM ═══ */
.adm-form-group { margin-bottom: 20px; }
.adm-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--adm-muted); margin-bottom: 7px; }
.adm-form-group label .req { color: var(--adm-danger); margin-left: 3px; }
.adm-input, .adm-select, .adm-textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--adm-border);
  border-radius: 9px; background: #fff; color: var(--adm-text);
  font-size: 14px; font-family: 'Inter', sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  border-color: var(--adm-steel); box-shadow: 0 0 0 3px rgba(30,92,179,.1);
}
.adm-textarea { resize: vertical; min-height: 100px; }
.adm-form-hint { font-size: 12px; color: var(--adm-muted); margin-top: 5px; }

/* ═══ MODAL ═══ */
.modal-content { border-radius: 16px; border: none; box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.modal-header  { padding: 20px 24px; border-bottom: 1px solid var(--adm-border); }
.modal-title   { font-size: 16px; font-weight: 700; }
.modal-body    { padding: 24px; }
.modal-footer  { padding: 16px 24px; border-top: 1px solid var(--adm-border); }

/* ═══ ALERTS ═══ */
.adm-alert { padding: 14px 18px; border-radius: 10px; font-size: 13.5px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.adm-alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #16a34a; }
.adm-alert-danger  { background: #fef2f2; border: 1px solid #fca5a5; color: var(--adm-danger); }
.adm-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: var(--adm-warning); }
.adm-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: var(--adm-steel); }

/* ═══ SEARCH / FILTER BAR ═══ */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-input {
  padding: 9px 14px; border: 1.5px solid var(--adm-border); border-radius: 9px;
  font-size: 13px; font-family: 'Inter', sans-serif; outline: none; background: #fff; color: var(--adm-text);
  transition: border-color .2s; min-width: 220px;
}
.filter-input:focus { border-color: var(--adm-steel); }
.filter-select {
  padding: 9px 14px; border: 1.5px solid var(--adm-border); border-radius: 9px;
  font-size: 13px; font-family: 'Inter', sans-serif; outline: none; background: #fff; color: var(--adm-text);
}

/* ═══ PAGE TITLE BAR ═══ */
.page-title-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.ptb-title { font-size: 20px; font-weight: 700; color: var(--adm-text); }
.ptb-sub   { font-size: 13px; color: var(--adm-muted); margin-top: 2px; }

/* ═══ ACTIVITY FEED ═══ */
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--adm-border); }
.activity-item:last-child { border-bottom: none; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--adm-steel); flex-shrink: 0; margin-top: 5px; }
.act-action { font-size: 13px; color: var(--adm-text); font-weight: 500; }
.act-detail { font-size: 12px; color: var(--adm-muted); margin-top: 2px; }
.act-time   { font-size: 11px; color: var(--adm-muted); white-space: nowrap; margin-left: auto; }

/* ═══ TOGGLE SWITCH ═══ */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #d1d5db; border-radius: 24px; transition: .25s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; border-radius: 50%;
  left: 3px; bottom: 3px; background: white; transition: .25s;
}
input:checked + .toggle-slider { background: var(--adm-steel); }
input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ═══ OVERLAY / SIDEBAR MOBILE ═══ */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; display: none; }
.sidebar-overlay.show { display: block; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 18px 16px 30px; }
}
@media (max-width: 575px) {
  .adm-table thead { display: none; }
  .adm-table tbody td { display: block; border: none; padding: 6px 14px; }
  .adm-table tbody td::before { content: attr(data-label); font-weight: 600; color: var(--adm-muted); font-size: 11px; display: block; }
  .adm-table tbody tr { border-bottom: 1px solid var(--adm-border); margin-bottom: 8px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-input, .filter-select { min-width: unset; width: 100%; }
}

/* ═══ CHART BARS (admin finance) ═══ */
.adm-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.adm-bar-label { width: 120px; color: var(--adm-muted); text-align: right; flex-shrink: 0; font-size: 12px; }
.adm-bar-track { flex: 1; height: 8px; background: var(--adm-bg); border-radius: 4px; overflow: hidden; }
.adm-bar-fill  { height: 100%; border-radius: 4px; background: var(--adm-blue); width: 0; transition: width 1.2s cubic-bezier(.25,.46,.45,.94); }
.adm-bar-val   { width: 80px; text-align: right; font-weight: 600; color: var(--adm-text); font-size: 12px; }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--adm-bg); }
::-webkit-scrollbar-thumb { background: rgba(26,58,143,.2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,58,143,.4); }

/* ═══ REMITA SERVICE TYPE ADMIN CARDS ═══ */
.rst-adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-left: 4px solid #1A3A8F;
  border-radius: 12px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .2s;
}
.rst-adm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rst-adm-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.rst-adm-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.rst-adm-actions { display: flex; gap: 4px; }
.rst-adm-name { font-size: 14px; font-weight: 700; color: var(--adm-text); line-height: 1.3; }
.rst-adm-desc { font-size: 11.5px; color: var(--adm-muted); line-height: 1.5; flex: 1; }
.rst-adm-meta { font-size: 10px; color: var(--adm-muted); margin-top: auto; padding-top: 6px; border-top: 1px solid var(--adm-border); }
