/* ============================================================
   ABRR ERP — Main Stylesheet v2.0
   Modern dark sidebar + light/dark theme
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,0.06);
  --nav-active-bg: rgba(124,58,237,0.15);
  --nav-active-border: #7c3aed;
  --nav-hover-bg: rgba(255,255,255,0.04);
  --brand-purple: #7c3aed;
  --brand-indigo: #4f46e5;
  --header-h: 64px;
  --footer-h: 44px;
  /* Light theme */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --card-shadow-hover: 0 10px 25px rgba(0,0,0,0.1);
}
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #263148;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 10px 25px rgba(0,0,0,0.4);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--brand-purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Layout ── */
.erp-body { display: flex; min-height: 100vh; overflow-x: hidden; }

/* ── Sidebar ── */
.erp-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.erp-sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

/* Brand */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.brand-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-indigo));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
  flex-shrink: 0;
}
.brand-text { flex: 1; min-width: 0; }
.brand-name { display: block; color: #fff; font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-version { display: block; color: #475569; font-size: 0.72rem; }
.sidebar-toggle-btn { background: none; border: none; color: #64748b; cursor: pointer; padding: 4px; border-radius: 6px; transition: color 0.2s; }
.sidebar-toggle-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Entity Switcher */
.entity-switcher { padding: 12px 12px 8px; flex-shrink: 0; }
.entity-label { color: #475569; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; padding-left: 4px; }
.entity-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: #cbd5e1; padding: 8px 10px;
  font-size: 0.82rem; cursor: pointer; transition: all 0.2s;
  text-align: left;
}
.entity-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.15); }
.entity-btn.dropdown-toggle::after { margin-left: auto; }
.entity-badge { background: linear-gradient(135deg, var(--brand-purple), var(--brand-indigo)); color: #fff; border-radius: 6px; padding: 2px 7px; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.entity-badge-sm { background: rgba(124,58,237,0.2); color: #a78bfa; border-radius: 4px; padding: 1px 5px; font-size: 0.7rem; font-weight: 600; margin-right: 4px; }
.entity-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-menu { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 4px; }
.entity-menu .dropdown-item { color: #cbd5e1; border-radius: 7px; font-size: 0.82rem; padding: 7px 10px; }
.entity-menu .dropdown-item:hover, .entity-menu .dropdown-item.active { background: rgba(124,58,237,0.15); color: #fff; }

/* Navigation */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0 16px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.nav-group { margin-bottom: 4px; }
.nav-group-label { color: #475569; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; padding: 10px 20px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: #94a3b8;
  font-size: 0.85rem; font-weight: 500;
  transition: all 0.18s; cursor: pointer;
  border-left: 3px solid transparent;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: var(--nav-hover-bg); color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: var(--nav-active-bg); color: #a78bfa; border-left-color: var(--nav-active-border); }
.nav-item i { width: 16px; text-align: center; font-size: 0.88rem; flex-shrink: 0; }
.nav-item span { flex: 1; }
.badge-count { background: #ef4444; color: #fff; border-radius: 10px; padding: 1px 6px; font-size: 0.68rem; font-weight: 700; min-width: 18px; text-align: center; }

/* Sidebar Footer */
.sidebar-footer { padding: 12px; border-top: 1px solid var(--sidebar-border); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.user-avatar-placeholder { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-purple), var(--brand-indigo)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { color: #e2e8f0; font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #64748b; font-size: 0.72rem; }

/* ── Content Wrapper ── */
.erp-content-wrapper {
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh; width: calc(100% - var(--sidebar-w));
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1), width 0.3s;
}
.erp-content-wrapper.expanded { margin-left: 0; width: 100%; }

/* ── Header ── */
.erp-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.breadcrumb { font-size: 0.8rem; }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }
.header-btn { background: none; border: none; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; position: relative; transition: all 0.2s; }
.header-btn:hover { background: var(--bg); color: var(--text); }

/* Global Search */
.global-search { position: relative; width: 100%; max-width: 440px; }
.global-search input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px 8px 38px; font-size: 0.85rem; color: var(--text); outline: none; transition: all 0.2s; }
.global-search input:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.global-search input::placeholder { color: var(--text-light); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 0.82rem; pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--card-shadow-hover); max-height: 320px; overflow-y: auto; display: none; z-index: 200; }
.search-results.show { display: block; }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }
.search-result-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--brand-purple); font-size: 0.78rem; flex-shrink: 0; }
.search-result-text { flex: 1; min-width: 0; }
.search-result-title { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.search-result-sub { font-size: 0.75rem; color: var(--text-muted); }
.search-result-type { font-size: 0.7rem; color: var(--text-light); background: var(--bg); padding: 2px 7px; border-radius: 6px; flex-shrink: 0; }

/* Notifications */
.notif-badge { position: absolute; top: 4px; right: 4px; background: #ef4444; color: #fff; border-radius: 10px; padding: 0 5px; font-size: 0.65rem; font-weight: 700; min-width: 16px; text-align: center; line-height: 16px; }
.notif-dropdown { width: 340px; padding: 0; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--card-shadow-hover); background: var(--surface); }
.notif-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.notif-header h6 { margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--text); }
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(124,58,237,0.04); }
.notif-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 0.8rem; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--text-light); margin-top: 2px; }
.notif-footer { padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; }

/* User Menu */
.header-user-btn { background: none; border: none; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; cursor: pointer; transition: background 0.2s; color: var(--text); }
.header-user-btn:hover { background: var(--bg); }
.header-avatar { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.header-avatar-text { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-purple), var(--brand-indigo)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.85rem; }
.header-user-btn .dropdown-toggle::after { display: none; }

/* ── Main & Footer ── */
.erp-main { flex: 1; padding: 24px; }
.erp-footer { height: var(--footer-h); display: flex; align-items: center; padding: 0 24px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-muted); background: var(--surface); flex-shrink: 0; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--card-shadow); transition: box-shadow 0.2s; }
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-header h5, .card-header h6 { margin: 0; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface2); border-radius: 0 0 14px 14px; }

/* KPI Cards */
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--card-shadow); position: relative; overflow: hidden; }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.kpi-card.purple::before { background: linear-gradient(90deg, var(--brand-purple), var(--brand-indigo)); }
.kpi-card.green::before { background: linear-gradient(90deg, #10b981, #059669); }
.kpi-card.orange::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.kpi-card.red::before { background: linear-gradient(90deg, #ef4444, #dc2626); }
.kpi-card.blue::before { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: 14px; }
.kpi-icon.purple { background: rgba(124,58,237,0.12); color: var(--brand-purple); }
.kpi-icon.green { background: rgba(16,185,129,0.12); color: #10b981; }
.kpi-icon.orange { background: rgba(245,158,11,0.12); color: #f59e0b; }
.kpi-icon.red { background: rgba(239,68,68,0.12); color: #ef4444; }
.kpi-icon.blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.kpi-value { font-size: 1.55rem; font-weight: 800; color: var(--text); line-height: 1.1; margin-bottom: 4px; }
.kpi-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.kpi-change { font-size: 0.75rem; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.kpi-change.up { color: #10b981; }
.kpi-change.down { color: #ef4444; }

/* ── Tables ── */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--card-shadow); }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar-title { font-size: 0.9rem; font-weight: 700; color: var(--text); flex: 1; }
table.erp-table { width: 100%; border-collapse: collapse; }
table.erp-table thead th { background: var(--surface2); color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.erp-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 0.83rem; color: var(--text); vertical-align: middle; }
table.erp-table tbody tr:last-child td { border-bottom: none; }
table.erp-table tbody tr:hover td { background: rgba(124,58,237,0.03); }
table.erp-table tfoot td { padding: 10px 14px; font-size: 0.83rem; font-weight: 700; color: var(--text); background: var(--surface2); border-top: 2px solid var(--border); }

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 5px 10px; font-size: 0.82rem; }
.dataTables_wrapper .dataTables_length select { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 4px 8px; }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_length label { color: var(--text-muted); font-size: 0.78rem; }
.dataTables_wrapper .paginate_button { border-radius: 7px !important; font-size: 0.78rem !important; }
.dataTables_wrapper .paginate_button.current { background: var(--brand-purple) !important; border-color: var(--brand-purple) !important; color: #fff !important; }

/* ── Badges / Status ── */
.badge-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.badge-status.success { background: rgba(16,185,129,0.12); color: #10b981; }
.badge-status.success::before { background: #10b981; }
.badge-status.warning { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-status.warning::before { background: #f59e0b; }
.badge-status.danger { background: rgba(239,68,68,0.12); color: #ef4444; }
.badge-status.danger::before { background: #ef4444; }
.badge-status.info { background: rgba(59,130,246,0.12); color: #3b82f6; }
.badge-status.info::before { background: #3b82f6; }
.badge-status.secondary { background: var(--bg); color: var(--text-muted); }
.badge-status.secondary::before { background: var(--text-light); }
.badge-status.purple { background: rgba(124,58,237,0.12); color: var(--brand-purple); }
.badge-status.purple::before { background: var(--brand-purple); }

/* ── Buttons ── */
.btn-primary { background: linear-gradient(135deg, var(--brand-purple), var(--brand-indigo)); border: none; color: #fff; border-radius: 10px; font-weight: 600; font-size: 0.83rem; padding: 8px 16px; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { box-shadow: 0 4px 15px rgba(124,58,237,0.4); transform: translateY(-1px); color: #fff; }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font-weight: 500; font-size: 0.83rem; padding: 8px 16px; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-icon { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; cursor: pointer; border: none; transition: all 0.2s; }
.btn-icon.edit { background: rgba(59,130,246,0.1); color: #3b82f6; }
.btn-icon.edit:hover { background: #3b82f6; color: #fff; }
.btn-icon.delete { background: rgba(239,68,68,0.1); color: #ef4444; }
.btn-icon.delete:hover { background: #ef4444; color: #fff; }
.btn-icon.view { background: rgba(16,185,129,0.1); color: #10b981; }
.btn-icon.view:hover { background: #10b981; color: #fff; }
.btn-icon.pdf { background: rgba(245,158,11,0.1); color: #f59e0b; }
.btn-icon.pdf:hover { background: #f59e0b; color: #fff; }

/* ── Forms ── */
.erp-form-group { margin-bottom: 18px; }
.erp-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.erp-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; font-size: 0.85rem; color: var(--text); outline: none; transition: all 0.2s; }
.erp-input:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.erp-input::placeholder { color: var(--text-light); }
.erp-input[readonly] { opacity: 0.7; cursor: not-allowed; }
select.erp-input { cursor: pointer; }
textarea.erp-input { resize: vertical; min-height: 80px; }

/* Modal overrides */
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.modal-header { border-bottom: 1px solid var(--border); padding: 16px 20px; }
.modal-header .modal-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.modal-header .btn-close { filter: var(--text) brightness(0.5); }
.modal-body { padding: 20px; color: var(--text); }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }

/* ── Chart containers ── */
.chart-container { position: relative; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--card-shadow); padding: 20px; }
.chart-title { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 16px; }

/* ── Alerts ── */
.erp-alert { border-radius: 10px; padding: 12px 16px; font-size: 0.83rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.erp-alert i { margin-top: 1px; flex-shrink: 0; }
.erp-alert.success { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.erp-alert.warning { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.erp-alert.danger { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.erp-alert.info { background: rgba(59,130,246,0.1); color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }

/* ── Tabs ── */
.erp-tabs { display: flex; gap: 2px; background: var(--bg); border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.erp-tab { flex: 1; text-align: center; padding: 7px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s; color: var(--text-muted); border: none; background: none; }
.erp-tab.active { background: var(--surface); color: var(--brand-purple); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ── Progress ── */
.erp-progress { background: var(--bg); border-radius: 10px; height: 8px; overflow: hidden; }
.erp-progress-bar { height: 100%; border-radius: 10px; transition: width 0.6s ease; }
.erp-progress-bar.purple { background: linear-gradient(90deg, var(--brand-purple), var(--brand-indigo)); }
.erp-progress-bar.green { background: linear-gradient(90deg, #10b981, #059669); }
.erp-progress-bar.orange { background: linear-gradient(90deg, #f59e0b, #d97706); }
.erp-progress-bar.red { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* ── Misc ── */
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 1.3rem; font-weight: 800; color: var(--text); flex: 1; }
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.divider { border-top: 1px solid var(--border); margin: 20px 0; }
.text-purple { color: var(--brand-purple); }
.text-muted-erp { color: var(--text-muted); }
.fw-800 { font-weight: 800; }
.avatar-sm { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.avatar-placeholder { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--brand-purple), var(--brand-indigo)); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 0.8rem; }

/* Dropdown overrides */
.dropdown-menu { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--card-shadow-hover); padding: 4px; }
.dropdown-item { color: var(--text); border-radius: 8px; font-size: 0.83rem; padding: 7px 12px; }
.dropdown-item:hover { background: var(--bg); color: var(--text); }
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.08); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-header { color: var(--text-muted); font-size: 0.78rem; }

/* ── Loading Spinner ── */
.spinner-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9999; display: none; align-items: center; justify-content: center; }
.spinner-overlay.show { display: flex; }
.spinner-box { background: var(--surface); border-radius: 16px; padding: 32px; text-align: center; }
.spinner-box i { font-size: 2rem; color: var(--brand-purple); margin-bottom: 12px; display: block; }
.spinner-box p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -24px; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface); }
.timeline-dot.purple { background: var(--brand-purple); }
.timeline-dot.green { background: #10b981; }
.timeline-dot.orange { background: #f59e0b; }
.timeline-dot.red { background: #ef4444; }
.timeline-content { background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.timeline-date { font-size: 0.72rem; color: var(--text-light); }
.timeline-text { font-size: 0.82rem; color: var(--text); margin-top: 2px; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state i { font-size: 2.5rem; color: var(--text-light); margin-bottom: 12px; }
.empty-state h6 { color: var(--text); font-weight: 700; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 0.83rem; margin: 0; }

/* ── Responsive ── */
@media (max-width: 1199px) {
  .erp-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .erp-sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.4); }
  .erp-content-wrapper { margin-left: 0; width: 100%; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; display: none; }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 768px) {
  .erp-main { padding: 16px; }
  .page-header { gap: 8px; }
  .page-title { font-size: 1.1rem; }
  .global-search { max-width: 200px; }
  .kpi-value { font-size: 1.2rem; }
}
@media (max-width: 576px) {
  .erp-header { padding: 0 12px; gap: 8px; }
  .global-search { display: none; }
  .erp-main { padding: 12px; }
}

/* ── Print ── */
@media print {
  .erp-sidebar, .erp-header, .erp-footer, .table-toolbar button, .btn-icon, .modal { display: none !important; }
  .erp-content-wrapper { margin-left: 0 !important; }
  .erp-main { padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
