:root {
  --font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --navy-primary: #1e3a8a;
  --navy-hover: #1e40af;
  --blue-accent: #2563eb;
  --blue-light: #eff6ff;
  
  --success-color: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  
  --warning-color: #f59e0b;
  --warning-bg: #fffbeb;
  
  --danger-color: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-alt: #1f2937;
  --border-color: #374151;
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  --navy-primary: #3b82f6;
  --navy-hover: #60a5fa;
  --blue-light: #1e293b;
  
  --success-bg: #064e3b;
  --success-text: #a7f3d0;
  
  --danger-bg: #7f1d1d;
  --danger-text: #fecaca;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

/* Header */
.top-nav {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: #ffffff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn-download {
  background: #10b981;
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-download:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-lang {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-lang:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--blue-accent);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary:hover {
  background: var(--navy-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--bg-surface-alt);
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  position: sticky;
  top: 72px;
  z-index: 90;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-alt);
}

.tab-btn.active {
  background: var(--blue-light);
  color: var(--blue-accent);
  border-color: rgba(37, 99, 235, 0.2);
  font-weight: 700;
}

/* Container */
.main-container {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.5rem 3rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

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

/* Status Banner */
.system-status-banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.system-status-banner.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.kpi-card.highlight {
  border-color: #10b981;
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  font-weight: 700;
}

.kpi-badge.profit {
  background: var(--success-bg);
  color: var(--success-text);
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.kpi-value.profit {
  color: #10b981;
}

.kpi-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dashboard Sections */
.dashboard-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-body {
  padding: 1.5rem;
}

.file-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  background: var(--bg-surface-alt);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.file-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue-accent);
}

.file-icon {
  font-size: 1.6rem;
}

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.file-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-sm {
  background: var(--blue-accent);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Accounting Equation Box */
.accounting-eq-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1.25rem 0.5rem;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  text-align: center;
}

.eq-item .eq-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.eq-item .eq-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.eq-sign {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.eq-verification {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.eq-verification.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Tables */
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.toolbar-btns {
  display: flex;
  gap: 0.75rem;
}

.search-box input {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.9rem;
  min-width: 260px;
}

.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: inherit;
}

.data-table th {
  background: var(--navy-primary);
  color: #ffffff;
  padding: 0.85rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table th.subheader-col {
  background: #1e40af;
  font-size: 0.82rem;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-surface-alt);
}

.data-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.center-cell {
  text-align: center;
}

.total-row {
  background: var(--blue-light) !important;
  font-weight: 700;
}

.total-label {
  text-align: right;
  font-weight: 700;
}

.bold-val {
  font-weight: 800;
  color: var(--navy-primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.tb-validation-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Financial Statement Layout */
.fs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

.bs-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.fs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--navy-primary);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.fs-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-primary);
}

.fs-currency {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fs-section-title {
  background: var(--bg-surface-alt);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--navy-primary);
}

.fs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.fs-row.subtotal {
  background: var(--blue-light);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
}

.fs-row.profit-row {
  background: rgba(16, 185, 129, 0.08);
  font-weight: 700;
}

.fs-row.grand-total {
  background: var(--navy-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 800;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
}

.fs-row.grand-total.profit {
  background: #059669;
}

.grand-val {
  font-size: 1.15rem;
  font-weight: 800;
}

.code-tag {
  background: var(--bg-surface-alt);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: monospace;
  margin-inline-end: 0.5rem;
  color: var(--text-muted);
}

.negative {
  color: #ef4444;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

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

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group.flex-2 {
  flex: 2;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input,
.form-group select {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-divider {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--navy-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3rem;
}

.form-subbox {
  background: var(--bg-surface-alt);
  padding: 0.9rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.9rem;
  border: 1px solid var(--border-color);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Searchable Account Combobox Styles */
.searchable-acct-box input:focus {
  border-color: var(--blue-accent) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.acct-dropdown-menu {
  scrollbar-width: thin;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.acct-dropdown-item {
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.12s ease;
  font-size: 0.9rem;
}

.acct-dropdown-item:last-child {
  border-bottom: none;
}

.acct-dropdown-item:hover,
.acct-dropdown-item.active {
  background: var(--blue-light);
  color: var(--blue-accent);
}

.acct-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.acct-item-names {
  display: flex;
  flex-direction: column;
}

.acct-primary-name {
  font-weight: 700;
  color: var(--text-main);
}

.acct-sec-name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.acct-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .dashboard-sections-grid,
  .bs-split-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .top-nav,
  .modules-bar,
  .tabs-nav,
  .subnav-tabs,
  .toolbar-btns,
  .btn-download,
  .btn-lang,
  .btn-icon,
  .btn-primary,
  .btn-outline,
  .modal-backdrop,
  .search-box {
    display: none !important;
  }

  body, .main-container {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .card, .table-container, .kpi-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .tab-content, .module-view {
    display: none !important;
  }

  #sec-report.active, .printable-active {
    display: block !important;
  }
}

/* ==========================================
   MODULAR ERP STYLES & SUB-SYSTEMS
   ========================================== */

/* Main Modules Top Bar */
.modules-bar {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.module-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.module-tab-btn:hover {
  background: var(--bg-surface-alt);
  color: var(--navy-primary);
}

.module-tab-btn.active {
  background: linear-gradient(135deg, var(--navy-primary) 0%, #1e40af 100%);
  color: #ffffff;
  border-color: var(--navy-primary);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}

/* Module Container Views */
.module-view {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.module-view.active {
  display: block;
}

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

/* Sub-Navigation within Modules */
.subnav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.subnav-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subnav-btn:hover {
  color: var(--navy-primary);
  background: var(--bg-surface-alt);
}

.subnav-btn.active {
  color: var(--navy-primary);
  background: var(--blue-light);
  font-weight: 700;
}

/* Sub-module View Container */
.sub-view-pane {
  display: none;
}

.sub-view-pane.active {
  display: block;
}

/* Aging Analysis Cards Grid */
.aging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.aging-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 4px solid var(--navy-primary);
}

.aging-card.current { border-top-color: #10b981; }
.aging-card.days30 { border-top-color: #3b82f6; }
.aging-card.days60 { border-top-color: #f59e0b; }
.aging-card.days90 { border-top-color: #ef4444; }

.aging-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.aging-amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Invoice Line Items Form Table */
.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.invoice-items-table th {
  background: var(--bg-surface-alt);
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-primary);
  border: 1px solid var(--border-color);
  text-align: right;
}

.invoice-items-table td {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
}

.invoice-items-table input,
.invoice-items-table select {
  width: 100%;
  padding: 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Progress & Capacity Bars */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-bar-fill.success { background: #10b981; }
.progress-bar-fill.warning { background: #f59e0b; }
.progress-bar-fill.danger { background: #ef4444; }
.progress-bar-fill.info { background: #3b82f6; }

/* Status Badges */
.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-draft {
  background: #e2e8f0;
  color: #475569;
}

.badge-paid {
  background: #dcfce7;
  color: #166534;
}

.badge-unpaid {
  background: #fee2e2;
  color: #991b1b;
}

/* Quick Action Bar */
.module-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.module-title-box h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.module-title-box p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}


/* ========================================================================== */
/* VERTICAL ERP SIDEBAR NAVIGATION & ADVANCED CHECK LIFECYCLE STYLING        */
/* ========================================================================== */

.app-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  width: 100%;
}

.app-sidebar {
  width: 290px;
  min-width: 290px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  padding: 1.25rem 0.85rem 3rem;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

[dir="ltr"] .app-sidebar {
  border-left: none;
  border-right: 1px solid var(--border-color);
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.04);
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  width: 100%;
}

[dir="ltr"] .sidebar-link {
  text-align: left;
}

.sidebar-link:hover {
  background: var(--bg-surface-alt);
  color: var(--blue-accent);
}

.sidebar-link.active {
  background: var(--blue-light);
  color: var(--blue-accent);
  border-color: rgba(37, 99, 235, 0.25);
  font-weight: 700;
}

.sidebar-link.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--blue-accent);
  border-radius: 4px 0 0 4px;
}

[dir="ltr"] .sidebar-link.active::after {
  right: auto;
  left: 0;
  border-radius: 0 4px 4px 0;
}

.sidebar-icon {
  font-size: 1.15rem;
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-surface-alt);
  color: var(--text-muted);
}

.sidebar-link.active .sidebar-count-badge {
  background: rgba(37, 99, 235, 0.15);
  color: var(--blue-accent);
}

.app-main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem 4rem;
  background: var(--bg-main);
}

/* Locked Journal Entry Badge & Styling */
.badge-locked {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

[data-theme="dark"] .badge-locked {
  background: #451a03;
  color: #fde68a;
  border-color: #78350f;
}

.badge-manual {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.btn-locked-entry {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-locked-entry:hover {
  background: #fde68a;
}

/* Checks Status Badges & Lifecycle */
.badge-check-portfolio { background: #dbeafe; color: #1e40af; }
.badge-check-collecting { background: #fef3c7; color: #b45309; }
.badge-check-cleared { background: #dcfce7; color: #166534; }
.badge-check-bounced { background: #fee2e2; color: #991b1b; }
.badge-check-void { background: #f1f5f9; color: #475569; }

.check-lifecycle-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 1.5rem 0 2rem;
  padding: 0 1rem;
}

.check-lifecycle-stepper::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2rem;
  right: 2rem;
  height: 3px;
  background: var(--border-color);
  z-index: 1;
  transform: translateY(-50%);
}

.check-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  padding: 0 0.5rem;
}

.check-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.check-step-item.active .check-step-circle {
  background: var(--blue-accent);
  border-color: var(--blue-accent);
  color: #fff;
}

.check-step-item.completed .check-step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.check-step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.check-step-item.active .check-step-label {
  color: var(--blue-accent);
  font-weight: 700;
}


/* ========================================================================== */
/* DELIZIA COMPANY, USERS MANAGEMENT, AUDIT TRAIL & SESSION TIMER STYLES      */
/* ========================================================================== */

/* Top Nav Session & User Badges */
.session-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-pill-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-logout-nav {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-logout-nav:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Company Profile Cards */
.company-card-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 100%);
  color: #ffffff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.company-brand-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.company-logo-large {
  font-size: 3.5rem;
  background: rgba(255, 255, 255, 0.15);
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.company-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.info-item-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.info-item-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.info-item-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Permissions Matrix Table */
.perm-matrix-table th, .perm-matrix-table td {
  padding: 0.75rem 1rem;
  text-align: center;
}

.perm-matrix-table td:first-child {
  text-align: right;
  font-weight: 600;
}

[dir="ltr"] .perm-matrix-table td:first-child {
  text-align: left;
}

.perm-check-box {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #2563eb;
}

/* Roles Badges */
.role-super-admin { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.role-chief-acc { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.role-accountant { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.role-storekeeper { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.role-branch-mgr { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

/* Inactivity Warning Modal & Overlay */
.inactivity-warning-box {
  text-align: center;
  padding: 1rem;
}

.inactivity-timer-display {
  font-size: 3rem;
  font-weight: 800;
  color: #ef4444;
  margin: 1rem 0;
  font-family: monospace;
}

/* Lock / Login Screen Full-page Overlay */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.lock-icon-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-sm);
}


/* ========================================================================== */
/* SIDEBAR SUB-MENU & SUB-PAGE ACCORDION NAVIGATION STYLES                   */
/* ========================================================================== */

.sidebar-module-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  margin-bottom: 0.15rem;
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.sidebar-arrow {
  font-size: 0.65rem;
  margin-right: auto;
  transition: transform 0.25s ease;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

[dir="ltr"] .sidebar-arrow {
  margin-right: 0;
  margin-left: auto;
}

.sidebar-module-item.open > .sidebar-header-row .sidebar-arrow {
  transform: rotate(180deg);
  color: var(--blue-accent);
}

.sidebar-submenu {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0.5rem 0.4rem 0.6rem;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  border-right: 2px solid rgba(37, 99, 235, 0.2);
  padding-right: 0.6rem;
}

[dir="ltr"] .sidebar-submenu {
  margin: 0.2rem 0.6rem 0.4rem 0.5rem;
  border-right: none;
  border-left: 2px solid rgba(37, 99, 235, 0.2);
  padding-right: 0;
  padding-left: 0.6rem;
}

.sidebar-module-item.open > .sidebar-submenu {
  display: flex;
  animation: submenuFadeDown 0.2s ease;
}

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

.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: right;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[dir="ltr"] .sidebar-sublink {
  text-align: left;
}

.sidebar-sublink:hover {
  background: var(--bg-surface-alt);
  color: var(--blue-accent);
  transform: translateX(-3px);
}

[dir="ltr"] .sidebar-sublink:hover {
  transform: translateX(3px);
}

.sidebar-sublink.active {
  background: var(--blue-light);
  color: var(--blue-accent);
  font-weight: 700;
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

/* ========================================================================== */
/* EXCEL IMPORT MODAL & DATA INTEGRATION STYLES                               */
/* ========================================================================== */

.modal-card.modal-lg {
  max-width: 860px;
  width: 95%;
}

.excel-drop-zone {
  border: 2px dashed rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.03);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 1rem 0;
  position: relative;
}

.excel-drop-zone:hover,
.excel-drop-zone.dragover {
  border-color: var(--blue-accent);
  background: rgba(37, 99, 235, 0.08);
}

.excel-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.excel-drop-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.excel-preview-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.excel-preview-table-container {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-top: 0.75rem;
}

.excel-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.excel-summary-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-excel-import {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-excel-import:hover {
  background: #059669;
  color: #fff;
}


/* ========================================================================== */
/* DAFTRA RESTAURANT POS & TOUCH TERMINAL STYLES                              */
/* ========================================================================== */

.pos-screen-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  min-height: calc(100vh - 160px);
}

@media (max-width: 1024px) {
  .pos-screen-layout {
    grid-template-columns: 1fr;
  }
}

.pos-categories-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.pos-cat-btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pos-cat-btn:hover {
  border-color: var(--blue-accent);
  color: var(--blue-accent);
}

.pos-cat-btn.active {
  background: var(--blue-accent);
  color: #ffffff;
  border-color: var(--blue-accent);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}

.pos-product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pos-product-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.pos-prod-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.pos-prod-name {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.pos-prod-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #059669;
}

.pos-cart-area {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 90px;
}

.pos-cart-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-cart-items-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pos-cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.pos-cart-totals {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.pos-summary-row.grand-total {
  border-top: 2px dashed var(--border-color);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
  font-size: 1.15rem;
}

.pos-pay-methods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-pay {
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-pay.cash {
  background: #10b981;
  color: #fff;
}
.btn-pay.cash:hover { background: #059669; }

.btn-pay.mada {
  background: #2563eb;
  color: #fff;
}
.btn-pay.mada:hover { background: #1d4ed8; }

.btn-pay.cc {
  background: #8b5cf6;
  color: #fff;
}
.btn-pay.cc:hover { background: #7c3aed; }

.btn-pay.credit {
  background: #f59e0b;
  color: #fff;
}
.btn-pay.credit:hover { background: #d97706; }

/* ZATCA Printable Tax Invoice Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #zatca-printable-area, #zatca-printable-area * {
    visibility: visible;
  }
  #zatca-printable-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}


/* ========================================================================== */
/* DAFTRA ERP TYPOGRAPHY & HEADER USER DROPDOWN & DRILLDOWN STYLES            */
/* ========================================================================== */

/* Typography rule: 14px for main items, 12px for sub-items */
.sidebar-link {
  font-size: 14px !important;
  font-weight: 700 !important;
}

.sidebar-link .sidebar-text {
  font-size: 14px !important;
  font-weight: 700 !important;
}

.sidebar-sublink {
  font-size: 12px !important;
  font-weight: 500 !important;
}

.sidebar-sublink span {
  font-size: 12px !important;
  font-weight: 500 !important;
}

/* Header Live System Clock Badge */
.system-clock-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: #ffffff;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.system-clock-badge .clock-icon {
  font-size: 0.95rem;
}

.system-clock-badge .clock-sep {
  opacity: 0.4;
}

/* User Profile Menu Container & Dropdown */
.user-profile-menu-container {
  position: relative;
}

.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.user-pill-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.user-dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 310px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s ease;
}

[dir="ltr"] .user-dropdown-menu {
  left: auto;
  right: 0;
}

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

.user-dropdown-header {
  padding: 1.15rem 1.25rem;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.user-header-info strong {
  display: block;
  font-size: 0.98rem;
  color: var(--text-main);
}

.user-header-branch {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-dropdown-meta {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-main);
}

.meta-row span {
  color: var(--text-muted);
}

.user-dropdown-actions {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-item-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: right;
  transition: all 0.15s ease;
}

[dir="ltr"] .dropdown-item-btn {
  text-align: left;
}

.dropdown-item-btn:hover {
  background: var(--bg-surface-alt);
  color: var(--blue-accent);
}

.dropdown-item-btn.lock:hover {
  background: #fef3c7;
  color: #b45309;
}

.dropdown-item-btn.logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Universal Clickable Drill-down Link Styling */
.drilldown-link {
  color: var(--blue-accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
}

.drilldown-link:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  transform: translateY(-1px);
}


/* ========================================================================== */
/* NEW WINDOW TOGGLE BUTTON STYLING                                           */
/* ========================================================================== */
.btn-window-mode {
  background: rgba(16, 185, 129, 0.2);
  color: #ffffff;
  border: 1px solid #10b981;
  padding: 0.52rem 0.95rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-window-mode:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}


/* ========================================================================== */
/* SINGLE-PAGE WEBSITE FOCUS NAVIGATION & BREADCRUMB STYLES                   */
/* ========================================================================== */

/* Hide cluttered horizontal subnav tab bars so each page stands completely alone */
/* Restored */
.tabs-nav, .sub-module-nav, .subnav-tabs { display: flex !important; }

/* Site Page Header & Breadcrumb Bar */
.site-page-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.site-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.site-breadcrumb .crumb-link {
  color: var(--blue-accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.site-breadcrumb .crumb-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.site-breadcrumb .crumb-sep {
  color: var(--text-muted);
  opacity: 0.45;
}

.site-breadcrumb .crumb-parent {
  color: var(--text-muted);
  font-weight: 500;
}

.site-breadcrumb .crumb-current {
  color: var(--text-main);
  font-weight: 700;
}

/* Smooth page appearance */
.tab-content.active, .sub-view-pane.active {
  animation: singlePageFadeIn 0.2s ease-out;
}

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

/* ========================================================================== */
/* DAFTRA COMPREHENSIVE EMPLOYEE & HR MODAL STYLING                           */
/* ========================================================================== */
.emp-form-tabs {
  gap: 0.5rem;
  overflow-x: auto;
}
.emp-tab-btn {
  padding: 0.85rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.emp-tab-btn:hover {
  color: #1e293b;
  background: rgba(241, 245, 249, 0.7);
}
.emp-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: white;
}
.daftra-card-section {
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.daftra-upload-box:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
}


/* ==========================================================================
   DAFTRA-STYLED STAFF ROLES & PERMISSIONS MATRIX STYLES
   ========================================================================== */

.daftra-editor-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
}

.daftra-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  font-size: 0.88rem;
  color: #334155;
  font-weight: 500;
}

.daftra-cat-item:hover {
  background: #f8fafc;
  color: #1e293b;
}

.daftra-cat-item.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  border-right: 4px solid #2563eb;
}

.daftra-cat-badge {
  font-size: 0.78rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-family: monospace;
}

.daftra-cat-item.active .daftra-cat-badge {
  background: #dbeafe;
  color: #1e40af;
}

.daftra-perm-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.daftra-perm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.15rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.daftra-perm-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.daftra-perm-card-body {
  padding: 1rem 1.15rem;
}

.daftra-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.65rem 1rem;
}

.daftra-perm-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: #334155;
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  transition: background 0.12s ease;
}

.daftra-perm-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.daftra-perm-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}

.daftra-role-action-btn {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
  font-family: inherit;
}

.daftra-role-action-btn:hover {
  background: #f1f5f9;
}

.daftra-role-action-btn.btn-edit {
  color: #2563eb;
  border-color: #bfdbfe;
}
.daftra-role-action-btn.btn-edit:hover {
  background: #eff6ff;
}

.daftra-role-action-btn.btn-copy {
  color: #0d9488;
  border-color: #99f6e4;
}
.daftra-role-action-btn.btn-copy:hover {
  background: #f0fdfa;
}

.daftra-role-action-btn.btn-restrict {
  color: #d97706;
  border-color: #fde68a;
}
.daftra-role-action-btn.btn-restrict:hover {
  background: #fffbeb;
}

.daftra-role-action-btn.btn-del {
  color: #dc2626;
  border-color: #fecaca;
}
.daftra-role-action-btn.btn-del:hover {
  background: #fef2f2;
}
