/* Currency Switcher Styles */
.currency-switch {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.currency-btn {
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.currency-btn:hover {
    filter: brightness(1.05);
}

/* Dual Currency Display */
.dual-currency {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.dual-currency .eur {
    color: #3b82f6;
    font-weight: 600;
}

.dual-currency .ghs {
    color: #10b981;
    font-size: 12px;
}

/* Table currency styling */
td .small-currency {
    font-size: 11px;
    color: #10b981;
    display: block;
}




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

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

:root {
  --sidebar-bg: #0f1628;
  --sidebar-hover: #1a2540;
  --sidebar-active: #2563eb;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-width: 240px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --info: #0891b2;
  --info-light: #ecfeff;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
  overflow: hidden;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}
.sidebar-logo span { color: var(--primary); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.nav-section {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: all .15s ease;
  position: relative;
  margin: 1px 8px;
  border-radius: 8px;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-info .name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info .role {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-transform: capitalize;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-muted);
}
.hamburger:hover { background: var(--bg); }
.page-title h2 { font-size: 20px; font-weight: 700; color: var(--text); }
.page-title p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-dark);
}
.btn-outline:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 9px; font-size: 11px; }

.page-body { padding: 28px; flex: 1; }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 22px; }

/* ---- STATS CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.cyan { background: var(--info-light); color: var(--info); }
.stat-info .label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-info .value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.stat-info .change {
  font-size: 11.5px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.change.up { color: var(--success); }
.change.down { color: var(--danger); }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f8fafc;
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.table-actions { display: flex; align-items: center; gap: 6px; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-admin { background: #7c3aed; color: #fff; }
.badge-manager { background: #2563eb; color: #fff; }
.badge-cashier { background: #0891b2; color: #fff; }
.badge-staff { background: #64748b; color: #fff; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 18px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
label .req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=number], input[type=email], input[type=password],
input[type=date], input[type=search], select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
input.is-invalid { border-color: var(--danger); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* ---- SEARCH BAR ---- */
.search-box {
  position: relative;
  flex: 1;
  max-width: 340px;
}
.search-box input {
  padding-left: 38px;
  background: var(--bg);
  border-color: var(--border);
}
.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* ---- PRODUCT SEARCH AUTOCOMPLETE ---- */
.product-search-wrapper { position: relative; }
.product-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.product-dropdown.show { display: block; }
.product-option {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.product-option:last-child { border-bottom: none; }
.product-option:hover { background: var(--primary-light); }
.product-option .prod-name { font-weight: 600; font-size: 13px; }
.product-option .prod-meta { font-size: 11.5px; color: var(--text-muted); }
.product-option .prod-price { font-size: 13px; font-weight: 700; color: var(--primary); }
.product-option .prod-stock { font-size: 11px; color: var(--text-muted); }

/* ---- SALE ITEMS TABLE ---- */
.sale-items-table { margin-top: 16px; }
.sale-items-table table thead th { background: var(--primary-light); color: var(--primary); }
.remove-item { background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px; border-radius: 4px; }
.remove-item:hover { background: var(--danger-light); }

/* ---- TOTALS BOX ---- */
.totals-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 18px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.totals-row.total-line {
  border-top: 1px solid var(--border-dark);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 16px;
}
.totals-row.balance-line { color: var(--success); font-weight: 700; font-size: 15px; }
.totals-row.owed-line { color: var(--danger); font-weight: 700; font-size: 15px; }

/* ---- ALERTS / FLASH ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-success { background: var(--success-light); color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: var(--danger-light); color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-light); color: #0e7490; border: 1px solid #a5f3fc; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: .35; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 18px; justify-content: flex-end; }
.page-link {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
}
.page-link:hover, .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e3a5f 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 26px; font-weight: 800; color: var(--text); }
.login-logo h1 span { color: var(--primary); }
.login-logo p { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.login-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---- FINANCE TABS ---- */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; gap: 0; }
.tab-btn {
  padding: 10px 22px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(-10px); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px; color: var(--text-muted); }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---- ROLE SELECTOR ---- */
.role-select-group { display: flex; flex-direction: column; gap: 8px; }
.role-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.role-option:hover { border-color: var(--primary); background: var(--primary-light); }
.role-option input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); }
.role-option.selected { border-color: var(--primary); background: var(--primary-light); }
.role-label { font-weight: 600; font-size: 13.5px; }
.role-desc { font-size: 12px; color: var(--text-muted); }

/* ---- DASHBOARD GRID ---- */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.recent-table thead th { font-size: 11px; padding: 9px 14px; }
.recent-table tbody td { padding: 10px 14px; font-size: 13px; }

/* ---- EXPIRY BADGES ---- */
.expiry-critical { color: var(--danger); font-weight: 700; }
.expiry-warning { color: var(--warning); font-weight: 600; }
.expiry-ok { color: var(--success); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .topbar { padding: 12px 16px; }
}

/* ---- UTILITIES ---- */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 18px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---- PRINT ---- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  .page-body { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
