/* Tashira ERP - Modern Vibrant UI System with Formal Typography & Tree Picker */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --primary-ring: rgba(29, 78, 216, 0.25);

  --secondary: #0f172a;
  --secondary-light: #f8fafc;

  --accent-emerald: #059669;
  --accent-emerald-light: #ecfdf5;
  --accent-amber: #d97706;
  --accent-amber-light: #fffbeb;
  --accent-rose: #e11d48;
  --accent-rose-light: #fff1f2;
  --accent-indigo: #4f46e5;
  --accent-indigo-light: #eef2ff;
  --accent-purple: #7c3aed;
  --accent-purple-light: #f5f3ff;
  --accent-teal: #0d9488;
  --accent-teal-light: #f0fdf4;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --text-amount-words: #991b1b; /* Dark red for Arabic amount in words per blueprint */

  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --border-focus: #2563eb;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --font-formal: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-formal);
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
  font-size: 16px; /* Larger, formal readable base size per user request */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* Sidebar ERP Tree (Accordion Mode) */
.erp-sidebar {
  width: 300px;
  flex: 0 0 300px;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
}

.sidebar-header {
  height: 76px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #ffffff;
}

.sidebar-brand-mark {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
}

.sidebar-brand-text h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
}

.sidebar-brand-text small {
  font-size: 11px;
  color: #bfdbfe;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

/* Accordion Nav Groups */
.sidebar-nav-group {
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-group-title:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.sidebar-nav-group.open .sidebar-group-title {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 800;
}

.sidebar-group-title .group-icon {
  margin-left: 8px;
  font-size: 17px;
}

.sidebar-group-title .group-caret {
  font-size: 14px;
  transition: transform 0.2s ease;
}

.sidebar-nav-group.open .sidebar-group-title .group-caret {
  transform: rotate(90deg);
}

.sidebar-group-items {
  display: none;
  padding-right: 22px;
  margin-top: 4px;
}

.sidebar-nav-group.open .sidebar-group-items {
  display: block;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-weight: 600;
  margin-bottom: 3px;
}

.sidebar-link:hover {
  background: #f1f5f9;
  color: var(--primary);
  transform: translateX(-3px);
}

.sidebar-link.is-active {
  background: #dbeafe;
  color: var(--primary);
  font-weight: 800;
  border-right: 4px solid var(--primary);
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-dim);
  background: #ffffff;
}

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

/* Topbar Header */
.erp-topbar {
  height: 76px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 20px;
}

.branch-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.branch-selector .dot-status {
  width: 9px;
  height: 9px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.quick-pill {
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.15s;
}

.quick-pill.blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.quick-pill.blue:hover { background: #1d4ed8; color: #ffffff; }

.quick-pill.green { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.quick-pill.green:hover { background: #059669; color: #ffffff; }

.quick-pill.amber { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.quick-pill.amber:hover { background: #d97706; color: #ffffff; }

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e40af;
  color: #ffffff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.user-info b {
  display: block;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 800;
}

.user-info small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.logout-link {
  color: var(--accent-rose);
  background: var(--accent-rose-light);
  border: 1px solid #fecdd3;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.logout-link:hover {
  background: #ffe4e6;
}

/* Page Body & Views */
.erp-body {
  padding: 32px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Header Action Banner */
.page-header-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.page-title-area h1 {
  margin: 0 0 6px 0;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
}

.page-title-area p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.page-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--accent-emerald);
  color: #ffffff;
}
.btn-success:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--accent-amber);
  color: #ffffff;
}
.btn-warning:hover {
  background: #b45309;
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-color);
  color: #334155;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-danger {
  background: var(--accent-rose);
  color: #ffffff;
}
.btn-danger:hover {
  background: #be123c;
}

/* Metric / KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
}
.kpi-card.blue::before { background: var(--primary); }
.kpi-card.green::before { background: var(--accent-emerald); }
.kpi-card.amber::before { background: var(--accent-amber); }
.kpi-card.purple::before { background: var(--accent-purple); }
.kpi-card.rose::before { background: var(--accent-rose); }

.kpi-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 26px;
}
.kpi-card.blue .kpi-icon-wrap { background: var(--primary-light); color: var(--primary); }
.kpi-card.green .kpi-icon-wrap { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.kpi-card.amber .kpi-icon-wrap { background: var(--accent-amber-light); color: var(--accent-amber); }
.kpi-card.purple .kpi-icon-wrap { background: var(--accent-purple-light); color: var(--accent-purple); }
.kpi-card.rose .kpi-icon-wrap { background: var(--accent-rose-light); color: var(--accent-rose); }

.kpi-details span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.kpi-details b {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
  margin: 4px 0 2px;
}
.kpi-details small {
  font-size: 12px;
  color: var(--accent-emerald);
  font-weight: 700;
}

/* Data Table Container */
.data-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
  overflow: hidden;
}

.data-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  flex-wrap: wrap;
}

.data-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.data-card-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}
.data-card-title .counter-pill {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 14px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  height: 42px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  background: #f8fafc;
  outline: none;
  min-width: 250px;
}
.search-input:focus {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: right;
}

.erp-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid var(--border-color);
}

.erp-table th {
  padding: 14px 20px;
  font-weight: 800;
  color: #334155;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.erp-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.1s;
}

.erp-table tbody tr:hover {
  background-color: #f8fafc;
}

.erp-table td {
  padding: 15px 20px;
  color: #1e293b;
  white-space: nowrap;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-success .badge-dot { background: #15803d; }

.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-info .badge-dot { background: #0369a1; }

.badge-warning { background: #fef3c7; color: #b45309; }
.badge-warning .badge-dot { background: #b45309; }

.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-danger .badge-dot { background: #b91c1c; }

.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-purple .badge-dot { background: #6d28d9; }

.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-neutral .badge-dot { background: #475569; }

/* Amount and Tafqeet */
.amount-cell {
  font-weight: 800;
  font-size: 15px;
}
.amount-cell.positive { color: var(--accent-emerald); }
.amount-cell.negative { color: var(--accent-rose); }

.amount-words {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-amount-words); /* Red/Dark Red per blueprint rule */
  margin-top: 3px;
  line-height: 1.5;
}

/* --- HIERARCHICAL TREE PICKER MODAL COMPONENT --- */
/* Blueprint rule: Closed white input with search, popup overlay that does NOT push page content, search filter, radio selection, and path breadcrumb */
.tree-picker-trigger {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s;
}

.tree-picker-trigger:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.tree-picker-label {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.tree-picker-trigger.is-empty .tree-picker-label {
  color: var(--text-dim);
}

.tree-picker-trigger .picker-arrow {
  font-size: 12px;
  color: var(--text-muted);
}

.tree-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.tree-picker-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.tree-picker-panel {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: min(100%, 640px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.tree-picker-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tree-picker-header h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
}

.tree-picker-search-bar {
  padding: 14px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.tree-picker-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  box-sizing: border-box;
}

.tree-picker-search-input:focus {
  border-color: var(--border-focus);
}

.tree-picker-tree-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  max-height: 50vh;
}

/* Tree Nodes */
.tree-node {
  margin-bottom: 4px;
}

.tree-node-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.tree-node-content:hover {
  background: #f1f5f9;
}

.tree-node-content.selected {
  background: #dbeafe !important;
  color: var(--primary) !important;
  font-weight: 800;
  border-radius: var(--radius-sm);
}

.tree-picker-trigger.has-selection {
  border-color: #059669;
  background: #f0fdf4;
}

.tree-picker-trigger.has-selection .tree-picker-label {
  color: #065f46;
  font-weight: 800;
}

/* Navigation Tab Bar for Sub-modules */
.nav-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.nav-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-tab-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.nav-tab-item.is-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.28);
}

.tree-expander {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.tree-node-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  flex: 1;
}

.tree-node-code {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.tree-children {
  display: none;
  padding-right: 24px;
  margin-top: 2px;
  border-right: 2px solid #e2e8f0;
}

.tree-node.open > .tree-children {
  display: block;
}

.tree-node.open > .tree-node-content .tree-expander {
  transform: rotate(90deg);
}

.tree-picker-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tree-path-breadcrumb {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}

/* Modals & Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: min(100%, 720px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(15px);
  transition: all 0.25s ease;
  border: 1px solid var(--border-color);
}

.modal-backdrop.is-open .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-dim);
}
.modal-close-btn:hover { color: var(--text-main); }

.modal-body {
  padding: 26px 28px;
}

.modal-footer {
  padding: 18px 28px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

textarea.form-control {
  height: 100px;
  padding: 12px 16px;
  resize: vertical;
}

/* Bus Seat Reservation Map */
.seat-map-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bus-cabin {
  width: 340px;
  border: 3px solid #475569;
  border-radius: 44px 44px 18px 18px;
  padding: 26px 20px;
  background: #f8fafc;
  box-shadow: var(--shadow-md);
}

.bus-front {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.driver-seat {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #1e293b;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.bus-aisle-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 800;
}

.seats-grid {
  display: grid;
  grid-template-columns: repeat(2, 46px) 38px repeat(2, 46px);
  gap: 12px 6px;
  justify-content: center;
  align-items: center;
}

.seat-btn {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-weight: 800;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.seat-btn:hover:not(.booked):not(.held) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: scale(1.06);
}

.seat-btn.selected {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

.seat-btn.booked {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
  cursor: not-allowed;
  opacity: 0.85;
}

.seat-btn.held {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
  cursor: not-allowed;
}

.seat-legend {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  font-size: 13px;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

/* Double-Entry Accounting Balancing Bar */
.accounting-balance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-weight: 800;
  font-size: 14px;
}

.balance-status.balanced {
  color: var(--accent-emerald);
}

.balance-status.unbalanced {
  color: var(--accent-rose);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 26px;
  left: 26px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: slideInLeft 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { background: #065f46; border-right: 5px solid var(--accent-emerald); }
.toast.error { background: #991b1b; border-right: 5px solid var(--accent-rose); }

/* Responsive Media Queries */
@media (max-width: 960px) {
  .erp-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .erp-sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-toggle {
    display: inline-block;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .page-header-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
