/* ============================================================
   MBGDash — Bootstrap 5 Theme for Manajemen Dapur
   Version : 1.0.0
   Author  : IndoKoding
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Custom Properties
---------------------------------------------------------- */
:root {
  /* Brand — palet navy biru & gold */
  --mbg-primary:         #1B3A7A;
  --mbg-primary-rgb:     27, 58, 122;
  --mbg-primary-dark:    #122D63;
  --mbg-primary-light:   #EBF0FB;
  --mbg-accent:          #C9960C;
  --mbg-accent-rgb:      201, 150, 12;
  --mbg-accent-dark:     #A87C0A;

  /* Sidebar */
  --sidebar-width:       260px;
  --sidebar-bg:          #0D1A38;
  --sidebar-border:      rgba(255,255,255,.08);
  --sidebar-text:        #7A96BF;
  --sidebar-text-hover:  #C5D8F5;
  --sidebar-icon:        #4A6A9E;
  --sidebar-active-bg:   rgba(27, 58, 122, .30);
  --sidebar-active-text: #7EB3F5;
  --sidebar-active-icon: #7EB3F5;

  /* Topbar */
  --topbar-height:       60px;
  --topbar-bg:           #ffffff;
  --topbar-border:       #E2E8F0;

  /* Layout */
  --content-bg:          #F1F5F9;
  --card-bg:             #ffffff;
  --card-border:         #E2E8F0;
  --card-shadow:         0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover:   0 4px 12px rgba(0,0,0,.10);
  --card-radius:         12px;
  --footer-height:       48px;

  /* Typography */
  --text-primary:        #1E293B;
  --text-secondary:      #475569;
  --text-muted:          #94A3B8;

  /* Transitions */
  --t:                   .22s cubic-bezier(.4,0,.2,1);
}

[data-bs-theme="dark"] {
  --mbg-primary-light:   #0D1A38;
  --topbar-bg:           #1E293B;
  --topbar-border:       #334155;
  --content-bg:          #0F172A;
  --card-bg:             #1E293B;
  --card-border:         #334155;
  --card-shadow:         0 1px 3px rgba(0,0,0,.3);
  --text-primary:        #E2E8F0;
  --text-secondary:      #94A3B8;
  --text-muted:          #64748B;
}


/* ----------------------------------------------------------
   2. Override Bootstrap Primary Color
---------------------------------------------------------- */
:root {
  --bs-primary:          #1B3A7A;
  --bs-primary-rgb:      27, 58, 122;
  --bs-link-color:       #1B3A7A;
  --bs-link-hover-color: #122D63;
}
.btn-primary {
  --bs-btn-bg:            #1B3A7A;
  --bs-btn-border-color:  #1B3A7A;
  --bs-btn-hover-bg:      #122D63;
  --bs-btn-hover-border-color: #122D63;
  --bs-btn-active-bg:     #0C2250;
}
.btn-outline-primary {
  --bs-btn-color:         #1B3A7A;
  --bs-btn-border-color:  #1B3A7A;
  --bs-btn-hover-bg:      #1B3A7A;
  --bs-btn-hover-border-color: #1B3A7A;
}
.text-primary  { color: var(--mbg-primary) !important; }
.bg-primary    { background-color: var(--mbg-primary) !important; }
.border-primary{ border-color: var(--mbg-primary) !important; }


/* ----------------------------------------------------------
   3. Layout Shell
---------------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: .9rem;
  background-color: var(--content-bg);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color var(--t), color var(--t);
}

/* Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Main content area (right of sidebar) */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--t);
}

/* Collapsed sidebar state */
.sidebar-collapsed .main-wrapper { margin-left: 70px; }


/* ----------------------------------------------------------
   4. Sidebar
---------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow: hidden;
  transition: width var(--t), transform var(--t);
}

/* Brand / Logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--mbg-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}
.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.1;
}
.brand-sub {
  font-size: .68rem;
  color: var(--sidebar-text);
  display: block;
  line-height: 1.2;
}

/* Sidebar user profile */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--mbg-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-user-name {
  font-size: .82rem;
  font-weight: 600;
  color: #E2E8F0;
  display: block;
  line-height: 1.2;
}
.sidebar-user-role {
  font-size: .65rem;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(27,122,75,.35);
  color: #4ADE80;
  display: inline-block;
  margin-top: 2px;
}

/* Nav container */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Section title */
.sidebar-section {
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-icon);
  padding: 14px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
}

/* Nav list */
.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Nav item */
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 18px;
  margin: 1px 8px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--t), color var(--t);
  position: relative;
}
.sidebar-nav .nav-link .nav-icon {
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
  color: var(--sidebar-icon);
  transition: color var(--t);
}
.sidebar-nav .nav-link .nav-label { flex: 1; }
.sidebar-nav .nav-link .nav-chevron {
  font-size: .7rem;
  transition: transform var(--t);
  margin-left: auto;
  color: var(--sidebar-icon);
}
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: var(--sidebar-text-hover);
}
.sidebar-nav .nav-link:hover .nav-icon { color: #CBD5E1; }
.sidebar-nav .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}
.sidebar-nav .nav-link.active .nav-icon { color: var(--sidebar-active-icon); }

/* Submenu */
.nav-submenu {
  list-style: none;
  margin: 2px 8px 2px 28px;
  padding: 0;
  display: none;
}
.nav-submenu.show { display: block; }
.nav-submenu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 16px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .82rem;
  transition: background var(--t), color var(--t);
}
.nav-submenu li a::before {
  content: '';
  width: 5px;
  height: 5px;
  min-width: 5px;
  border-radius: 50%;
  background: var(--sidebar-icon);
  transition: background var(--t);
}
.nav-submenu li a:hover,
.nav-submenu li a.active {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,.05);
}
.nav-submenu li a.active::before { background: var(--sidebar-active-icon); }
.nav-submenu li a:hover::before  { background: #94A3B8; }

/* Chevron rotation when open */
.nav-link[aria-expanded="true"] .nav-chevron { transform: rotate(90deg); }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-footer .nav-link {
  margin: 0;
  padding: 8px 12px;
}

/* Collapsed sidebar */
.sidebar-collapsed .sidebar { width: 70px; }
.sidebar-collapsed .sidebar-brand .brand-name,
.sidebar-collapsed .sidebar-brand .brand-sub,
.sidebar-collapsed .sidebar-profile .sidebar-user-name,
.sidebar-collapsed .sidebar-profile .sidebar-user-role,
.sidebar-collapsed .sidebar-nav .nav-label,
.sidebar-collapsed .sidebar-nav .nav-chevron,
.sidebar-collapsed .sidebar-section,
.sidebar-collapsed .nav-submenu { display: none; }
.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: 10px; }
.sidebar-collapsed .sidebar-nav .nav-icon { font-size: 1.15rem; }
.sidebar-collapsed .sidebar-profile { justify-content: center; padding: 10px; }
.sidebar-collapsed .sidebar-profile .sidebar-avatar { margin: 0; }


/* ----------------------------------------------------------
   5. Topbar
---------------------------------------------------------- */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: background var(--t), border-color var(--t);
}
.topbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--t), color var(--t);
  line-height: 1;
}
.topbar-toggle:hover { background: var(--content-bg); color: var(--text-primary); }

.topbar-breadcrumb {
  flex: 1;
  min-width: 0;
}
.topbar-breadcrumb .breadcrumb { margin: 0; font-size: .82rem; }
.topbar-breadcrumb .breadcrumb-item a { color: var(--text-secondary); text-decoration: none; }
.topbar-breadcrumb .breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
  position: relative;
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.topbar-btn:hover { background: var(--content-bg); color: var(--text-primary); }
.topbar-btn .badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--topbar-border);
  margin: 0 4px;
}

/* User dropdown in topbar */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--t);
}
.topbar-user:hover { background: var(--content-bg); }
.topbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mbg-primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-user-name { font-size: .82rem; font-weight: 600; }
.topbar-user-role { font-size: .7rem; color: var(--text-muted); }


/* ----------------------------------------------------------
   6. Content & Cards
---------------------------------------------------------- */
.content {
  flex: 1;
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height) - var(--footer-height));
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.page-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--t), background var(--t), border-color var(--t);
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.card-title { font-size: .95rem; font-weight: 700; margin: 0; }
.card-body { padding: 18px; }
.card-footer {
  background: transparent;
  border-top: 1px solid var(--card-border);
  padding: 12px 18px;
}


/* ----------------------------------------------------------
   7. Stat / KPI Cards
---------------------------------------------------------- */
.stat-card {
  border-radius: var(--card-radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 12px;
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}
.stat-card .stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-card .stat-badge {
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Colored icon backgrounds */
.icon-green   { background: #DCFCE7; color: #15803D; }
.icon-blue    { background: #DBEAFE; color: #1D4ED8; }
.icon-amber   { background: #FEF3C7; color: #D97706; }
.icon-red     { background: #FEE2E2; color: #DC2626; }
.icon-purple  { background: #EDE9FE; color: #7C3AED; }
.icon-teal    { background: #CCFBF1; color: #0F766E; }

[data-bs-theme="dark"] .icon-green  { background: #14532D; color: #86EFAC; }
[data-bs-theme="dark"] .icon-blue   { background: #1E3A5F; color: #93C5FD; }
[data-bs-theme="dark"] .icon-amber  { background: #44330C; color: #FCD34D; }
[data-bs-theme="dark"] .icon-red    { background: #450A0A; color: #FCA5A5; }
[data-bs-theme="dark"] .icon-purple { background: #2E1065; color: #C4B5FD; }
[data-bs-theme="dark"] .icon-teal   { background: #042F2E; color: #5EEAD4; }


/* ----------------------------------------------------------
   8. Status Badges
---------------------------------------------------------- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Production statuses */
.status-draft         { background: #F1F5F9; color: #64748B; }
.status-draft::before { background: #94A3B8; }

.status-cooking         { background: #FEF3C7; color: #D97706; }
.status-cooking::before { background: #F59E0B; }

.status-packing         { background: #DBEAFE; color: #2563EB; }
.status-packing::before { background: #3B82F6; }

.status-ready_for_delivery         { background: #D1FAE5; color: #065F46; }
.status-ready_for_delivery::before { background: #10B981; }

.status-delivered         { background: #DCFCE7; color: #166534; }
.status-delivered::before { background: #22C55E; }

.status-confirmed         { background: #F0FDF4; color: #14532D; }
.status-confirmed::before { background: #16A34A; }

.status-cancelled         { background: #FEE2E2; color: #991B1B; }
.status-cancelled::before { background: #EF4444; }

.status-on_delivery         { background: #EDE9FE; color: #5B21B6; }
.status-on_delivery::before { background: #8B5CF6; }

/* Tenant status */
.status-active    { background: #DCFCE7; color: #166534; }
.status-active::before { background: #22C55E; }
.status-suspended { background: #FEF3C7; color: #92400E; }
.status-suspended::before { background: #F59E0B; }
.status-inactive  { background: #F1F5F9; color: #64748B; }
.status-inactive::before { background: #94A3B8; }

[data-bs-theme="dark"] .status-draft             { background: #1E293B; color: #94A3B8; }
[data-bs-theme="dark"] .status-cooking           { background: #44330C; color: #FCD34D; }
[data-bs-theme="dark"] .status-packing           { background: #1E3A5F; color: #93C5FD; }
[data-bs-theme="dark"] .status-ready_for_delivery{ background: #064E3B; color: #6EE7B7; }
[data-bs-theme="dark"] .status-delivered         { background: #052E16; color: #86EFAC; }
[data-bs-theme="dark"] .status-confirmed         { background: #052E16; color: #86EFAC; }
[data-bs-theme="dark"] .status-cancelled         { background: #450A0A; color: #FCA5A5; }
[data-bs-theme="dark"] .status-on_delivery       { background: #1E1B4B; color: #A5B4FC; }
[data-bs-theme="dark"] .status-active            { background: #052E16; color: #86EFAC; }
[data-bs-theme="dark"] .status-suspended         { background: #44330C; color: #FCD34D; }
[data-bs-theme="dark"] .status-inactive          { background: #1E293B; color: #94A3B8; }


/* ----------------------------------------------------------
   9. Tables
---------------------------------------------------------- */
.table-card .card-body { padding: 0; }
.table-card .card-header { border-radius: var(--card-radius) var(--card-radius) 0 0; }

.table { --bs-table-bg: transparent; margin: 0; font-size: .85rem; }
.table thead th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
  padding: 10px 16px;
  white-space: nowrap;
  background: transparent;
}
.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-color: var(--card-border);
  color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--content-bg); }

/* Table actions */
.table-actions { display: flex; gap: 4px; }
.btn-action {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .8rem;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.btn-action:hover { background: var(--content-bg); }
.btn-action.edit:hover   { background: #DBEAFE; color: #1D4ED8; border-color: #BFDBFE; }
.btn-action.delete:hover { background: #FEE2E2; color: #DC2626; border-color: #FECACA; }
.btn-action.view:hover   { background: #F0FDF4; color: #15803D; border-color: #BBF7D0; }

[data-bs-theme="dark"] .btn-action { border-color: var(--card-border); color: var(--text-secondary); }
[data-bs-theme="dark"] .btn-action:hover       { background: rgba(255,255,255,.05); }
[data-bs-theme="dark"] .btn-action.edit:hover  { background: #1E3A5F; color: #93C5FD; border-color: #1E40AF; }
[data-bs-theme="dark"] .btn-action.delete:hover{ background: #450A0A; color: #FCA5A5; border-color: #7F1D1D; }
[data-bs-theme="dark"] .btn-action.view:hover  { background: #052E16; color: #86EFAC; border-color: #14532D; }


/* ----------------------------------------------------------
   10. Filter Bar
---------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
}
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: .83rem;
  border-color: var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  border-color: var(--mbg-primary);
  box-shadow: 0 0 0 3px rgba(var(--mbg-primary-rgb),.12);
}
.search-input { min-width: 220px; max-width: 280px; }


/* ----------------------------------------------------------
   11. Forms
---------------------------------------------------------- */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .35rem;
}
.form-control, .form-select {
  border-color: var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: .875rem;
  border-radius: 8px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.form-control:focus, .form-select:focus {
  border-color: var(--mbg-primary);
  box-shadow: 0 0 0 3px rgba(var(--mbg-primary-rgb),.12);
  background: var(--card-bg);
  color: var(--text-primary);
}
.form-control::placeholder { color: var(--text-muted); }
.form-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--mbg-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mbg-primary-light);
  margin-bottom: 16px;
}

/* Recipe items / dynamic row table */
.items-table { border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; }
.items-table table { margin: 0; }
.items-table .btn-remove-row {
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: .8rem;
  border: none; background: #FEE2E2; color: #DC2626;
  cursor: pointer;
}


/* ----------------------------------------------------------
   12. Workflow / Timeline / Status Pipeline
---------------------------------------------------------- */
.workflow-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0;
}
.workflow-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.workflow-step-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}
.workflow-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: var(--text-muted);
}
.workflow-step-label {
  font-size: .7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.workflow-step-line {
  height: 2px;
  width: 40px;
  background: var(--card-border);
  flex-shrink: 0;
}
.workflow-step.done .workflow-step-dot {
  background: var(--mbg-primary);
  border-color: var(--mbg-primary);
  color: #fff;
}
.workflow-step.done .workflow-step-label { color: var(--mbg-primary); font-weight: 600; }
.workflow-step.done .workflow-step-line  { background: var(--mbg-primary); }
.workflow-step.current .workflow-step-dot {
  border-color: var(--mbg-primary);
  color: var(--mbg-primary);
  box-shadow: 0 0 0 4px rgba(var(--mbg-primary-rgb),.15);
}
.workflow-step.current .workflow-step-label { color: var(--mbg-primary); font-weight: 700; }

/* Activity timeline */
.timeline { position: relative; padding: 0 0 0 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--card-border);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -23px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
}
.timeline-dot.active { background: var(--mbg-primary); border-color: var(--mbg-primary); color: #fff; }
.timeline-time { font-size: .72rem; color: var(--text-muted); }
.timeline-text { font-size: .83rem; color: var(--text-primary); margin-top: 2px; }


/* ----------------------------------------------------------
   13. Charts
---------------------------------------------------------- */
.chart-wrapper { position: relative; }
.chart-wrapper canvas { max-width: 100%; }


/* ----------------------------------------------------------
   14. Alert Widgets
---------------------------------------------------------- */
.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: .83rem;
}
.alert-item:last-child { margin-bottom: 0; }
.alert-item-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}
.alert-item.warning { background: #FFFBEB; border: 1px solid #FDE68A; }
.alert-item.danger  { background: #FFF5F5; border: 1px solid #FED7D7; }
.alert-item.info    { background: #EFF6FF; border: 1px solid #BFDBFE; }
[data-bs-theme="dark"] .alert-item.warning { background: #44330C; border-color: #78350F; }
[data-bs-theme="dark"] .alert-item.danger  { background: #450A0A; border-color: #7F1D1D; }
[data-bs-theme="dark"] .alert-item.info    { background: #1E3A5F; border-color: #1E40AF; }

/* Stock alert bar */
.stock-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--card-border);
  overflow: hidden;
  margin-top: 4px;
}
.stock-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; }


/* ----------------------------------------------------------
   15. Empty State
---------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--mbg-primary-light);
  color: var(--mbg-primary);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty-state-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.empty-state-text  { font-size: .85rem; color: var(--text-muted); max-width: 280px; }


/* ----------------------------------------------------------
   16. Modal
---------------------------------------------------------- */
.modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: 14px 14px 0 0;
}
.modal-title { font-size: .95rem; font-weight: 700; }
.modal-body  { padding: 20px; background: var(--card-bg); }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
  border-radius: 0 0 14px 14px;
}


/* ----------------------------------------------------------
   17. Pagination
---------------------------------------------------------- */
.pagination { --bs-pagination-font-size: .82rem; margin: 0; }
.pagination .page-link {
  border-color: var(--card-border);
  color: var(--text-secondary);
  background: var(--card-bg);
  border-radius: 6px !important;
  margin: 0 2px;
  padding: 5px 10px;
}
.pagination .page-item.active .page-link {
  background: var(--mbg-primary);
  border-color: var(--mbg-primary);
}
.pagination .page-link:hover {
  background: var(--content-bg);
  color: var(--mbg-primary);
}


/* ----------------------------------------------------------
   18. Buttons
---------------------------------------------------------- */
.btn {
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 16px;
  transition: all var(--t);
}
.btn-sm  { padding: 4px 10px; font-size: .78rem; border-radius: 6px; }
.btn-lg  { padding: 10px 22px; font-size: .95rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; }

.btn-success {
  --bs-btn-bg:           #16A34A;
  --bs-btn-border-color: #16A34A;
  --bs-btn-hover-bg:     #15803D;
}
.btn-warning {
  --bs-btn-color:        #fff;
  --bs-btn-bg:           #D97706;
  --bs-btn-border-color: #D97706;
  --bs-btn-hover-bg:     #B45309;
  --bs-btn-hover-color:  #fff;
}


/* ----------------------------------------------------------
   19. Dark Mode Toggle
---------------------------------------------------------- */
.dark-mode-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}
.dark-mode-toggle:hover { background: var(--content-bg); }

/* Footer */
.app-footer {
  background: var(--topbar-bg);
  border-top: 1px solid var(--topbar-border);
  padding: 12px 24px;
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ----------------------------------------------------------
   20. Login Page
---------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0D1A38 0%, #1B3A7A 60%, #C9960C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,.4);
}
.login-card .card-header {
  background: var(--mbg-primary);
  text-align: center;
  padding: 28px 24px;
  border-radius: 0;
  border: none;
}
.login-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.login-title { font-size: 1.3rem; font-weight: 800; color: #fff; }
.login-sub   { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: 2px; }
.login-card .card-body { padding: 28px 24px; }


/* ----------------------------------------------------------
   21. Settings Page
---------------------------------------------------------- */
.settings-nav .nav-link {
  font-size: .85rem;
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 12px;
}
.settings-nav .nav-link.active {
  background: var(--mbg-primary-light);
  color: var(--mbg-primary);
  font-weight: 600;
}
.settings-section { display: none; }
.settings-section.active { display: block; }


/* ----------------------------------------------------------
   22. Notification Badge
---------------------------------------------------------- */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  transition: background var(--t);
  cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--content-bg); }
.notif-item.unread { background: var(--mbg-primary-light); }
.notif-item.unread:hover { filter: brightness(.97); }
.notif-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--mbg-primary);
  margin-top: 6px;
}
.notif-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
.notif-title { font-size: .84rem; font-weight: 600; }
.notif-text  { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.notif-time  { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }


/* ----------------------------------------------------------
   23. Responsive
---------------------------------------------------------- */
@media (max-width: 991.98px) {
  :root { --sidebar-width: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .sidebar.show { transform: translateX(0); }

  .main-wrapper { margin-left: 0 !important; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1039;
  }
  .sidebar-overlay.show { display: block; }
  .sidebar-collapsed .sidebar { transform: translateX(-100%); }
}

@media (max-width: 575.98px) {
  .content { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .filter-bar { padding: 10px 14px; }
  .search-input { max-width: 100%; }
}


/* ----------------------------------------------------------
   24. Utilities
---------------------------------------------------------- */
.fw-semibold { font-weight: 600 !important; }
.text-xs     { font-size: .72rem !important; }
.text-sm     { font-size: .82rem !important; }
.rounded-xl  { border-radius: 12px !important; }
.gap-2       { gap: .5rem !important; }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }

/* Scrollable table wrapper */
.table-responsive { border-radius: 0 0 var(--card-radius) var(--card-radius); }

/* Print helpers */
@media print {
  .sidebar, .topbar, .page-actions, .filter-bar .btn { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .content { padding: 0 !important; }
}
