﻿/* ============================================================
   GST BILLING — Global Design System
   Font: Inter (body) + Outfit (headings) via Google Fonts
   ============================================================ */

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

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:        #1e3c72;
  --primary-light:  #2a5298;
  --primary-glow:   rgba(30, 60, 114, 0.18);
  --accent:         #4f8ef7;
  --success:        #22c55e;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --bg:             #f0f4ff;
  --surface:        #ffffff;
  --surface-2:      #f8faff;
  --border:         #e2e8f8;
  --text:           #1a233a;
  --text-muted:     #6b7a99;
  --sidebar-w:      260px;
  --radius:         14px;
  --radius-sm:      8px;
  --shadow:         0 4px 24px rgba(30,60,114,0.10);
  --shadow-hover:   0 8px 32px rgba(30,60,114,0.18);
  --transition:     all 0.22s cubic-bezier(.4,0,.2,1);

  /* Form control theme variables */
  --input-bg:          #ffffff;
  --input-border:      #e2e8f0;
  --input-text:        #0f172a;
  --input-placeholder: #94a3b8;
  --input-focus-border: #1e3c72;
  --input-hover-bg:    #f8fafc;
  --dropdown-bg:       #ffffff;
  --dropdown-hover:    #f1f5f9;
  --input-icon:        #64748b;
}

/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text);
}

a { text-decoration: none; color: inherit; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar-wrap {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(170deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(30,60,114,0.18);
  transition: var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-brand-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}

.sidebar-brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 17px; font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand-text small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px; font-weight: 400;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.45);
  padding: 16px 10px 6px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.80);
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,0.16);
  color: #fff;
  transform: translateX(3px);
}

.sidebar-link .material-icons {
  font-size: 20px;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar-user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
}

.sidebar-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700; font-size: 14px; color: #fff;
}

.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: #fff;
}
.sidebar-user-role {
  font-size: 11px; color: rgba(255,255,255,0.55);
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  z-index: 900;
  box-shadow: 0 2px 12px rgba(30,60,114,0.06);
}

.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex; align-items: center; gap: 12px;
}

.topbar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.topbar-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  color: #fff;
}

/* ── Main Content Area ───────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: 62px;
  padding: 32px 36px;
  min-height: calc(100vh - 62px);
}

/* ── Cards ───────────────────────────────────────────────── */
.g-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.g-card:hover { box-shadow: var(--shadow-hover); }

.g-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.g-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

.g-card-title .material-icons { color: var(--primary); font-size: 20px; }

.g-card-body { padding: 24px; }

/* ── Stat Cards (dashboard) ──────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.purple { background: #faf5ff; color: #9333ea; }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px; font-weight: 700; color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  margin-top: 4px;
}

/* ── Tables ──────────────────────────────────────────────── */
.g-table-wrap {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}

.g-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.g-table thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.g-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.g-table tbody tr:last-child { border-bottom: none; }

.g-table tbody tr:hover { background: #f5f8ff; }

.g-table tbody td {
  padding: 13px 16px;
  color: var(--text);
  vertical-align: middle;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary-g {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 10px var(--primary-glow);
  white-space: nowrap;
}

.btn-primary-g:hover {
  opacity: 0.88; transform: translateY(-1px);
  box-shadow: var(--shadow-hover); color: #fff;
}

.btn-danger-g {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: #fef2f2; color: var(--danger); border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}

.btn-danger-g:hover { background: var(--danger); color: #fff; }

.btn-outline-g {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}

.btn-outline-g:hover { background: var(--primary); color: #fff; }

/* ── Badges ──────────────────────────────────────────────── */
.badge-g {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

.badge-g.success { background: #dcfce7; color: #16a34a; }
.badge-g.danger  { background: #fee2e2; color: #dc2626; }
.badge-g.primary { background: #eff6ff; color: #2563eb; }

/* ── Forms ───────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 820px;
  margin: 0 auto;
}

.form-card-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 24px 28px;
  color: #fff;
}

.form-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px; font-weight: 700;
}

.form-card-subtitle { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: 3px; }

.form-card-body { padding: 28px; }

.form-group-g {
  margin-bottom: 20px;
}

.form-label-g {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 7px;
}

.form-control-g,
.form-group-g input:not([type="checkbox"]):not([type="radio"]),
.form-group-g select,
.form-group-g textarea,
input.form-control:not([type="checkbox"]):not([type="radio"]),
select.form-control,
textarea.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px; color: var(--input-text);
  background: var(--input-bg);
  transition: var(--transition);
  outline: none;
  margin: 0;
}

.form-control-g:hover,
.form-group-g input:not([type="checkbox"]):not([type="radio"]):hover,
.form-group-g select:hover,
.form-group-g textarea:hover,
input.form-control:not([type="checkbox"]):not([type="radio"]):hover,
select.form-control:hover,
textarea.form-control:hover {
  background: var(--input-hover-bg);
}

.form-control-g:focus,
.form-group-g input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group-g select:focus,
.form-group-g textarea:focus,
input.form-control:not([type="checkbox"]):not([type="radio"]):focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row-g {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Auth Pages (Login / Register) ───────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2057 0%, #1e3c72 50%, #2a5298 100%);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%; max-width: 440px;
  overflow: hidden;
}

.auth-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 36px 36px 28px;
  text-align: center;
  color: #fff;
}

.auth-logo {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.18);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 700;
}

.auth-subtitle {
  font-size: 13px; color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

.auth-body { padding: 32px; }

.auth-field { margin-bottom: 18px; }

.auth-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 7px;
}

.auth-input {
  width: 100%;
  padding: 11px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px; color: var(--text);
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.12);
}

.auth-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  margin-top: 6px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.auth-submit:hover { opacity: 0.88; transform: translateY(-1px); }

.auth-footer-text {
  text-align: center;
  margin-top: 20px;
  font-size: 13px; color: var(--text-muted);
}

.auth-footer-text a { color: var(--primary); font-weight: 600; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert-g {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}

.alert-g.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-g.danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── Modal Overrides ─────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}

.modal-title { font-family: 'Outfit', sans-serif; font-weight: 700; }

.modal-body { padding: 20px 24px; color: var(--text); font-size: 14px; }

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  gap: 10px;
}

/* ── Invoice form specific ───────────────────────────────── */
#invoice-form input { font-size: 0.88em; color: var(--text); }
#invoice-form-items-table { font-size: 0.82em; }

input.form-control[type=number] {
  -moz-appearance: none;
  -webkit-appearance: textfield;
}

.table-bordered td.form-input-td { padding: 0; vertical-align: middle; }
.table-bordered td, .table-bordered th { padding: 0.3em; }

.table-bordered tbody td, .table-bordered tbody th,
.table-bordered thead th, .table-bordered thead td {
  background: #f9faff;
}

#customer_search_bar, #product_search_bar {
  display: none;
  background: var(--surface);
  width: 20em; height: 100%;
  position: absolute; right: 0; top: 0;
  box-shadow: 0 0 20px rgba(30,60,114,0.15);
  padding: 0.4em;
  border-radius: var(--radius-sm);
}

.customer-search-result, .product-search-result {
  padding: 0.4em;
  margin: 0.3em;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}

.customer-search-result:hover, .product-search-result:hover {
  background: var(--bg);
}

[readonly] { caret-color: transparent; transition: none; border: none; }
[readonly]:focus { caret-color: transparent; box-shadow: none; border: none; }

.table-invoice td, .table-invoice th { border: solid var(--border) 1px; padding: .25rem; }
#table-invoice-total-row { border-top: 2px solid #939393; background: white; }
#invoice-grand-total-table td { font-weight: bold; padding: .25rem; }
#invoice-signature-row { border-bottom: 2px solid; height: 4em; }

/* ── Inventory / Book tables ─────────────────────────────── */
#inventory-table tr:hover, #book-table tr:hover { cursor: pointer; }
#invoice_profile_data { white-space: pre-line; }

/* ── Print ───────────────────────────────────────────────── */
@page { size: auto; margin: 5mm; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar-wrap { transform: translateX(-100%); }
  .sidebar-wrap.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 80px 16px 24px; }
  .topbar { left: 0; }
  .form-row-g { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Status Badges (company/subscription status) ─────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-approved, .badge-active { background: #dcfce7; color: #16a34a; }
.badge-pending   { background: #fef9c3; color: #b45309; }
.badge-rejected, .badge-suspended { background: #fee2e2; color: #dc2626; }
.badge-expired, .badge-cancelled  { background: #f1f5f9; color: #64748b; }

/* ── Sidebar active state override to use primary colour ─── */
.sidebar-link.active {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

/* ══════════════════════════════════════════════════════════
   PREMIUM VISUAL ENHANCEMENTS v2.0
   ══════════════════════════════════════════════════════════ */

/* ── Enhanced Topbar ─────────────────────────────────────── */
.topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 1px 20px rgba(30,60,114,0.07) !important;
}
.topbar-title {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 19px !important;
  font-weight: 800 !important;
}

/* ── Page Hero Header ────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, #0f2057 0%, #1e3c72 60%, #2a5298 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; top: -50px; right: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.page-hero::after {
  content: '';
  position: absolute; bottom: -70px; left: -30px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.page-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem; font-weight: 800;
  position: relative; z-index: 1;
  margin: 0 0 4px;
}
.page-hero-sub {
  font-size: 13px; color: rgba(255,255,255,0.72);
  position: relative; z-index: 1;
}
.page-hero-actions { position: relative; z-index: 1; margin-top: 1rem; }

/* ── Premium Stat Cards ──────────────────────────────────── */
.stat-card {
  position: relative; overflow: hidden;
  border: none !important;
  background: var(--surface) !important;
  box-shadow: 0 2px 16px rgba(30,60,114,0.08) !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.blue::before   { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.green::before  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card.red::before    { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 36px rgba(30,60,114,0.15) !important;
}

/* ── Enhanced Cards ──────────────────────────────────────── */
.g-card {
  box-shadow: 0 2px 16px rgba(30,60,114,0.07) !important;
  border: 1px solid var(--border) !important;
  transition: box-shadow 0.2s !important;
}
.g-card:hover { box-shadow: 0 8px 32px rgba(30,60,114,0.12) !important; }

.g-card-header {
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* ── Enhanced Table ──────────────────────────────────────── */
.g-table thead th {
  background: linear-gradient(135deg, #f0f4ff, #e8efff) !important;
  color: var(--primary) !important;
  font-size: 11.5px !important;
  letter-spacing: 0.7px !important;
}
.g-table tbody tr:hover {
  background: linear-gradient(135deg, #f5f8ff, #eef3ff) !important;
}
.g-table tbody tr { transition: background 0.15s !important; }

/* ── Enhanced Form Inputs ────────────────────────────────── */
.form-control,
input.form-control:not([type="checkbox"]):not([type="radio"]),
select.form-control,
textarea.form-control,
.form-group-g input:not([type="checkbox"]):not([type="radio"]),
.form-group-g select,
.form-group-g textarea {
  border: 1.5px solid #d8e2f8 !important;
  border-radius: 9px !important;
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  background: #fafbff !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  color: var(--text) !important;
  height: auto !important;
}
.form-control:focus,
input.form-control:not([type="checkbox"]):not([type="radio"]):focus,
select.form-control:focus,
textarea.form-control:focus,
.form-group-g input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group-g select:focus,
.form-group-g textarea:focus {
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(42,82,152,0.10) !important;
  background: #fff !important;
  outline: none !important;
}

/* ── Fix select: restore native arrow + stop text clipping ── */
select.form-control,
.form-group-g select,
.inv-field-group select,
select[class*="form-control"] {
  /* Restore the browser's native ▾ arrow that Bootstrap 4 hides */
  -webkit-appearance: menulist   !important;
  -moz-appearance:    menulist   !important;
  appearance:         auto       !important;
  /* Remove Bootstrap's custom SVG arrow background */
  background-image:   none       !important;
  background-repeat:  no-repeat  !important;
  /* Extra padding on the right so selected text doesn't slide under the arrow */
  padding-right: 32px            !important;
  /* Prevent long option text from breaking layout */
  text-overflow: ellipsis;
  overflow:      hidden;
  white-space:   nowrap;
  cursor:        pointer;
}

/* ── Invoice Section Cards (premium) ────────────────────── */
.invoice-section-card {
  box-shadow: 0 2px 14px rgba(30,60,114,0.07);
  border: 1px solid #e0e8f8 !important;
  border-radius: 14px !important;
  margin-bottom: 20px !important;
  transition: box-shadow 0.2s;
}
.invoice-section-card:hover { box-shadow: 0 6px 24px rgba(30,60,114,0.12); }

.invoice-section-header {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%) !important;
  border-bottom: 1px solid #dae4f8 !important;
  padding: 14px 20px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  letter-spacing: 0.5px !important;
  border-left: 4px solid var(--primary) !important;
}

.invoice-section-body { padding: 20px 20px !important; }

/* ── Premium Buttons ─────────────────────────────────────── */
.btn-primary-g {
  background: linear-gradient(135deg, #1e3c72, #2a5298, #4f8ef7) !important;
  box-shadow: 0 4px 14px rgba(30,60,114,0.28) !important;
  border-radius: 9px !important;
  padding: 10px 22px !important;
  font-size: 13.5px !important;
  letter-spacing: 0.3px !important;
  transition: all 0.2s !important;
}
.btn-primary-g:hover {
  box-shadow: 0 6px 20px rgba(30,60,114,0.38) !important;
  transform: translateY(-2px) !important;
  filter: brightness(1.05);
}
.btn-outline-g {
  border-radius: 9px !important;
  padding: 8px 16px !important;
  font-size: 12.5px !important;
  border-width: 1.5px !important;
  transition: all 0.18s !important;
}
.btn-outline-g:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(30,60,114,0.15) !important;
}
.btn-danger-g {
  border-radius: 9px !important;
  padding: 8px 14px !important;
  font-size: 12.5px !important;
  transition: all 0.18s !important;
}

/* ── Topbar "New Invoice" button ─────────────────────────── */
.topbar-btn {
  background: linear-gradient(135deg, #1e3c72, #4f8ef7) !important;
  border-radius: 9px !important;
  padding: 9px 20px !important;
  box-shadow: 0 3px 12px rgba(30,60,114,0.25) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  transition: all 0.2s !important;
}
.topbar-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(30,60,114,0.38) !important;
}

/* ── Dashboard stat icons ────────────────────────────────── */
.stat-icon { border-radius: 16px !important; }
.stat-icon.blue   { background: linear-gradient(135deg, #eff6ff, #dbeafe) !important; }
.stat-icon.green  { background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important; }
.stat-icon.orange { background: linear-gradient(135deg, #fff7ed, #fed7aa) !important; }
.stat-icon.purple { background: linear-gradient(135deg, #faf5ff, #ede9fe) !important; }

/* ── Sidebar glow ────────────────────────────────────────── */
.sidebar-wrap {
  background: linear-gradient(175deg, #0f2057 0%, #1e3c72 45%, #2a5298 100%) !important;
  box-shadow: 4px 0 30px rgba(15,32,87,0.35) !important;
}
.sidebar-brand { border-bottom: 1px solid rgba(255,255,255,0.10) !important; }
.sidebar-link.active {
  background: rgba(255,255,255,0.18) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
  border-radius: 10px !important;
}
.sidebar-link:hover { background: rgba(255,255,255,0.12) !important; border-radius: 10px !important; }

/* ── Modal premium ───────────────────────────────────────── */
.modal-content {
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22) !important;
}
.modal-header {
  background: linear-gradient(135deg, #f8faff, #f0f4ff) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 18px 24px !important;
}
.modal-footer { background: #f8faff !important; }

/* ── Status badges improved ──────────────────────────────── */
.status-badge { border-radius: 99px !important; padding: 3px 12px !important; font-size: 11.5px !important; }
.badge-approved, .badge-active  { background: #f0fdf4 !important; color: #15803d !important; border: 1px solid #bbf7d0 !important; }
.badge-pending                  { background: #fffbeb !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.badge-rejected, .badge-suspended { background: #fef2f2 !important; color: #b91c1c !important; border: 1px solid #fecaca !important; }
.badge-expired, .badge-cancelled { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; }

/* ── Subscription plan pill (sidebar) ───────────────────── */
.sidebar-wrap > div[style*="rgba(255,255,255,0.1)"] {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 10px !important;
}

/* ── Invoice total summary box ───────────────────────────── */
#invoice-total-summary {
  background: linear-gradient(135deg, #f0f4ff, #e8efff) !important;
  border: 1.5px solid #c7d8f8 !important;
  border-radius: 12px !important;
  padding: 18px 22px !important;
}

/* ── Invoice items table header ──────────────────────────── */
#invoice-form-items-table thead th {
  background: linear-gradient(135deg, #1e3c72, #2a5298) !important;
  color: #fff !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  padding: 10px 8px !important;
  border: none !important;
}
#invoice-form-items-table tbody tr:hover { background: #f5f8ff !important; }

/* ── DataTable overrides ─────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid #d8e2f8 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  outline: none !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 2px rgba(42,82,152,0.10) !important;
}
.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid #d8e2f8 !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  border-radius: 8px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--primary) !important;
  border-radius: 8px !important;
}

/* ── Bill summary totals highlight ─────────────────────────── */
.invoice-totals-row { background: linear-gradient(135deg, #f0f4ff, #e8efff); }
.invoice-grand-total { font-size: 1.3rem !important; color: var(--primary) !important; font-weight: 800 !important; }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar-wrap { transform: translateX(-100%); }
  .sidebar-wrap.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 80px 16px 24px; }
  .topbar { left: 0; }
  .form-row-g { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-hero { padding: 1.25rem 1.25rem; }
  .page-hero-title { font-size: 1.3rem; }
}

/* ── bg-primary-light utility ────────────────────────────── */
.bg-primary-light {
  background-color: #e6f0fa !important;
}

