/* ======================
   PREMIUM THEME SYSTEM
====================== */

:root {
  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --success:        #16a34a;
  --success-light:  #f0fdf4;
  --warning-light:  #fffbeb;

  --bg:             #f8fafc;
  --surface:        #ffffff;
  --surface-2:      #e8eaec;
  --border:         #e2e8f0;
  --border-focus:   #93c5fd;

  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;

  --brand:          #93c5fd;
  --brand-accent:var(--primary);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 12px rgba(0,0,0,.08);

  --sidebar-w:      240px;

  --header-h:       64px;

  --green:  #48bb78;
  --amber:  #ed8936;
  --red:    #f56565;
  --blue:   #63b3ed;

  
  --accent: #4f8ef7;
  --accent2: #7c5cfc;

}

body[data-theme="light"] {
  --bg: #f8fafc;
  --text: #0f172a;
  --card: rgba(255,255,255,0.7);
  --border: rgba(0,0,0,0.1);
  --sidebar: #ffffff;
  --navbar: rgba(255,255,255,0.7);

}




/* ======================
   GLOBAL
====================== */

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  transition: all 0.3s ease;
  overflow-y: scroll; 

}




/* ======================
   GLASS EFFECT
====================== */

.glass {
  backdrop-filter: blur(12px);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border-radius: 12px;
}

/* ======================
   SIDEBAR
====================== */

#sidebar {
  width: 240px;
  height: 100vh;
  position: fixed;
  background: var(--sidebar);
  padding: 20px;
  transition: all 0.3s ease;
}

#sidebar .nav-link {
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  transition: 0.2s;
}

#sidebar .nav-link:hover {
  background: rgba(255,255,255,0.08);
}

#sidebar .nav-link.active {
  background: rgba(0,0,0,0.3);
  font-weight: 600;
}

/* ======================
   NAVBAR
====================== */

.navbar {
  background: var(--navbar) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* ======================
   MAIN CONTENT
====================== */

.main-wrapper {
  margin-left: 240px;
  padding: 20px;
}

/* ======================
   CARDS
====================== */

.card {
  border: none;
  border-radius: 14px;
  padding: 10px;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ======================
   TABLE PREMIUM
====================== */

.table {
  border-radius: 10px;
  overflow: hidden;
}

.table thead {
  background: rgba(0,0,0,0.3);
}

.table tbody tr:hover {
  background: rgba(255,255,255,0.05);
}

/* Fix half white rows in dark theme */
.table tbody tr {
  background-color: transparent !important;
   transition: 0.2s;
}

.table tbody tr.table-success {
  --bs-table-bg: rgba(25, 135, 84, 0.2) !important;
  --bs-table-color: var(--text) !important;
}

.table tbody tr.table-danger {
  --bs-table-bg: rgba(220, 53, 69, 0.2) !important;
  --bs-table-color: var(--text) !important;
}

/* Fix striped rows if used */
.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg: rgba(255, 255, 255, 0.03) !important;
  color: var(--text) !important;
}

/* Fix hover */
.table tbody tr:hover > * {
  --bs-table-bg: rgba(255, 255, 255, 0.05) !important;
  color: var(--text) !important;
}
  


#tablePayment tbody td {
  vertical-align: middle !important;
}
/* ======================
   BUTTONS
====================== */

.btn {
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* ======================
   SCROLLBAR (premium touch)
====================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

/* ======================
   MOBILE
====================== */

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-240px);
  }

  #sidebar.active {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }
}

/* NAVBAR GLASS LOOK */
.navbar {
  margin-bottom: 20px;
  border-radius: 12px;
}

/* SEARCH INPUT */
.glass-input {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
}

.glass-input::placeholder {
  color: rgba(255,255,255,0.5);
}

body[data-theme="light"] .glass-input::placeholder {
  color: rgba(0,0,0,0.5);
}

/* DROPDOWN FIX */
.dropdown-menu {
  border-radius: 10px;
  border: none;
}


/* ICON BUTTONS */
.btn-outline-light {
  border-radius: 8px;
  backdrop-filter: blur(6px);
}

/* AVATAR */
img.rounded-circle {
  object-fit: cover;
}
.main-wrapper {
  margin-left: 240px;
  width: calc(100% - 240px);
}

/* SIDEBAR */
#sidebar {
  width: 240px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
}

/* MAIN CONTENT SHIFT */
.flex-grow-1 {
  margin-left: 240px;
  width: calc(100% - 240px);
}

/* NAVBAR FIX */
.navbar {
  width: 100%;
}

#sidebar.collapsed {
  margin-left: -240px;
}

#sidebar.collapsed + .main-wrapper {
  margin-left: 0;
  width: 100%;
}


@media (max-width: 768px) {
  #sidebar {
    margin-left: -240px;
  }

  #sidebar.active {
    margin-left: 0;
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
}


/* NAVIGATION CARDS */
/* ------------------------
   NAVIGATION CARDS
------------------------ */
.nav-card {
  transition: all 0.25s ease;
  cursor: pointer;
}

.nav-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

/* Glass background */
.card.glass {
  backdrop-filter: blur(12px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

/* Headings */
.card.glass h5 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Paragraphs / small text / links */
.card.glass p,
.card.glass span,
.card.glass small,
.card.glass a {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s;
}

/* Light mode overrides */
body[data-theme="light"] .card.glass p,
body[data-theme="light"] .card.glass span,
body[data-theme="light"] .card.glass small,
body[data-theme="light"] .card.glass a {
  color: rgba(0, 0, 0, 0.8);
}

/* Icons inside cards */
.card.glass i {
  color: var(--text);
  transition: color 0.3s;
}

/* Hover effect on links */
.card.glass a:hover {
  text-decoration: none;
  color: #3b82f6; /* accent color */
}

/* Optional: gradient headings for extra premium look */
.card.glass h5 {
  background: linear-gradient(90deg, #4f46e5, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* THEME BUTTON */
.btn-theme {
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.btn-theme:hover {
  background: rgba(255, 255, 255, 0.1);
}



.template-header {
  text-align: center;       /* center text and icon */
  vertical-align: middle;   /* vertical alignment if needed */
  font-weight: normal;      /* optional */
  padding: 10px;            /* optional spacing */
}

.template-header i {
  font-size: 24px;          /* make icon bigger */
  display: block;            /* ensure it’s on its own line */
  margin-bottom: 5px;        /* spacing between icon and name */
  color: #007bff;            /* optional icon color */
}

.template-header span {
  display: block;
  font-size: 14px;           /* title font size */
}

#globalAlert {
  transition: opacity 0.5s ease;
}


/* Fix filter form width to match table */
.filter-form {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}


::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05); /* dark theme track */
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}

/*==============================
    CASH PAYMENT
    ============================*/

        .payer-btn {
            height: 80px;
            font-size: 1.2rem;
        }

        .amount-display {
            font-size: 2.5rem;
            font-weight: bold;
            text-align: right;
            padding: 15px;
            background: #000;
            color: #0f0;
            border-radius: 10px;
        }

        .keypad button {
            height: 70px;
            font-size: 1.5rem;
        }

        .selected {
            border: 3px solid #198754 !important;
        }


/* ==== STATS CARDS =====

   /* ── Stats ── */
    .stat-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.25rem 1.5rem;
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    .stat-icon {
      width: 46px; height: 46px;
      border-radius: 12px;
      display: grid; place-items: center;
      font-size: 1.3rem;
      flex-shrink: 0;
    }
    .stat-icon.blue  { background: rgba(99,179,237,.15);  color: #63b3ed; }
    .stat-icon.green { background: rgba(72,187,120,.15);  color: #48bb78; }
    .stat-icon.amber { background: rgba(237,137,54,.15);  color: #ed8936; }
    .stat-icon.red   { background: rgba(245,101,101,.15); color: var(--red); }
    .stat-label { font-size: .75rem;  color: var(--text-primary);  margin-bottom: .15rem; }
    .stat-value { font-size: 1.4rem;  font-weight: 700; line-height: 1; color: #1e1f24; }
    .stat-sub   { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; }

       /* ── Form card ── */
    .form-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 2rem;
    }

    .section-divider {
      border-color: var(--border);
      margin: 1.75rem 0;
    }

    .section-label {
      font-size: .7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .8px;
      color: var(--text-primary);
      margin-bottom: 1rem;
    }

    /* ── Inputs ── */
    .form-label { font-size: .825rem; color: var(--text-muted); margin-bottom: .35rem; }
    .form-control, .form-select, textarea.form-control {
      background: rgba(255,255,255,.06);
      border: 1px solid var(--border);
      color: var(--text-primary);
      border-radius: 8px;
      font-size: .875rem;
      transition: border-color .2s, background .2s;
    }
    .form-control:focus, .form-select:focus, textarea.form-control:focus {
      background: rgba(255,255,255,.09);
      border-color: var(--brand-accent);
      color:var(--text-primary);
      box-shadow: 0 0 0 3px rgba(233,69,96,.15);
    }
    .form-control::placeholder, textarea.form-control::placeholder { color: var(--text-muted); }
    .form-select option { background: var(--surface-2); }
    .form-check-input:checked { background-color: var(--brand-accent); border-color: var(--brand-accent); }
    .form-check-label { font-size: .875rem; color: var(--text-muted); }

    /* ── Toggle button group ── */
    .btn-group .btn-outline-primary {
      background: transparent;
      border-color: var(--border);
      color: var(--text-muted);
      font-size: .825rem;
      transition: all .18s;
    }
    .btn-group .btn-outline-primary:hover {
      background: rgba(255,255,255,.06);
      color: #fff;
      border-color: rgba(255,255,255,.25);
    }
    .btn-group .btn-outline-primary.active,
    .btn-group .btn-check:checked + .btn-outline-primary {
      background: var(--brand-accent);
      border-color: var(--brand-accent);
      color: #fff;
    }

    .btn-accent {
      background: var(--brand-accent);
      border: none;
      color: #fff;
      border-radius: 8px;
      padding: .5rem 1rem;
      font-size: .875rem;
      font-weight: 500;
      cursor: pointer;
      display: flex; align-items: center; gap: .4rem;
      transition: opacity .2s;
      white-space: nowrap;
    }
    .btn-accent:hover { opacity: .88; color: #fff; }

    .btn-outline-dim {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text-primary);
      border-radius: 8px;
      padding: .5rem .85rem;
      font-size: .875rem;
      cursor: pointer;
      transition: all .2s;
    }
    .btn-outline-dim:hover { border-color: #fff; color: #fff; }


 /* ── Toolbar ── */
    .toolbar {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1rem 1.25rem;
      display: flex;
      align-items: center;
      gap: .75rem;
      flex-wrap: wrap;
    }
    .search-wrap { position: relative; flex: 1; min-width: 220px; }
    .search-wrap i {
      position: absolute; left: .85rem; top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted); pointer-events: none;
    }
    .search-wrap input {
      background: rgba(255,255,255,.05);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      border-radius: 8px;
      padding: .5rem .75rem .5rem 2.25rem;
      width: 100%;
      font-size: .875rem;
      transition: border-color .2s;
    }
    .search-wrap input:focus {
      outline: none;
      border-color: var(--brand-accent);
      background: rgba(255,255,255,.07);
    }
    .search-wrap input::placeholder { color: var(--text-muted); }

    /* ── Table card ── */
    .table-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
    }
    .table-card table { margin: 0; color: #e8eaf0; font-size: .875rem; }
    .table-card thead th {
      background: var(--surface-2);
      border-color: var(--border);
      color: var(--text-muted);
      font-weight: 600;
      font-size: .75rem;
      text-transform: uppercase;
      letter-spacing: .6px;
      padding: .85rem 1rem;
    }
    .table-card tbody td {
      border-color: var(--border);
      padding: .85rem 1rem;
      vertical-align: middle;
      color: var(--text-secondary);
    }
    .table-card tbody tr:hover td { background: rgba(255,255,255,.03); }
