:root {
  --brand-primary: #1d4ed8;
  --brand-secondary: #0f172a;
  --brand-surface: #f8fafc;
  --brand-border: #e2e8f0;
}

html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 35%, #ffffff 100%);
  color: #0f172a;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(37, 99, 235, .25);
}

.topbar {
  background: linear-gradient(90deg, var(--brand-secondary), var(--brand-primary));
}

.module-subnav-wrap {
  background: rgba(15, 23, 42, 0.16);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.module-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .75rem 0;
}

.module-subnav a {
  text-decoration: none;
  color: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  border-radius: 999px;
  padding: .5rem .95rem;
  font-size: .95rem;
}

.module-subnav a.active,
.module-subnav a:hover {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.navbar-brand {
  letter-spacing: .02em;
}

.app-shell .nav-link.active {
  color: #fff !important;
  font-weight: 600;
}

.metric-card {
  border-radius: 1.25rem;
  padding: 1.5rem;
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  min-height: 156px;
}

.metric-sales { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.metric-deposits { background: linear-gradient(135deg, #0891b2, #0e7490); }
.metric-accounts { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.metric-inventory { background: linear-gradient(135deg, #ea580c, #c2410c); }

.metric-label {
  font-size: .9rem;
  opacity: .9;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.metric-value {
  font-size: clamp(1.8rem, 2vw, 2.7rem);
  font-weight: 700;
  margin-top: .4rem;
}

.metric-subtitle {
  margin-top: .5rem;
  opacity: .85;
}

.module-menu-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 1.5rem;
  color: #fff;
  min-height: 290px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.module-admin { background: linear-gradient(135deg, #0f172a, #334155); }
.module-pos { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.module-reports { background: linear-gradient(135deg, #065f46, #059669); }
.module-students { background: linear-gradient(135deg, #7c3aed, #9333ea); }

.module-menu-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.module-menu-header h2 {
  margin: .5rem 0 0;
  font-size: 1.5rem;
}

.module-menu-icon {
  font-size: 2rem;
}

.module-menu-badge {
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .8rem;
  background: rgba(255, 255, 255, .08);
}

.module-menu-links {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  flex: 1;
}

.module-menu-links a {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 1rem;
  padding: .85rem 1rem;
  background: rgba(255, 255, 255, .08);
}

.module-menu-links a:hover {
  background: rgba(255, 255, 255, .16);
}

.summary-stack {
  display: grid;
  gap: .85rem;
}

.summary-chip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .95rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--brand-border);
}

.summary-chip span {
  color: #475569;
}

.summary-chip strong {
  font-size: 1.05rem;
}

.module-header {
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem 1.25rem;
}

.module-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.module-link-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.module-link-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 22px rgba(30, 64, 175, 0.08);
}

.module-link-card span {
  color: #64748b;
}

/* Improve readability for table badges when theme/background makes white text low-contrast. */
.table .badge {
  color: #111827 !important;
}

.pos-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1rem;
}

.pos-ticket-panel {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  padding: .85rem;
}

.pos-ticket-panel .form-label {
  color: #334155;
}

.pos-main-panel {
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  padding: 1rem;
}

.pos-top-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
}

.pos-ticket-table-wrap {
  min-height: 360px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: .8rem;
}

.pos-total-box {
  border: 1px solid #cbd5e1;
  border-radius: .9rem;
  background: #f8fafc;
  padding: .75rem;
}

.pos-total-box > div {
  display: flex;
  justify-content: space-between;
  margin: .25rem 0;
}

.pos-student-card {
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  border-radius: 1rem;
  padding: .85rem;
}

.pos-student-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.pos-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: .75rem;
}

.pos-categories {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.pos-category-btn {
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.pos-category-btn.active {
  background: #1d4ed8;
  color: #fff;
}

.pos-product-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .8rem;
}

.pos-product-grid.active {
  display: grid;
}

.pos-product-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
  min-height: 88px;
  border-radius: .9rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.pos-product-btn small {
  color: #64748b;
}

.pos-product-btn:hover {
  border-color: #60a5fa;
}

@media (max-width: 1200px) {
  .pos-shell {
    grid-template-columns: 1fr;
  }
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--brand-border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.quick-action-icon {
  font-size: 1.5rem;
}

.glass-card,
.card {
  border-radius: 1.25rem;
}

.student-photo-preview {
  width: 148px;
  height: 148px;
  border-radius: 1.25rem;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
}

.table-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.avatar-lg {
  width: 74px;
  height: 74px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: .9rem;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
  margin-top: .3rem;
}

.report-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.report-shortcuts a {
  text-decoration: none;
  color: var(--brand-primary);
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: .65rem 1rem;
}

.menu-section {
  margin-bottom: .9rem;
}

.menu-section span {
  display: block;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: .2rem;
}

.menu-section p {
  margin-bottom: 0;
}

.min-vh-75 {
  min-height: 75vh;
}

.footer-app {
  border-top: 1px solid rgba(148, 163, 184, .25);
}