
/* ==========================================================================
   TailAdmin-style CSS Pack (Bootstrap-markup compatible)
   - Purpose: keep existing PHP/HTML structure, remove Bootstrap dependency,
     and make UI look like a modern premium Tailwind/TailAdmin dashboard.
   - This file intentionally uses plain CSS (no @apply) so it works with
     Tailwind CDN setups.
   ========================================================================== */

:root{
  --bg:#F8FAFC;            /* slate-50 */
  --panel:#FFFFFF;
  --text:#0F172A;          /* slate-900 */
  --muted:#64748B;         /* slate-500 */
  --border:#E2E8F0;        /* slate-200 */

  --primary:#059669;       /* emerald-600 */
  --primary-700:#047857;   /* emerald-700 */
  --primary-50:#ECFDF5;    /* emerald-50 */

  --info:#0EA5E9;          /* sky-500 */
  --warning:#F59E0B;       /* amber-500 */
  --danger:#E11D48;        /* rose-600 */

  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
  --shadow-md:0 10px 25px rgba(15,23,42,.10);
  --radius:16px;
}

/* Base */
html,body{height:100%;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;}

/* Container (Bootstrap-like) */
.container{
  width:100%;
  margin-left:auto;
  margin-right:auto;
  padding-left:1rem;
  padding-right:1rem;
}
@media (min-width: 768px){ .container{ max-width: 1024px; padding-left:1.25rem; padding-right:1.25rem; } }
@media (min-width: 1024px){ .container{ max-width: 1200px; } }

.py-4{ padding-top:1.25rem; padding-bottom:1.25rem; }
.mb-0{ margin-bottom:0 !important; }
.mb-1{ margin-bottom:.25rem !important; }
.mb-2{ margin-bottom:.5rem !important; }
.mb-3{ margin-bottom:1rem !important; }
.mb-4{ margin-bottom:1.25rem !important; }
.mt-1{ margin-top:.25rem !important; }
.mt-2{ margin-top:.5rem !important; }
.mt-3{ margin-top:1rem !important; }
.gap-1{ gap:.25rem !important; }
.gap-2{ gap:.5rem !important; }
.gap-3{ gap:1rem !important; }
.gap-4{ gap:1.25rem !important; }
.small{ font-size:.875rem; }
.text-muted{ color: var(--muted) !important; }
.text-warning{ color: #b45309 !important; }
.fw-bold{ font-weight:700 !important; }
.fs-5{ font-size:1.25rem !important; }
.h4, h4{ font-size:1.25rem; margin:0; }

/* Flex helpers */
.d-flex{ display:flex !important; }
.align-items-center{ align-items:center !important; }
.align-items-start{ align-items:flex-start !important; }
.justify-content-between{ justify-content:space-between !important; }
.justify-content-center{ justify-content:center !important; }
.flex-wrap{ flex-wrap:wrap !important; }

/* Grid helpers (basic) */
.row{ display:flex; flex-wrap:wrap; margin-left:-.5rem; margin-right:-.5rem; }
[class^="col-"], [class*=" col-"]{ padding-left:.5rem; padding-right:.5rem; }
.col-12{ width:100%; }
@media (min-width: 576px){
  .col-sm-6{ width:50%; }
  .col-sm-4{ width:33.3333%; }
  .col-sm-3{ width:25%; }
}
@media (min-width: 992px){
  .col-lg-3{ width:25%; }
  .col-lg-4{ width:33.3333%; }
  .col-lg-6{ width:50%; }
  .col-lg-8{ width:66.6666%; }
  .col-lg-9{ width:75%; }
}

/* ==========================================================================
   Topbar / Subnav (our partials/header.php)
   ========================================================================== */
.ta-topbar{
  background: linear-gradient(90deg, var(--primary-700), var(--primary));
  color:#fff;
  position:sticky;
  top:0;
  z-index:50;
  box-shadow: var(--shadow-sm);
}
.ta-topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:64px;
}
.ta-brand{
  font-weight:800;
  letter-spacing:.2px;
  font-size:1.05rem;
  display:flex;
  align-items:center;
  gap:.6rem;
}
.ta-brand::before{
  content:"";
  width:36px;height:36px;
  border-radius:12px;
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.ta-topbar-right{ display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.ta-role{
  padding:.35rem .6rem;
  border-radius:999px;
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  font-weight:700;
  font-size:.85rem;
  text-transform:capitalize;
}
.ta-notif{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.45rem .7rem;
  border-radius:12px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  font-weight:700;
  font-size:.9rem;
}
.ta-notif:hover{ background: rgba(255,255,255,.18); }
.ta-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#FDE68A;
  color:#111827;
  font-size:.75rem;
  font-weight:800;
}
.ta-subnav{
  background: #fff;
  border-bottom:1px solid var(--border);
}
.ta-subnav-inner{
  display:flex;
  gap:.35rem;
  padding:.55rem 0;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}
.ta-navlink{
  display:inline-flex;
  align-items:center;
  padding:.5rem .85rem;
  border-radius:999px;
  border:1px solid transparent;
  color: var(--muted);
  font-weight:700;
  font-size:.9rem;
  white-space:nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ta-navlink:hover{
  background: rgba(5,150,105,.08);
  color: var(--primary-700);
}
.ta-navlink.is-active{
  background: var(--primary-50);
  border-color: rgba(5,150,105,.25);
  color: var(--primary-700);
}

/* ==========================================================================
   Cards (Bootstrap .card compatible)
   ========================================================================== */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body{ padding: 1rem; }
@media (min-width:768px){ .card-body{ padding: 1.25rem; } }

.card-header{
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(2,6,23,.02);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.soft-shadow{ box-shadow: var(--shadow-md); }

/* Hero gradient (existing class) */
.hero-grad{
  background: linear-gradient(135deg, rgba(5,150,105,.10), rgba(14,165,233,.10));
}

/* KPI cards (existing class) */
.kpi-card{
  border-radius: 18px;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
  background: #fff;
  position: relative;
  overflow:hidden;
}
.kpi-card::before{
  content:"";
  position:absolute;
  inset:-30px -30px auto auto;
  width:120px;height:120px;
  background: rgba(5,150,105,.10);
  border-radius:999px;
  filter: blur(0px);
}
.kpi-card .kpi-icon{
  width:46px;height:46px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight:800;
  box-shadow: inset 0 0 0 1px rgba(5,150,105,.20);
}
.kpi-card .kpi-value{
  font-size:1.45rem;
  font-weight:900;
  letter-spacing:.2px;
}
.kpi-card .kpi-label{ color: var(--muted); font-weight:700; font-size:.9rem; }

/* ==========================================================================
   Buttons (Bootstrap-like)
   ========================================================================== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  padding:.6rem .9rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  user-select:none;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-sm{ padding:.45rem .7rem; border-radius: 10px; font-size:.875rem; font-weight:800; }

.btn-primary{
  background: var(--primary);
  color:#fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover{ background: var(--primary-700); box-shadow: var(--shadow-md); }

.btn-outline-primary{
  background: transparent;
  border-color: rgba(5,150,105,.30);
  color: var(--primary-700);
}
.btn-outline-primary:hover{
  background: rgba(5,150,105,.08);
  border-color: rgba(5,150,105,.45);
}

.btn-outline-secondary{
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-outline-secondary:hover{
  background: rgba(2,6,23,.03);
  color: var(--text);
}

.btn-outline-light{
  background: rgba(255,255,255,.10);
  color:#fff;
  border-color: rgba(255,255,255,.20);
}
.btn-outline-light:hover{ background: rgba(255,255,255,.18); }

.btn-danger{
  background: var(--danger);
  color:#fff;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover{ filter: brightness(.95); box-shadow: var(--shadow-md); }

.btn-dark{
  background: var(--text);
  color:#fff;
  box-shadow: var(--shadow-sm);
}
.btn-dark:hover{ box-shadow: var(--shadow-md); }

.btn-outline-success{
  background: transparent;
  border-color: rgba(5,150,105,.30);
  color: var(--primary-700);
}
.btn-outline-success:hover{ background: rgba(5,150,105,.08); border-color: rgba(5,150,105,.45); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control, .form-select, input[type="text"], input[type="number"], input[type="date"], input[type="password"], textarea, select{
  width:100%;
  padding:.65rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:#fff;
  color: var(--text);
  outline:none;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size:.95rem;
}
.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus{
  border-color: rgba(5,150,105,.45);
  box-shadow: 0 0 0 4px rgba(5,150,105,.12);
}
label{ font-weight:700; color: #334155; }

.input-group{ display:flex; gap:.5rem; align-items:stretch; }
.input-group > .form-control{ flex:1; }

.row.g-2{ gap:.5rem; }
.g-2{ gap:.5rem; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  background:#fff;
  border:1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
}
.table th, .table td{
  padding:.85rem .9rem;
  border-bottom:1px solid var(--border);
  font-size:.92rem;
}
.table thead th{
  background: rgba(2,6,23,.02);
  color:#334155;
  font-weight:800;
}
.table tbody tr:hover td{ background: rgba(2,6,23,.02); }
.table tbody tr:last-child td{ border-bottom:none; }

/* ==========================================================================
   Badges / Alerts
   ========================================================================== */
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  padding:.25rem .5rem;
  font-weight:800;
  font-size:.75rem;
  line-height:1;
}
.bg-warning{ background:#FDE68A !important; }
.text-dark{ color:#111827 !important; }

.alert{
  border-radius: var(--radius);
  padding: .9rem 1rem;
  border:1px solid var(--border);
  background:#fff;
  box-shadow: var(--shadow-sm);
}
.alert-warning{
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
}
.alert-success{
  border-color: rgba(5,150,105,.35);
  background: rgba(5,150,105,.10);
}

/* ==========================================================================
   Misc legacy classes seen in pages
   ========================================================================== */
.bg-light{ background: var(--bg) !important; }
.bg-dark{ background: var(--text) !important; }
.navbar, .navbar-dark, .navbar-expand-lg{ display:none !important; } /* old navbar disabled */



/* ==========================================================================
   TailAdmin-like Shell Layout (Sidebar + Content)
   ========================================================================== */
.ta-shell{
  display:flex;
  gap:16px;
  max-width:1200px;
  margin:0 auto;
  padding:16px;
}
.ta-sidebar{
  width:260px;
  flex:0 0 260px;
  background:linear-gradient(180deg, #064e3b 0%, #065f46 100%);
  color:#ecfdf5;
  border-radius:16px;
  padding:14px;
  box-shadow: 0 10px 30px rgba(2,6,23,.10);
  position:sticky;
  top:16px;
  height: calc(100vh - 32px);
  overflow:auto;
}
.ta-sidebar .ta-sidebar-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px 14px;
  border-bottom:1px solid rgba(255,255,255,.12);
  margin-bottom:12px;
}
.ta-sidebar .ta-avatar{
  width:40px;height:40px;border-radius:12px;
  background:rgba(255,255,255,.12);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
}
.ta-sidebar .ta-meta .ta-app{font-weight:800; letter-spacing:.2px;}
.ta-sidebar .ta-meta .ta-sub{font-size:12px; opacity:.8; margin-top:2px;}

.ta-side-nav{display:flex; flex-direction:column; gap:6px;}
.ta-sidelink{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius:12px;
  color:rgba(236,253,245,.92);
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  transition: all .15s ease;
}
.ta-sidelink:hover{ background:rgba(255,255,255,.10); color:#fff; }
.ta-sidelink.is-active{
  background:rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.ta-sidelink .ta-ico{
  width:28px;height:28px;border-radius:10px;
  background:rgba(255,255,255,.10);
  display:flex;align-items:center;justify-content:center;
  font-size:14px;
}

.ta-content{
  flex:1;
  min-width:0;
}
.ta-mobile-subnav{ display:none; }
.ta-main{ padding:0; }

/* Responsive: collapse sidebar to top nav */
@media (max-width: 991.98px){
  .ta-shell{ display:block; padding:12px; }
  .ta-sidebar{ position:static; width:auto; height:auto; margin-bottom:12px; }
  .ta-mobile-subnav{ display:block; }
}

/* ==========================================================================
   Premium Circle Metric Cards (Dashboard counters)
   ========================================================================== */
.ta-metric-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  display:flex;
  align-items:center;
  gap:14px;
  min-height:86px;
}
.ta-metric-card:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }

.ta-metric-icon{
  width:52px; height:52px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-size:18px; font-weight:900;
  position:relative;
  flex:0 0 52px;
}
.ta-metric-icon::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:999px;
  border:2px solid rgba(16,185,129,.18);
}
.ta-metric-body{ min-width:0; }
.ta-metric-label{ color: var(--muted); font-weight:700; font-size:13px; }
.ta-metric-value{ font-size:22px; font-weight:900; color: var(--text); margin-top:2px; line-height:1.1; }
.ta-metric-sub{ margin-top:6px; font-size:12px; color: var(--muted); font-weight:600; }

/* color tones */
.ta-tone-green .ta-metric-icon{ background:rgba(16,185,129,.12); color:#047857; }
.ta-tone-green .ta-metric-icon::after{ border-color: rgba(16,185,129,.22); }

.ta-tone-sky .ta-metric-icon{ background:rgba(14,165,233,.12); color:#0369a1; }
.ta-tone-sky .ta-metric-icon::after{ border-color: rgba(14,165,233,.22); }

.ta-tone-amber .ta-metric-icon{ background:rgba(245,158,11,.14); color:#b45309; }
.ta-tone-amber .ta-metric-icon::after{ border-color: rgba(245,158,11,.22); }

.ta-tone-rose .ta-metric-icon{ background:rgba(244,63,94,.12); color:#be123c; }
.ta-tone-rose .ta-metric-icon::after{ border-color: rgba(244,63,94,.22); }

.ta-tone-slate .ta-metric-icon{ background:rgba(100,116,139,.12); color:#334155; }
.ta-tone-slate .ta-metric-icon::after{ border-color: rgba(100,116,139,.22); }

/* Make existing KPI blocks look like metric cards when opted-in */
.kpi-card.ta-metric{
  display:flex;
  align-items:center;
  gap:14px;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow: var(--shadow-sm);
  padding:16px !important;
}
.kpi-card.ta-metric::before{
  content: attr(data-icon);
  width:52px;height:52px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  font-size:18px;font-weight:900;
  background:rgba(16,185,129,.12);
  color:#047857;
  position:relative;
  flex:0 0 52px;
}
.kpi-card.ta-metric::after{
  content:"";
  position:absolute;
  /* disabled; keep compatibility */
}
.kpi-card.ta-metric{ position:relative; }
.kpi-card.ta-metric::before{ position:relative; }
.kpi-card.ta-metric::before{
  box-shadow: inset 0 0 0 0 rgba(0,0,0,0);
}
.kpi-card.ta-metric::before{
  outline: 2px solid rgba(16,185,129,.18);
  outline-offset: 6px;
}
.kpi-card.ta-metric .kpi-title{ font-size:13px; font-weight:800; color: var(--muted); }
.kpi-card.ta-metric .kpi-value{ font-size:22px; font-weight:900; line-height:1.1; margin-top:2px; }

/* Variants for kpi-card */
.kpi-card.ta-tone-green::before{ background:rgba(16,185,129,.12); color:#047857; outline-color: rgba(16,185,129,.18); }
.kpi-card.ta-tone-amber::before{ background:rgba(245,158,11,.14); color:#b45309; outline-color: rgba(245,158,11,.20); }
.kpi-card.ta-tone-rose::before{ background:rgba(244,63,94,.12); color:#be123c; outline-color: rgba(244,63,94,.18); }
.kpi-card.ta-tone-sky::before{ background:rgba(14,165,233,.12); color:#0369a1; outline-color: rgba(14,165,233,.18); }
.kpi-card.ta-tone-slate::before{ background:rgba(100,116,139,.12); color:#334155; outline-color: rgba(100,116,139,.18); }

/* ===== Mobile sidebar toggle ===== */
.ta-mobilebar{
  display:none;
  padding:10px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.ta-menubtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  background: #e8faf2;
  color: #065f46;
  border: 1px solid #bbf7d0;
}

.ta-overlay{
  display:none;
}

/* Close button inside sidebar (mobile only) */
.ta-closebtn{
  display:none;
  margin-left:auto;
  height:34px;
  width:34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
}

/* Desktop default */
.ta-sidebar{ position: sticky; top: 0; height: 100vh; }

/* Mobile behavior */
@media (max-width: 991px){
  .ta-mobilebar{ display:flex; }
  .ta-sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(-110%);
    transition: transform .25s ease;
    z-index: 60;
  }
  .ta-sidebar.is-open{
    transform: translateX(0);
  }
  .ta-overlay{
    display:block;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    z-index: 50;
  }
  .ta-closebtn{ display:inline-flex; align-items:center; justify-content:center; }
}

.ta-mobilebar{display:none;padding:10px 12px;background:#fff;border-bottom:1px solid #e5e7eb}
.ta-menubtn{display:inline-flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;font-weight:700;font-size:14px;background:#e8faf2;color:#065f46;border:1px solid #bbf7d0}
.ta-overlay{display:none}
.ta-closebtn{display:none;margin-left:auto;height:34px;width:34px;border-radius:10px;border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.08);color:#fff;font-weight:900}

.ta-sidebar{position:sticky;top:0;height:100vh}

@media (max-width:991px){
  .ta-mobilebar{display:flex}
  .ta-sidebar{position:fixed;top:0;left:0;height:100vh;width:280px;transform:translateX(-110%);transition:transform .25s ease;z-index:60}
  .ta-sidebar.is-open{transform:translateX(0)}
  .ta-overlay{display:block;position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:50}
  .ta-closebtn{display:inline-flex;align-items:center;justify-content:center}
}

/* Topbar left group */
.ta-left{display:flex;align-items:center;gap:10px}

/* Mobile menu icon: top-left before brand */
.ta-top-menubtn{
  display:none;
  height:40px;width:44px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:18px;
  font-weight:900;
  line-height:1;
}

/* Overlay */
.ta-overlay{display:none}

/* Sidebar close button (mobile) */
.ta-closebtn{
  display:none;
  margin-left:auto;
  height:34px;width:34px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.08);
  color:#fff;
  font-weight:900;
}

/* Desktop: sidebar always visible */
.ta-sidebar{position:sticky;top:0;height:100vh}

/* Mobile: sidebar hidden by default, opens via .is-open */
@media (max-width: 991px){
  .ta-top-menubtn{display:inline-flex;align-items:center;justify-content:center}
  .ta-sidebar{
    position:fixed;top:0;left:0;
    height:100vh;width:280px;
    transform:translateX(-110%);
    transition:transform .25s ease;
    z-index:60;
  }
  .ta-sidebar.is-open{transform:translateX(0)}
  .ta-overlay{
    display:block;
    position:fixed;inset:0;
    background:rgba(15,23,42,.55);
    z-index:50;
  }
  .ta-closebtn{display:inline-flex;align-items:center;justify-content:center}
}
