/* ===================== RESET ===================== */

/* ... all other CSS styles from previous response ... */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4f6f9;
  color: #222;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
}

/* ===================== LOGIN ===================== */
.login-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  width: 360px;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(0,0,0,.15);
  text-align: center;
}

.school-logo {
  font-size: 48px;
}

.login-card h1 {
  margin: 10px 0;
  color: #1e3c72;
}

.login-card p {
  margin-bottom: 20px;
  color: #666;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
}

.auth-tabs button {
  flex: 1;
  border: none;
  padding: 10px;
  cursor: pointer;
  background: #eee;
  font-weight: bold;
}

.auth-tabs button:hover {
  background: #ddd;
}

.login-card form {
  display: flex;
  flex-direction: column;
}

.login-card select,
.login-card input {
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.login-card button {
  background: #1e3c72;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.login-card button:hover {
  background: #16305d;
}

#authMessage {
  margin-top: 10px;
  font-size: 14px;
  color: red;
}

/* ===================== HEADER ===================== */
.header {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: #1e293b;
  color: #fff;
  flex-wrap: wrap;
}

.header a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

/* ===================== DASHBOARD ===================== */
.main-content {
  display: flex;
  min-height: calc(100vh - 70px);
}

/* =========================
   PROFESSIONAL SIDEBAR NAV
========================= */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 64px; /* if header is sticky */
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 999px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 12px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
  border-radius: 14px;

  font-weight: 800;
  font-size: 14px;
  color: #111827;

  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.nav-item:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.nav-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  flex: 0 0 34px;
}

.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active state */
.nav-item.active {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 18px rgba(30, 64, 175, 0.25);
}

.nav-item.active .nav-ico {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.25);
}

/* =========================
   MOBILE: bottom scroll nav
========================= */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    top: auto;
    height: 72px;
    width: 100%;

    padding: 10px;
    border-right: none;
    border-top: 1px solid #e5e7eb;

    flex-direction: row;
    gap: 10px;

    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    z-index: 200;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 150px;
    justify-content: center;
    padding: 10px 12px;
  }

  .nav-ico { width: 32px; height: 32px; }
}

/* ===== CONTENT ===== */
.content-area {
  flex: 1;
  padding: 20px;
  overflow-x: hidden;
}

.page-content {
  display: none;
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.page-content.active {
  display: block;
}

/* ===================== TABLE ===================== */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.table th, .table td {
  border: 1px solid #ddd;
  padding: 10px;
}

.table th {
  background: #1e3c72;
  color: #fff;
}

/* ===================== BUTTONS ===================== */
button {
  outline: none;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
  }

  .sidebar button {
    flex: 1;
    margin-right: 5px;
  }
}

/* ===================== DASHBOARD CARDS ===================== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
}

.card h1 {
  font-size: clamp(24px, 3vw, 36px);
}

.card p {
  opacity: 0.9;
}

/* ===================== ANNOUNCEMENTS ===================== */
.notice {
  background: #fff;
  border-left: 6px solid #1e3c72;
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.notice strong {
  font-size: 16px;
  display: block;
  margin-bottom: 6px;
}

.notice p {
  color: #444;
  margin-bottom: 6px;
}

.notice small {
  color: #777;
}

/* ===================== SECTION CARDS ===================== */
.section-card {
  background: #fff;
  border-radius: 16px;
  padding: 25px 30px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  margin-top: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}

.section-header span {
  font-size: 22px;
}

/* ===================== INFO GRID ===================== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.info-block h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #555;
}

.info-block p {
  margin-bottom: 8px;
  font-size: 15px;
}

/* ===================== STATUS ===================== */
.status-active {
  color: #2ecc71;
  font-weight: bold;
}

/* ===================== ACTION BUTTON ===================== */
.primary-btn {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 15px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Container for the 3 Stat Cards */
.fee-stats-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
  margin-top: 15px;
}

/* Individual Stat Card Styling */
.stat-card {
  flex: 1;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.stat-card p {
  margin: 0 0 10px 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.stat-card strong {
  font-size: 1.8rem;
  display: block;
}

/* Specific Colors from the Image */
.total-fee {
  background-color: #ffffff; /* White background */
  border: 1px solid #dee2e6;
}

.amount-paid {
  background-color: #e8f5e9; /* Light green background */
  color: #2e7d32; /* Dark green text */
}

.amount-paid strong {
  color: #2e7d32;
}

.outstanding {
  background-color: #e8f5e9; /* Light green background (same as paid in image) */
  color: #2e7d32;
}

.outstanding strong {
  color: #2e7d32;
}

/* Styling for the horizontal divider line */
.section-divider {
  border: 0;
  height: 1px;
  margin: 20px 0;
}

/* Styling for the Payment History header */
.payment-history-header h4 {
  margin-bottom: 15px;
  color: #333;
}

/* ===================== ADMIN DASHBOARD ===================== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.quick-btn {
  background: #f4f6f9;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}

.quick-btn:hover {
  background: #1e3c72;
  color: #fff;
}

.activity-item {
  border-left: 4px solid #1e3c72;
  padding: 10px 15px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.activity-item small {
  color: #777;
}

.table-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

/* ================= ADMIN TABLE CORE ================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 12px;
}

/* MAIN TABLE */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* ⭐ KEY FIX */
  background: #fff;
}

/* HEADERS */
.admin-table th {
  background: #f1f5f9;
  font-weight: 600;
  padding: 10px;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

/* CELLS */
.admin-table td {
  padding: 10px;
  font-size: 14px;
  vertical-align: middle;

  /* ⭐ TEXT SAFETY */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ROW LINES */
.admin-table tr {
  border-bottom: 1px solid #e5e7eb;
}

/* ACTION COLUMN */
.admin-table .col-actions {
  text-align: center;
  white-space: nowrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 10px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f1f5f9;
}

.status.active {
  color: green;
  font-weight: bold;
}

.btn-sm {
  padding: 5px 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-sm.danger {
  background: #c0392b;
  color: #fff;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  background: #f4f6f8;
  font-weight: bold;
}

.data-table td:last-child,
.data-table th:last-child {
  text-align: center;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 15px;
}

.notice-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  position: relative;
}

.notice-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.notice-body {
  color: #444;
  margin-bottom: 12px;
}

.notice-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

.notice-category {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
}

.notice-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.badge.warning {
  background: #fcd34d; /* orange */
  color: #92400e;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 12px;
  font-weight: 600;
}

.dashboard-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.card {
  flex: 1;
  min-width: 200px;
  padding: 20px;
  border-radius: 10px;
  color: #1f2937;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.card h1 {
  font-size: 28px;
  margin: 0 0 8px 0;
}

.card.total-enrollments { background: #dbeafe; color: #1e40af; } /* light blue */
.card.active-teachers { background: #d1fae5; color: #065f46; } /* light green */
.card.monthly-revenue { background: #fef3c7; color: #92400e; } /* light yellow */

/* Standard buttons */
button.btn-primary {
  background-color: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

button.btn-warning {
  background-color: #facc15;
  color: #1f2937;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

button.btn-info {
  background-color: #f97316;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

button.btn-danger {
  background-color: #dc2626;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

/* Hover effects */
button:hover {
  opacity: 0.9;
}

#schoolInfo, #systemStatus {
  padding: 12px 15px;
  background-color: #f3f4f6; /* subtle light gray */
  border-radius: 8px;
  line-height: 1.6;
}

#schoolInfo p, #systemStatus p {
  margin: 6px 0;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-box h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 15px;
}

.modal-box input, .modal-box textarea, .modal-box select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db; /* light gray border */
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .dashboard-cards, .table-controls {
    flex-direction: column;
  }
  .modal-box {
    width: 90%;
  }

  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }

  .sidebar button {
    white-space: nowrap;
    font-size: 14px;
  }

  .header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .content-area {
    padding: 12px;
  }

  .data-table th,
  .data-table td {
    font-size: 13px;
    padding: 8px;
  }
}

/* ===============================
   RESPONSIVE SIDEBAR
================================ */
@media (max-width: 900px) {
  .sidebar {
    width: 72px;
  }

  .sidebar button {
    text-align: center;
    font-size: 0;
  }

  .sidebar button::before {
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }
}

.resource-card {
  border: 1px solid #e5e7eb;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  background: #fff;
}

.resource-card h3 {
  margin: 0;
  font-size: 16px;
}

.resource-card .meta {
  font-size: 13px;
  color: #555;
  margin-top: 5px;
}

.resource-card .actions {
  margin-top: 10px;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.notice-card {
  background:#f9fafb;
  border-left:4px solid #1e88e5;
  padding:12px 15px;
  margin-bottom:12px;
  border-radius:6px;
}

.notice-title {
  font-weight:600;
  font-size:15px;
  display:flex;
  justify-content:space-between;
}

.notice-category {
  background:#e3f2fd;
  color:#1565c0;
  padding:2px 8px;
  border-radius:12px;
  font-size:12px;
}

.notice-message {
  margin-top:6px;
  color:#444;
}

.notice-date {
  margin-top:6px;
  font-size:12px;
  color:#777;
}

.show-password {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  margin: 5px 0 15px;
  color: #555;
}

.show-password input {
  cursor: pointer;
}

.finance-tab {
  display: none;
  margin-top: 20px;
}

.finance-tab.active {
  display: block;
}

.inline-form {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.school-logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.school-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px; /* modern rounded square */
}

/* ===================== SCROLLABLE TABLE (PHONE + PC) ===================== */
/* ✅ UPDATED: disable the scroll feature & allow tables to fit */
.table-scroll {
  width: 100%;
  overflow: visible; /* was auto */
  -webkit-overflow-scrolling: auto;
  border-radius: 12px;
}

/* was forcing horizontal scroll; now allow normal fit */
.table-scroll .data-table,
.table-scroll .admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 0;
}

/* allow wrap */
.table-scroll th,
.table-scroll td {
  white-space: normal;
  word-break: break-word;
}

/* ===================== SCHOOL MODAL ===================== */
#schoolModal.modal {
  position: fixed;
  inset: 0;
  display: none; /* you toggle via JS */
  background: rgba(0, 0, 0, 0.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px; /* keeps it nice on small screens */
}

#schoolModal .modal-content {
  width: 420px;
  max-width: 95vw;
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  position: relative;
  animation: popIn 0.15s ease-out;
}

#schoolModal .modal-content h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
}

/* Inputs */
#schoolModal .modal-content input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
  background: #fff;
}

#schoolModal .modal-content input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Buttons row */
#schoolModal .modal-content > div {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px !important; /* overrides inline margin if needed */
}

/* If your global button styles already exist, this will still work nicely */
#schoolModal .btn-primary,
#schoolModal .btn-danger {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* Optional nicer hover feel */
#schoolModal .btn-primary:hover,
#schoolModal .btn-danger:hover {
  opacity: 0.92;
}

/* Animation */
@keyframes popIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* Mobile */
@media (max-width: 480px) {
  #schoolModal .modal-content {
    padding: 18px 16px 14px;
  }

  #schoolModal .modal-content > div {
    justify-content: stretch;
  }

  #schoolModal .btn-primary,
  #schoolModal .btn-danger {
    width: 100%;
  }
}

/* ===== AUTH THEME (Demo Academy + Chinembiri style) ===== */
.auth-body{
  min-height:100vh;
  background:#0b1220;
  position:relative;
}
.auth-bg{
  position:fixed;
  inset:0;
  background:
    radial-gradient(900px 500px at 15% 20%, rgba(37,99,235,.35), transparent 60%),
    radial-gradient(800px 500px at 85% 30%, rgba(16,185,129,.20), transparent 60%),
    radial-gradient(900px 600px at 50% 90%, rgba(59,130,246,.18), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #0a1020 60%, #0b1220 100%);
  pointer-events:none;
}

.auth-card{
  width:min(480px, 100%);
  border-radius:18px;
  padding:24px;
  background:rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border:1px solid rgba(255,255,255,.55);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.auth-logo{ margin-bottom:10px; }
.auth-title h1{
  font-size:24px;
  margin:6px 0 2px;
  color:#0f172a;
}
.auth-title p{ color:#64748b; margin-bottom:14px; }

.auth-tabs{
  display:flex;
  gap:10px;
  margin:12px 0 16px;
}
.auth-tab-btn{
  flex:1;
  border:1px solid #e5e7eb;
  background:#f8fafc;
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
}
.auth-tab-btn:hover{ background:#eef2ff; border-color:#c7d2fe; }

.auth-form{ display:block; }
.auth-field{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.auth-label{ font-size:13px; font-weight:800; color:#0f172a; }

.auth-form input,
.auth-form select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#fff;
}

.auth-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin:6px 0 12px;
}

.auth-link{
  border:none;
  background:transparent;
  color:#2563eb;
  font-weight:800;
  cursor:pointer;
  padding:0;
}
.auth-link:hover{ text-decoration:underline; }

.auth-submit{
  width:100%;
  padding:12px 14px;
  border:none;
  border-radius:12px;
  font-weight:900;
  color:#fff;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  box-shadow: 0 10px 20px rgba(37,99,235,.25);
}
.auth-submit:hover{ opacity:.95; }

.auth-hint{
  margin-top:10px;
  font-size:12px;
  color:#475569;
}
.muted{ color:#64748b; }

.auth-message{
  margin-top:12px;
  font-size:13px;
  color:#b91c1c;
  font-weight:700;
}

.auth-footer{
  margin-top:14px;
  font-size:12px;
  color:#64748b;
  text-align:center;
}

.auth-demo{
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 12px;
  margin: 6px 0 14px;
}
.auth-demo-title{
  font-weight:900;
  color:#0f172a;
  margin-bottom:8px;
}
.auth-demo-credentials{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.auth-pill{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#1e40af;
  font-size:12px;
  font-weight:800;
}
.auth-demo-note{
  margin-top:8px;
  font-size:12px;
  color:#64748b;
}

@media (max-width:480px){
  .auth-card{ padding:18px; border-radius:16px; }
  .auth-title h1{ font-size:20px; }
}

/* =========================
   DASHBOARD PRO (namespaced)
   Safe: won't clash with .card, .notice-card etc
========================= */
#dashboard {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

/* Header */
#dashboard .dash-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
#dashboard .dash-title{
  margin:0;
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
  color:#0f172a;
}
#dashboard .dash-subtitle{
  margin:6px 0 0;
  color: var(--muted);
  font-size:14px;
}
#dashboard .chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--border);
  font-size:13px;
  color:#111827;
}

/* Stats grid */
#dashboard .stats-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
  margin: 12px 0 16px;
}
#dashboard .stat-card{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:14px 14px 12px;
  color:#fff;
  box-shadow:0 12px 30px rgba(37,99,235,.18);
  position:relative;
  overflow:hidden;
}
#dashboard .stat-card::after{
  content:"";
  position:absolute;
  right:-48px;
  top:-48px;
  width:160px;
  height:160px;
  border-radius:50%;
  background:rgba(255,255,255,.10);
}
#dashboard .stat-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  position:relative;
  z-index:1;
}
#dashboard .stat-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.18);
  font-size:16px;
}
#dashboard .stat-label{
  font-size:13px;
  opacity:.95;
  font-weight:800;
}
#dashboard .stat-value{
  font-size:28px;
  font-weight:950;
  letter-spacing:.2px;
  line-height:1.1;
  position:relative;
  z-index:1;
}
#dashboard .stat-unit{
  font-size:14px;
  opacity:.9;
  margin-left:4px;
}
#dashboard .stat-foot{
  margin-top:6px;
  font-size:12px;
  opacity:.9;
  position:relative;
  z-index:1;
}

/* Panels grid */
#dashboard .dash-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
}

/* Panel */
#dashboard .panel{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 12px 26px rgba(16,24,40,.07);
}
#dashboard .panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
#dashboard .panel-title{
  margin:0;
  font-size:15px;
  font-weight:900;
  color:#0f172a;
}
#dashboard .panel-badge{
  font-size:12px;
  color:#0f172a;
  background:#f3f4f6;
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
}

/* Table */
#dashboard .table-wrap{
  overflow:auto;
  border-radius:12px;
  border:1px solid #eef2f7;
}
#dashboard table.table.modern{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
#dashboard table.table.modern thead th{
  background:#f9fafb;
  border-bottom:1px solid #eef2f7;
  color:#374151;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:12px;
  white-space:nowrap;
}
#dashboard table.table.modern td{
  padding:12px;
  border-bottom:1px solid #f1f5f9;
  color:#111827;
  font-size:14px;
  white-space:nowrap;
}
#dashboard table.table.modern tbody tr:hover{
  background:#fbfdff;
}
#dashboard .pill{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  border:1px solid #e0e7ff;
  color:#1e40af;
  font-weight:900;
  font-size:12px;
}
#dashboard .td-strong{ font-weight:900; }

/* Announcement list */
#dashboard .notice-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
#dashboard .notice-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
#dashboard .notice-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
#dashboard .notice-title{
  font-weight:900;
  color:#0f172a;
}
#dashboard .notice-date{
  color: var(--muted);
}
#dashboard .notice-msg{
  margin:8px 0 0;
  color:#374151;
  font-size:14px;
  line-height:1.4;
}

/* Empty states */
#dashboard .empty{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  border:1px dashed #d1d5db;
  background:#fafafa;
  border-radius:14px;
}
#dashboard .empty-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  background:#f3f4f6;
  display:grid;
  place-items:center;
}

/* Responsive */
@media (max-width: 1100px){
  #dashboard .stats-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  #dashboard .dash-grid{ grid-template-columns:1fr; }
}
@media (max-width: 520px){
  #dashboard .stats-grid{ grid-template-columns:1fr; }
  #dashboard .dash-header{ flex-direction:column; align-items:flex-start; }
}

/* =========================
   PROFILE PRO (namespaced)
========================= */
#profile{
  background: transparent;
  padding: 0;
  box-shadow: none;
}

#profile .profile-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}

#profile .profile-title{
  margin:0;
  font-size:22px;
  font-weight:950;
  color:#0f172a;
}
#profile .profile-subtitle{
  margin:6px 0 0;
  color: var(--muted);
  font-size:14px;
}

#profile .profile-badges{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
#profile .chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--border);
  font-size:13px;
  color:#111827;
  font-weight:800;
}
#profile .status-chip{
  background:#dcfce7;
  border-color:#bbf7d0;
  color:#166534;
}

#profile .profile-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:0 12px 26px rgba(16,24,40,.07);
}

#profile .profile-top{
  display:grid;
  grid-template-columns: 64px 1fr auto;
  gap:14px;
  align-items:center;
}

#profile .avatar{
  width:64px;
  height:64px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  font-weight:950;
  letter-spacing:.5px;
  box-shadow:0 10px 20px rgba(37,99,235,.22);
}
#profile .avatar span{ font-size:18px; }

#profile .profile-name{
  margin:0;
  font-size:18px;
  font-weight:950;
  color:#0f172a;
}
#profile .profile-id{
  margin:4px 0 0;
  color:#475569;
  font-size:13px;
}

#profile .profile-mini{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
#profile .mini-pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:7px 10px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  color:#0f172a;
  font-size:12px;
  font-weight:800;
}

#profile .profile-actions{
  text-align:right;
}
#profile .btn-pro{
  border:none;
  border-radius:12px;
  padding:10px 14px;
  font-weight:950;
  color:#fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow:0 10px 20px rgba(37,99,235,.25);
  cursor:pointer;
}
#profile .btn-pro:hover{ opacity:.95; }
#profile .profile-note{
  margin:8px 0 0;
  font-size:12px;
  color: var(--muted);
}

#profile .soft-hr{
  border:0;
  height:1px;
  background:#eef2f7;
  margin:14px 0;
}

#profile .profile-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}

#profile .profile-panel{
  border:1px solid #eef2f7;
  border-radius:14px;
  padding:12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

#profile .panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
#profile .panel-title{
  margin:0;
  font-size:14px;
  font-weight:950;
  color:#0f172a;
}

/* key-value rows */
#profile .kv{
  display:flex;
  flex-direction:column;
  gap:10px;
}
#profile .kv-row{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:10px 10px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid #eef2f7;
}
#profile .k{
  color:#64748b;
  font-size:12px;
  font-weight:900;
}
#profile .v{
  color:#0f172a;
  font-size:13px;
  font-weight:900;
  text-align:right;
}

/* status pill */
#profile .status-pill{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#dcfce7;
  border:1px solid #bbf7d0;
  color:#166534;
  font-weight:950;
  font-size:12px;
}

/* callout */
#profile .callout{
  margin-top:12px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px;
  border-radius:14px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
}
#profile .callout-ico{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#dbeafe;
  color:#1e40af;
  font-weight:900;
}
#profile .callout strong{
  display:block;
  margin-bottom:2px;
  color:#0f172a;
}
#profile .callout p{
  margin:0;
  color:#475569;
  font-size:13px;
  line-height:1.35;
}

/* Responsive */
@media (max-width: 900px){
  #profile .profile-top{
    grid-template-columns: 64px 1fr;
    grid-template-areas:
      "avatar meta"
      "actions actions";
  }
  #profile .profile-actions{
    text-align:left;
  }
  #profile .profile-grid{
    grid-template-columns:1fr;
  }
}

/* =========================
   PRO UI PACK (safe classes)
========================= */
.pro-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.pro-title{
  margin:0;
  font-size:22px;
  font-weight:950;
  color:#0f172a;
}
.pro-subtitle{
  margin:6px 0 0;
  color: var(--muted);
  font-size:14px;
}

.pro-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--border);
  font-size:13px;
  color:#111827;
  font-weight:850;
  white-space:nowrap;
}

.pro-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:0 12px 26px rgba(16,24,40,.07);
}

.pro-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.pro-card-title{
  margin:0;
  font-size:15px;
  font-weight:950;
  color:#0f172a;
}

.pro-divider{
  height:1px;
  background:#eef2f7;
  border:0;
  margin:14px 0;
}

/* Empty */
.pro-empty{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  border:1px dashed #d1d5db;
  background:#fafafa;
  border-radius:14px;
}
.pro-empty-ico{
  width:38px; height:38px;
  border-radius:12px;
  background:#f3f4f6;
  display:grid;
  place-items:center;
}

/* Table */
.pro-table-wrap{
  overflow: visible;
  border-radius:12px;
  border:1px solid #eef2f7;
}
.pro-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width: 0; /* ✅ updated */
}
.pro-table thead th{
  background:#f9fafb;
  border-bottom:1px solid #eef2f7;
  color:#374151;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:12px;
  white-space:nowrap;
}
.pro-table td{
  padding:12px;
  border-bottom:1px solid #f1f5f9;
  color:#111827;
  font-size:14px;
  white-space:nowrap;
}
.pro-table tbody tr:hover{ background:#fbfdff; }
.td-strong{ font-weight:950; }

/* Pills + badges */
.pro-pill{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  border:1px solid #e0e7ff;
  color:#1e40af;
  font-weight:900;
  font-size:12px;
}
.pro-badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:950;
  font-size:12px;
  border:1px solid transparent;
}
.pro-badge-ok{ background:#dcfce7; border-color:#bbf7d0; color:#166534; }
.pro-badge-bad{ background:#fee2e2; border-color:#fecaca; color:#991b1b; }

.pro-muted{ color: var(--muted); font-size:13px; }

/* List cards (assignments/notices) */
.pro-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.pro-item{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.pro-item-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.pro-item-title{ font-weight:950; color:#0f172a; }
.pro-item-desc{
  margin:8px 0 0;
  color:#374151;
  font-size:14px;
  line-height:1.4;
}

/* Buttons */
.pro-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  font-weight:950;
  text-decoration:none;
  cursor:pointer;
  border:1px solid transparent;
}
.pro-btn-sm{ padding:8px 12px; border-radius:10px; font-size:13px; }
.pro-btn-primary{
  color:#fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow:0 10px 20px rgba(37,99,235,.18);
}
.pro-btn-primary:hover{ opacity:.95; }

/* Break rows for timetable */
.pro-break td{
  background:#f1f5f9;
  font-weight:900;
  color:#0f172a;
}

/* Fees cards */
.fees-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
.fees-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  background:#ffffff;
  box-shadow:0 10px 18px rgba(16,24,40,.05);
}
.fees-card p{
  margin:0 0 8px 0;
  color: var(--muted);
  font-weight:900;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.fees-card strong{
  font-size:20px;
  font-weight:950;
  color:#0f172a;
}
.fees-good{ background:#ecfdf5; border-color:#bbf7d0; }
.fees-warn{ background:#eff6ff; border-color:#bfdbfe; }

@media (max-width: 900px){
  .fees-grid{ grid-template-columns:1fr; }
  .pro-table{ min-width: 0; } /* ✅ updated */
}

/* =========================
   TEACHER PRO UI (namespaced)
========================= */
.tpro-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.tpro-title{
  margin:0;
  font-size:22px;
  font-weight:950;
  color:#0f172a;
}
.tpro-subtitle{
  margin:6px 0 0;
  color: var(--muted);
  font-size:14px;
}
.tpro-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--border);
  font-size:13px;
  color:#111827;
  font-weight:850;
  white-space:nowrap;
}

.tpro-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:0 12px 26px rgba(16,24,40,.07);
}
.tpro-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.tpro-card-title{
  margin:0;
  font-size:15px;
  font-weight:950;
  color:#0f172a;
}

/* Stats */
.tpro-stats{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
  margin: 12px 0 14px;
}
.tpro-stat{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:14px 14px 12px;
  color:#fff;
  box-shadow:0 12px 30px rgba(37,99,235,.18);
  position:relative;
  overflow:hidden;
}
.tpro-stat::after{
  content:"";
  position:absolute;
  right:-48px; top:-48px;
  width:160px; height:160px;
  border-radius:50%;
  background:rgba(255,255,255,.10);
}
.tpro-stat-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  position:relative;
  z-index:1;
}
.tpro-ico{
  width:34px; height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.18);
  font-size:16px;
}
.tpro-label{
  font-size:13px;
  opacity:.95;
  font-weight:900;
}
.tpro-value{
  font-size:28px;
  font-weight:950;
  line-height:1.1;
  position:relative;
  z-index:1;
}
.tpro-foot{
  margin-top:6px;
  font-size:12px;
  opacity:.9;
  position:relative;
  z-index:1;
}

/* Buttons */
.tpro-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  font-weight:950;
  text-decoration:none;
  cursor:pointer;
  border:1px solid #e5e7eb;
  background:#f8fafc;
  color:#0f172a;
}
.tpro-btn:hover{ background:#eef2ff; border-color:#c7d2fe; }
.tpro-btn-primary{
  color:#fff;
  border-color:transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow:0 10px 20px rgba(37,99,235,.18);
}
.tpro-btn-primary:hover{ opacity:.95; }
.tpro-btn-danger{
  color:#fff;
  border-color:transparent;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow:0 10px 20px rgba(239,68,68,.18);
}
.tpro-btn-sm{ padding:8px 12px; border-radius:10px; font-size:13px; }

/* Action rows */
.tpro-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

/* Inputs */
.tpro-form{ display:block; }
.tpro-form-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.tpro-select, .tpro-input{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#fff;
  min-width: 220px;
}
.tpro-hint{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
}

/* Table */
.tpro-table-wrap{
  overflow: visible; /* ✅ updated */
  border-radius:12px;
  border:1px solid #eef2f7;
}
.tpro-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width: 0; /* ✅ updated */
}
.tpro-table thead th{
  background:#f9fafb;
  border-bottom:1px solid #eef2f7;
  color:#374151;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
  padding:12px;
  white-space:nowrap;
}
.tpro-table td{
  padding:12px;
  border-bottom:1px solid #f1f5f9;
  color:#111827;
  font-size:14px;
  white-space:nowrap;
}
.tpro-table tbody tr:hover{ background:#fbfdff; }
.td-strong{ font-weight:950; }

.tpro-center-muted{
  text-align:center;
  color:#777;
  padding:16px;
}

/* Pills + badges */
.tpro-pill{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  border:1px solid #e0e7ff;
  color:#1e40af;
  font-weight:900;
  font-size:12px;
}
.tpro-badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:950;
  font-size:12px;
  border:1px solid transparent;
}
.tpro-badge-ok{ background:#dcfce7; border-color:#bbf7d0; color:#166534; }
.tpro-badge-bad{ background:#fee2e2; border-color:#fecaca; color:#991b1b; }

/* Resource list */
.tpro-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.tpro-item{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.tpro-item-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.tpro-item-title{ font-weight:950; color:#0f172a; }
.tpro-item-desc{
  margin:8px 0 0;
  color:#374151;
  font-size:14px;
  line-height:1.4;
}
.tpro-meta{
  margin:10px 0 0;
  color:#64748b;
  font-size:13px;
}

/* Actions cell buttons in timetable */
.tpro-actions-cell{
  white-space:nowrap;
  display:flex;
  gap:8px;
  align-items:center;
}

/* Filters row */
.tpro-filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* Responsive */
@media (max-width: 1100px){
  .tpro-stats{ grid-template-columns:1fr; }
  .tpro-select, .tpro-input{ min-width: 180px; }
  .tpro-table{ min-width: 0; } /* ✅ updated */
}

/* =========================
   ADMIN PRO UI (namespaced)
   Paste at bottom of CSS
========================= */
.apro-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.apro-title{
  margin:0;
  font-size:22px;
  font-weight:950;
  color:#0f172a;
}
.apro-subtitle{
  margin:6px 0 0;
  color: var(--muted);
  font-size:14px;
}
.apro-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--border);
  font-size:13px;
  color:#111827;
  font-weight:850;
  white-space:nowrap;
}

.apro-card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:0 12px 26px rgba(16,24,40,.07);
}
.apro-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.apro-card-title{
  margin:0;
  font-size:15px;
  font-weight:950;
  color:#0f172a;
}
.apro-section-title{
  margin:0;
  font-size:15px;
  font-weight:950;
  color:#0f172a;
}
.apro-divider{
  height:1px;
  background:#eef2f7;
  border:0;
  margin:14px 0;
}

/* Stats */
.apro-stats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
  margin: 12px 0 14px;
}
.apro-stat{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:14px 14px 12px;
  color:#fff;
  box-shadow:0 12px 30px rgba(37,99,235,.18);
  position:relative;
  overflow:hidden;
}
.apro-stat::after{
  content:"";
  position:absolute;
  right:-48px; top:-48px;
  width:160px; height:160px;
  border-radius:50%;
  background:rgba(255,255,255,.10);
}
.apro-stat-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  position:relative;
  z-index:1;
}
.apro-ico{
  width:34px; height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.18);
  font-size:16px;
}
.apro-label{
  font-size:13px;
  opacity:.95;
  font-weight:900;
}
.apro-value{
  font-size:28px;
  font-weight:950;
  line-height:1.1;
  position:relative;
  z-index:1;
}

/* Toolbar */
.apro-toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.apro-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Inputs */
.apro-input, .apro-select{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#fff;
}

/* Buttons */
.apro-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  font-weight:950;
  text-decoration:none;
  cursor:pointer;
  border:1px solid #e5e7eb;
  background:#f8fafc;
  color:#0f172a;
}
.apro-btn:hover{ background:#eef2ff; border-color:#c7d2fe; }
.apro-btn-primary{
  color:#fff;
  border-color:transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow:0 10px 20px rgba(37,99,235,.18);
}
.apro-btn-primary:hover{ opacity:.95; }
.apro-btn-danger{
  color:#fff;
  border-color:transparent;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow:0 10px 20px rgba(239,68,68,.18);
}
.apro-btn-sm{ padding:8px 12px; border-radius:10px; font-size:13px; }

/* Table wrapper: works with your existing data-table/admin-table */
.apro-table-wrap{
  width:100%;
  overflow: visible; /* ✅ updated */
  border-radius:12px;
  border:1px solid #eef2f7;
  margin-top:10px;
}

/* Helpers */
.td-strong{ font-weight:950; }
.apro-center-muted{
  text-align:center;
  color:#777;
  padding:16px;
}

/* Pills + badges */
.apro-pill{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  border:1px solid #e0e7ff;
  color:#1e40af;
  font-weight:900;
  font-size:12px;
}
.apro-badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:950;
  font-size:12px;
  border:1px solid transparent;
}
.apro-badge-ok{ background:#dcfce7; border-color:#bbf7d0; color:#166534; }
.apro-badge-bad{ background:#fee2e2; border-color:#fecaca; color:#991b1b; }

/* Activity list */
.apro-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.apro-item{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.apro-item-desc{
  margin:0;
  color:#111827;
  font-size:14px;
  line-height:1.4;
}
.apro-meta{
  color:#64748b;
  font-size:12px;
}

/* Responsive */
@media (max-width: 1100px){
  .apro-stats{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .apro-stats{ grid-template-columns:1fr; }
  .apro-head{ flex-direction:column; align-items:flex-start; }
}

/* =========================
   ADMIN PRO: FINANCE + SYSTEM ADD-ON
   Paste at bottom
========================= */

/* Finance tabs container style */
#finance .finance-tab{ display:none; margin-top:0; }
#finance .finance-tab.active{ display:block; }

/* Nice finance tab buttons */
.apro-fin-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.apro-fin-tabbtn{
  border:1px solid #e5e7eb;
  background:#f8fafc;
  color:#0f172a;
  padding:10px 12px;
  border-radius:12px;
  font-weight:950;
  cursor:pointer;
  white-space:nowrap;
}
.apro-fin-tabbtn:hover{
  background:#eef2ff;
  border-color:#c7d2fe;
}
.apro-fin-tabbtn.is-active{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  border-color: transparent;
  box-shadow:0 10px 20px rgba(37,99,235,.18);
}

/* Finance forms: responsive grid */
.apro-form-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  align-items:center;
  margin-top:10px;
}
.apro-form-grid input,
.apro-form-grid select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#fff;
}
.apro-form-grid button{
  width:100%;
}

/* 3 stats variant used in finance dashboard */
.apro-stats-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Outline button variant */
.apro-btn-outline{
  background:#ffffff;
  border:1px dashed #cbd5e1;
}
.apro-btn-outline:hover{
  background:#f8fafc;
  border-color:#94a3b8;
}

/* Neutral badge for “PENDING/PAID/…” without relying on old badge classes */
.apro-badge-neutral{
  background:#f1f5f9;
  border-color:#e2e8f0;
  color:#334155;
}

/* System layout grid */
.apro-grid-2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
}

/* Panels for dynamic content */
.apro-panel{
  padding:12px 14px;
  background:#f8fafc;
  border:1px solid #eef2f7;
  border-radius:14px;
  line-height:1.7;
  min-height:80px;
}

/* Small helper text */
.apro-hint{
  color:#64748b;
  font-size:12px;
}

/* Responsive tweaks */
@media (max-width: 1100px){
  .apro-form-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apro-stats-3{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .apro-form-grid{ grid-template-columns: 1fr; }
  .apro-stats-3{ grid-template-columns: 1fr; }
  .apro-grid-2{ grid-template-columns: 1fr; }
}

/* ==========================================================
   ✅ FINAL OVERRIDES: REMOVE TABLE SCROLL & FIT SMALL SCREEN
   (keeps everything else untouched)
========================================================== */

/* Disable any overflow scroll wrappers used earlier */
.table-wrap,
.pro-table-wrap,
.tpro-table-wrap,
.table-wrapper,
.table-scroll,
.apro-table-wrap {
  overflow: visible !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Tables should fit screen & wrap */
table,
.table,
.data-table,
.admin-table,
.pro-table,
.tpro-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
}

.table th, .table td,
.data-table th, .data-table td,
.admin-table th, .admin-table td,
.pro-table th, .pro-table td,
.tpro-table th, .tpro-table td {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
}

/* Mobile: convert tables into stacked cards (no scroll) */
@media (max-width: 768px) {

  .data-table thead,
  .admin-table thead,
  .pro-table thead,
  .tpro-table thead,
  table.table thead {
    display: none !important;
  }

  .data-table tbody tr,
  .admin-table tbody tr,
  .pro-table tbody tr,
  .tpro-table tbody tr,
  table.table tbody tr {
    display: block !important;
    margin: 0 0 12px 0 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  }

  .data-table tbody td,
  .admin-table tbody td,
  .pro-table tbody td,
  .tpro-table tbody td,
  table.table tbody td {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
  }

  .data-table tbody td:last-child,
  .admin-table tbody td:last-child,
  .pro-table tbody td:last-child,
  .tpro-table tbody td:last-child,
  table.table tbody td:last-child {
    border-bottom: none !important;
  }

  .data-table tbody td::before,
  .admin-table tbody td::before,
  .pro-table tbody td::before,
  .tpro-table tbody td::before,
  table.table tbody td::before {
    content: attr(data-label);
    font-weight: 900;
    color: #64748b;
    flex: 0 0 44%;
    max-width: 44%;
  }

  .data-table tbody td:empty::after,
  .admin-table tbody td:empty::after,
  .pro-table tbody td:empty::after,
  .tpro-table tbody td:empty::after,
  table.table tbody td:empty::after {
    content: "—";
    color: #94a3b8;
    font-weight: 800;
  }

  .data-table tbody td,
  .admin-table tbody td,
  .pro-table tbody td,
  .tpro-table tbody td,
  table.table tbody td {
    font-size: 13px !important;
  }
}
