/* Shamim Overseas RL (RL-2274) ERP Stylesheet */
:root {
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --secondary: #475569;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #ea580c;
  --info: #0284c7;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #3b82f6;
  --card-bg: #ffffff;
  --body-bg: #f8fafc;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-bs-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e293b;
  --sidebar-bg: #090d16;
  --sidebar-text: #64748b;
  --card-bg: #1e293b;
  --body-bg: #0f172a;
  --border-color: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
}

body {
  font-family: var(--font-family);
  background-color: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #fff;
  flex-shrink: 0;
  transition: all 0.25s ease;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}

.sidebar-brand h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand .badge-rl {
  background-color: #3b82f6;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-category {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.08em;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.sidebar-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-item:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-item.active {
  color: #fff;
  background-color: #2563eb;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Content Area */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: 64px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-search {
  max-width: 420px;
  width: 100%;
}

.app-content {
  padding: 1.75rem;
  flex-grow: 1;
}

/* Cards & Components */
.card-stat {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-stat:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-stat .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.card-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.4rem;
  letter-spacing: -0.02em;
}

.card-custom {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.card-custom .card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

/* Tables */
.table-custom {
  margin-bottom: 0;
}

.table-custom th {
  background-color: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-custom td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.table-custom tr:hover td {
  background-color: rgba(59, 130, 246, 0.03);
}

/* Financial Styling */
.amount-credit {
  color: #16a34a !important; /* Green */
  font-weight: 600;
}

.amount-debit {
  color: #dc2626 !important; /* Red */
  font-weight: 600;
}

.balance-positive {
  color: #16a34a !important;
  font-weight: 700;
}

.balance-negative {
  color: #dc2626 !important;
  font-weight: 700;
}

.amount-due {
  color: #ea580c !important; /* Orange */
  font-weight: 700;
}

/* Status Badges */
.badge-posted {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-paid {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-partial {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-draft {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-reversed, .badge-cancelled {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Print Styles */
@media print {
  .app-sidebar, .app-topbar, .btn, .no-print, .pagination, .alert {
    display: none !important;
  }
  .app-container, .app-main, .app-content {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
  .card-custom {
    border: none !important;
    box-shadow: none !important;
  }
}
