@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f0f2f8;
  color: #4b5563;
  font-size: 0.845rem;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.app-wrapper { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════
   SIDEBAR — WHITE LIGHT THEME
═══════════════════════════════════════ */
.nxl-navigation {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  z-index: 1026;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
}

.m-header {
  height: 80px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  overflow: hidden;
  text-decoration: none;
}

.brand-logo {
  font-size: 17px;
  font-weight: 700;
  color: #283c50;
  white-space: nowrap;
  text-decoration: none;
}

.navbar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.nxl-caption {
  display: block;
  color: #7587a7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 14px 22px 6px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.nxl-navbar { list-style: none; padding: 0; margin: 0; }
.nxl-item { list-style: none; }

.nxl-link {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  margin: 2px 10px;
  font-size: 13px;
  color: #283c50;
  font-weight: 600;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}
.nxl-link:hover { background: #eaebef; color: #001327; text-decoration: none; }
.nxl-item.active > .nxl-link { background: #eaebef; color: #001327; }

.nxl-micon {
  width: 20px;
  min-width: 20px;
  text-align: center;
  margin-right: 12px;
  font-size: 15px;
  color: inherit;
  flex-shrink: 0;
}

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

/* Minimenu — collapsed sidebar shows only icons */
html.minimenu .nxl-navigation { width: 80px; }
html.minimenu .nxl-navigation .nav-link-text { display: none; }
html.minimenu .nxl-navigation .nxl-micon { margin-right: 0; }
html.minimenu .nxl-navigation .nxl-link { justify-content: center; padding: 9px; margin: 2px 8px; }
html.minimenu .nxl-navigation .m-header { justify-content: center; padding: 15px 10px; }
html.minimenu .nxl-navigation .brand-logo-text { display: none; }
html.minimenu .nxl-navigation .nxl-caption { opacity: 0; }
html.minimenu .nxl-header { left: 80px; }
html.minimenu .nxl-container { margin-left: 80px; width: calc(100vw - 80px); }

/* ═══════════════════════════════════════
   HEADER — TOP BAR
═══════════════════════════════════════ */
.nxl-header {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  height: 80px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 1025;
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 16px;
  transition: left 0.3s ease;
}

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 5px;
  color: #283c50;
  font-size: 18px;
  display: flex;
  align-items: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: #eaebef; }

/* ═══════════════════════════════════════
   PAGE HEADER (breadcrumb bar)
═══════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left { display: flex; flex-direction: column; gap: 4px; }

.page-header-title {
  font-size: 16px;
  font-weight: 700;
  color: #283c50;
  margin: 0;
}

.breadcrumb {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
  font-size: 12px;
  color: #7587a7;
  align-items: center;
}
.breadcrumb-item a { color: #7587a7; text-decoration: none; }
.breadcrumb-item a:hover { color: #3454d1; }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; color: #d1d5db; }
.breadcrumb-item:last-child { color: #283c50; }

.page-header-right { display: flex; align-items: center; gap: 8px; }

/* ═══════════════════════════════════════
   MAIN CONTAINER
═══════════════════════════════════════ */
.nxl-container {
  margin-left: 280px;
  width: calc(100vw - 280px);
  padding-top: 80px;
  min-height: 100vh;
  background: #f0f2f8;
  transition: margin-left 0.3s ease, width 0.3s ease;
}

.main-content { padding: 0 25px 25px; }

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
  border-radius: 10px 10px 0 0;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #283c50;
  margin: 0;
}
.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: transparent;
  border-radius: 0 0 10px 10px;
}

/* form-section = card style */
.form-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  margin-bottom: 24px;
  overflow: hidden;
}
.form-section h2 {
  font-size: 14px;
  font-weight: 700;
  color: #283c50;
  padding: 16px 22px;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
  background: transparent;
}
/* All direct children except h2 get side padding */
.form-section > *:not(h2) { padding-left: 22px; padding-right: 22px; }
.form-section > p         { padding-top: 14px; }
.form-section > .form-row { padding-top: 12px; padding-bottom: 4px; }
/* Forms inside form-section get full padding so their contents are inset */
.form-section > form      { padding: 16px 22px 22px; }
.form-section > form .form-row      { margin-bottom: 16px; }
.form-section > form .form-group    { display: flex; flex-direction: column; gap: 6px; }
.form-section > form .form-group label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.form-section > form .form-group input,
.form-section > form .form-group select { padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 7px; font-size: 13px; width: 100%; font-family: inherit; color: #283c50; background: #fff; }
.form-section > form .form-group input:focus,
.form-section > form .form-group select:focus { outline: none; border-color: #3454d1; box-shadow: 0 0 0 3px rgb(52 84 209 / .1); }
.form-section > form > .btn,
.form-section > form > div:last-child { margin-top: 6px; }
/* Last div/child spacing at bottom */
.form-section > div:last-child { padding-bottom: 20px; }

/* ═══════════════════════════════════════
   HEADINGS
═══════════════════════════════════════ */
h1 { font-size: 22px; font-weight: 700; color: #283c50; margin-bottom: 20px; }
h2 { font-size: 15px; font-weight: 700; color: #283c50; margin: 22px 0 12px; }
h3 { font-size: 13px; font-weight: 600; color: #283c50; margin-bottom: 8px; }

/* ═══════════════════════════════════════
   TABLES
═══════════════════════════════════════ */
.table-wrap, .table-responsive { overflow-x: auto; }

table, .data-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

table thead th, .data-table thead th {
  padding: 10px 14px;
  color: #283c50;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  background: #ffffff;
}
table thead th:first-child, .data-table thead th:first-child { padding-left: 22px; }
table thead th:last-child, .data-table thead th:last-child { padding-right: 22px; }

table tbody td, .data-table tbody td {
  padding: 13px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.845rem;
  color: #4b5563;
}
table tbody td:first-child, .data-table tbody td:first-child { padding-left: 22px; }
table tbody td:last-child, .data-table tbody td:last-child { padding-right: 22px; }
table tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover, .data-table tbody tr:hover { background: #f9fafb; }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 5px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: #3454d1; color: #fff; border-color: #3454d1; }
.btn-primary:hover { background: #2a43a8; border-color: #2a43a8; color: #fff; }
.btn-secondary { background: #fff; color: #283c50; border-color: #e5e7eb; }
.btn-secondary:hover { background: #f5f6fa; border-color: #d1d5db; }
.btn-success { background: #25b865; color: #fff; border-color: #25b865; }
.btn-danger { background: #ea4d4d; color: #fff; border-color: #ea4d4d; }
.btn-warning { background: #e49e3d; color: #fff; border-color: #e49e3d; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ═══════════════════════════════════════
   FORMS
═══════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: #283c50;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.form-row .form-group { flex: 1; min-width: 160px; }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  color: #283c50;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 5px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #3454d1;
  box-shadow: 0 0 0 3px rgba(52,84,209,0.08);
}

/* ═══════════════════════════════════════
   ALERTS
═══════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}
.alert-warn  { background: #fff8eb; border-left: 4px solid #e49e3d; color: #7c5e1e; }
.alert-error { background: #fff1f1; border-left: 4px solid #ea4d4d; color: #8b2020; }
.alert-ok    { background: #f0fff7; border-left: 4px solid #25b865; color: #145a30; }
.alert-info  { background: #eff6ff; border-left: 4px solid #3454d1; color: #1e3a8a; }

/* ═══════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════ */
.cards, .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

/* Every card inside a .cards grid gets internal padding + proper label styling
   Works for static HTML and JS-generated cards alike */
.cards .card {
  padding: 20px 22px;
}
.cards .card h3 {
  font-size: 11px;
  font-weight: 700;
  color: #7587a7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
}
.stat-value, .stat { font-size: 26px; font-weight: 700; color: #283c50; line-height: 1.2; }
.stat.warning { color: #e49e3d; }
.stat-label { font-size: 12px; color: #7587a7; margin-top: 5px; font-weight: 500; }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 30px;
}
.badge-success { background: rgba(37,184,101,0.1); color: #1a8a4a; }
.badge-warning { background: rgba(228,158,61,0.1);  color: #9a6a1a; }
.badge-danger  { background: rgba(234,77,77,0.1);   color: #b02020; }
.badge-info    { background: rgba(52,84,209,0.1);   color: #2a43a8; }
.badge-gray    { background: #eff0f6; color: #7587a7; }

/* ═══════════════════════════════════════
   TABS
═══════════════════════════════════════ */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 22px;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #7587a7;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.tab-btn:hover { color: #283c50; }
.tab-btn.active { color: #3454d1; border-bottom-color: #3454d1; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ═══════════════════════════════════════
   UTILITIES
═══════════════════════════════════════ */
.muted { color: #7587a7; font-size: 12px; }
.loading { color: #7587a7; font-style: italic; font-size: 13px; padding: 10px 0; }
.text-success { color: #25b865 !important; }
.text-danger  { color: #ea4d4d !important; }
.text-warning { color: #e49e3d !important; }
.text-primary { color: #3454d1 !important; }
.text-muted   { color: #7587a7 !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.flex { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 18px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 18px; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .nxl-navigation { transform: translateX(-100%); transition: transform 0.3s ease, width 0.3s ease; }
  .nxl-navigation.mob-open { transform: translateX(0); }
  .nxl-header { left: 0; }
  .nxl-container { margin-left: 0; width: 100vw; }
}
@media (max-width: 680px) {
  .form-row { flex-direction: column; }
  .main-content { padding: 0 14px 14px; }
}
