/* TrueInvoice design system — extends Bootstrap 5 */

/* ── Variables ────────────────────────────────── */
:root {
  --nb-primary:      #2563EB;
  --nb-surface:      #FFFFFF;
  --nb-bg:           #F8FAFC;
  --nb-border:       #E2E8F0;
  --nb-text-dark:    #0F172A;
  --nb-text-body:    #475569;
  --nb-text-muted:   #94A3B8;
  --nb-success:      #16A34A;
  --nb-warning:      #D97706;
  --nb-danger:       #DC2626;
}

/* ── Base ─────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  background: var(--nb-bg);
  color: var(--nb-text-dark);
  font-size: 14px;
}

h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  min-height: calc(100vh - 56px);
  background: var(--nb-surface);
  border-right: 1px solid var(--nb-border);
}

.sidebar .nav-link {
  color: var(--nb-text-body);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
}

.sidebar .nav-link i { width: 20px; }

.sidebar .nav-link:hover {
  background: #EFF6FF;
  color: var(--nb-primary);
}

.sidebar .nav-link.active {
  background: var(--nb-primary);
  color: #fff;
  font-weight: 500;
}

.sidebar-divider {
  border-color: var(--nb-border);
  margin: 0.5rem 0;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nb-text-muted);
  padding: 0.25rem 0.75rem 0.25rem;
}

/* ── Card ─────────────────────────────────────── */
.card {
  background: var(--nb-surface);
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ── Table ────────────────────────────────────── */
.table-trueinvoice thead th {
  background: var(--nb-bg);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--nb-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--nb-border);
}

.table-trueinvoice tbody tr:hover {
  background: var(--nb-bg);
}

.table-trueinvoice tbody td {
  border-bottom: 1px solid var(--nb-border);
  padding: 12px 16px;
  vertical-align: middle;
}

/* ── Buttons ──────────────────────────────────── */
.btn.btn-primary {
  background: var(--nb-primary);
  border-color: var(--nb-primary);
  color: #fff;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.btn.btn-secondary {
  background: var(--nb-surface);
  border: 1px solid var(--nb-border);
  color: var(--nb-text-body);
}

.btn.btn-secondary:hover,
.btn.btn-secondary:focus {
  background: var(--nb-bg);
  color: var(--nb-text-dark);
  border-color: var(--nb-border);
}

.btn.btn-danger {
  background: #FEE2E2;
  color: var(--nb-danger);
  border: none;
}

.btn.btn-danger:hover,
.btn.btn-danger:focus {
  background: #fecaca;
  color: var(--nb-danger);
  border: 1px solid #fca5a5;
}

/* ── Status badges ────────────────────────────── */
.badge { border-radius: 4px; font-size: .75rem; font-weight: 500; }

.badge-paid          { background: #DCFCE7; color: #16A34A; }
.badge-sent          { background: #DBEAFE; color: #2563EB; }
.badge-draft         { background: #F1F5F9; color: #475569; }
.badge-overdue       { background: #FEE2E2; color: #DC2626; }
.badge-partially_paid{ background: #FEF3C7; color: #D97706; }
.badge-converted     { background: #F3E8FF; color: #7C3AED; }
.badge-expired       { background: #F1F5F9; color: #94A3B8; }
.badge-pending       { background: #FEF3C7; color: #D97706; }
.badge-accepted      { background: #DCFCE7; color: #16A34A; }
.badge-rejected      { background: #FEE2E2; color: #DC2626; }

/* ── Utilities ────────────────────────────────── */
.amount {
  font-variant-numeric: tabular-nums;
  font-family: 'Inter', sans-serif;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--nb-text-muted);
}

#toastContainer { z-index: 9999; max-width: 340px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.navbar-brand { font-weight: 700; letter-spacing: -0.5px; }

/* ── Auth split-panel ─────────────────────────────── */
.auth-split {
  min-height: 100vh;
  display: flex;
}
.auth-brand-panel {
  width: 40%;
  background: linear-gradient(135deg, #1e3a8a, #2563EB);
  color: #fff;
  padding: 48px 40px;
  flex-direction: column;
  justify-content: center;
}
.auth-brand-strip {
  background: linear-gradient(135deg, #1e3a8a, #2563EB);
  color: #fff;
  padding: 16px 20px;
  align-items: center;
  gap: 10px;
}
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--nb-bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
@media (max-width: 767px) {
  .auth-split { flex-direction: column; }
  .auth-form-panel { padding: 24px 16px; align-items: flex-start; }
  .auth-card { max-width: 100%; }
}

/* ── Mobile bottom nav ────────────────────────────── */
.nb-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--nb-surface);
  border-top: 1px solid var(--nb-border);
  display: flex;
  height: 60px;
}
.nb-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--nb-text-muted);
  text-decoration: none;
  gap: 2px;
}
.nb-bottom-nav-item i { font-size: 18px; }
.nb-bottom-nav-item.active { color: var(--nb-primary); }
@media (max-width: 767px) {
  .pb-mobile-nav { padding-bottom: 72px; }
}

/* ── Mobile list cards ────────────────────────────── */
.nb-list-card {
  background: var(--nb-surface);
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: var(--nb-text-dark);
  transition: box-shadow 0.15s;
}
.nb-list-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  color: var(--nb-text-dark);
}

/* ── Responsive overrides ─────────────────────────── */
.page-header { flex-wrap: wrap; gap: 8px; }
.nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-tabs .nav-link { white-space: nowrap; }
@media (max-width: 767px) {
  main.col-md-10 { padding-left: 12px !important; padding-right: 12px !important; }
}
