:root {
  --dash-bg: #07090d;
  --dash-panel: rgba(255,255,255,0.06);
  --dash-border: rgba(255,255,255,0.12);
  --dash-text: rgba(255,255,255,0.92);
  --dash-muted: rgba(255,255,255,0.62);
  --dash-accent: #7aa2ff;
  --dash-sidebar: 240px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(122,162,255,0.18), transparent 60%),
    radial-gradient(700px 520px at 80% 0%, rgba(68,211,126,0.12), transparent 60%),
    var(--dash-bg);
  color: var(--dash-text);
}

a { color: inherit; text-decoration: none; }

.dash-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
#trial-banner.active + .dash-layout {
  height: calc(100vh - 48px);
}

/* ===== TRIAL BANNER ===== */
#trial-banner { display: none; }
#trial-banner.active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(122,162,255,0.18), rgba(68,211,126,0.10));
  border-bottom: 1px solid var(--dash-border);
  font-size: 13px;
}
.trial-close {
  background: none; border: none; color: var(--dash-muted);
  cursor: pointer; font-size: 18px; padding: 0 4px; line-height: 1;
}
.trial-cta {
  background: var(--dash-accent); color: #fff;
  border: none; border-radius: 8px; padding: 6px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}

/* ===== SIDEBAR ===== */
.dash-sidebar {
  width: var(--dash-sidebar);
  min-width: var(--dash-sidebar);
  background: rgba(0,0,0,0.32);
  border-right: 1px solid var(--dash-border);
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--dash-border);
  margin-bottom: 8px;
}

.sidebar-brand img { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-brandText { font-weight: 700; font-size: 14px; }
.sidebar-brandMeta { font-size: 11px; color: var(--dash-muted); }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--dash-muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.sidebar-item:hover {
  background: var(--dash-panel);
  color: var(--dash-text);
}
.sidebar-item.active {
  background: rgba(122,162,255,0.14);
  color: var(--dash-accent);
  font-weight: 600;
}
.sidebar-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--dash-border);
  font-size: 11px;
  color: var(--dash-muted);
}

/* ===== MAIN CONTENT ===== */
.dash-main {
  flex: 1;
  padding: 28px 24px;
  overflow-y: auto;
}

/* ===== PRODUCT GRID ===== */
.dash-grid-header { margin-bottom: 20px; }
.dash-grid-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.dash-grid-header p { color: var(--dash-muted); font-size: 14px; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; min-width: unset; flex-direction: row; overflow-x: auto; padding: 10px 14px; }
  .sidebar-brand { border-bottom: none; margin-bottom: 0; padding: 4px 8px; }
  .sidebar-footer { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-card {
  background: var(--dash-panel);
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  padding: 16px;
  transition: transform 0.14s, border-color 0.14s;
  cursor: pointer;
}
.dash-card:hover {
  transform: translateY(-2px);
  border-color: rgba(122,162,255,0.4);
}
.dash-cardTitle {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-cardBody {
  color: var(--dash-muted);
  font-size: 13px;
  line-height: 1.5;
}
.dash-cardTag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(122,162,255,0.12);
  color: var(--dash-accent);
  margin-top: 8px;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  max-width: 400px;
  margin: 0 auto;
  padding-top: 40px;
}
.auth-page h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-page p {
  color: var(--dash-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.auth-field {
  margin-bottom: 16px;
}
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--dash-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--dash-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.14s;
}
.auth-field input:focus {
  border-color: var(--dash-accent);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(122,162,255,0.42), rgba(122,162,255,0.16));
  border: 1px solid rgba(122,162,255,0.45);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.14s;
}
.auth-btn:hover { opacity: 0.88; }
.auth-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}
.auth-status.error { display: block; background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.auth-status.success { display: block; background: rgba(34,197,94,0.12); color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
.auth-status.info { display: block; background: rgba(122,162,255,0.12); color: #b3d0ff; border: 1px solid rgba(122,162,255,0.2); }

.auth-alt {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--dash-muted);
}
.auth-alt a {
  color: var(--dash-accent);
  font-weight: 600;
}
.auth-alt a:hover { text-decoration: underline; }

/* ===== ACCOUNT PAGE ===== */
.account-page { max-width: 600px; margin: 0 auto; padding-top: 20px; }
.account-page h1 { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
.acc-card {
  background: var(--dash-panel);
  border: 1px solid var(--dash-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.acc-cardLabel { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dash-muted); margin-bottom: 4px; }
.acc-cardValue { font-size: 14px; font-weight: 600; }
.acc-cardRow { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.acc-cardRow + .acc-cardRow { border-top: 1px solid var(--dash-border); }

/* ===== PREFERENCES ===== */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.pref-row + .pref-row { border-top: 1px solid var(--dash-border); }
.pref-label { font-size: 13px; font-weight: 500; }

/* Toggle switch */
.pref-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.pref-toggle input { display: none; }
.pref-slider {
  width: 40px; height: 22px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
}
.pref-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.pref-toggle input:checked + .pref-slider { background: var(--dash-accent); }
.pref-toggle input:checked + .pref-slider::before { transform: translateX(18px); }
.pref-toggleText { font-size: 12px; color: var(--dash-muted); min-width: 36px; }

/* Size buttons */
.pref-sizeGroup { display: flex; gap: 4px; }
.pref-sizeBtn {
  padding: 5px 11px;
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  background: transparent;
  color: var(--dash-text);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}
.pref-sizeBtn:hover { background: var(--dash-panel); }
.pref-sizeBtn.active {
  background: var(--dash-accent);
  border-color: var(--dash-accent);
  color: #fff;
}

/* Color theme buttons */
.pref-colorGroup { display: flex; gap: 6px; }
.pref-colorBtn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.14s;
}
.pref-colorBtn:hover { transform: scale(1.15); }
.pref-colorBtn.active { border-color: var(--dash-text); transform: scale(1.15); }


/* ===== MUHASEBE / FINANS ACCOUNTING MODULE ===== */
.acc-tree { border: 1px solid var(--dash-border); border-radius: 8px; }
.acc-tree-group { border-bottom: 1px solid var(--dash-border); }
.acc-tree-group-header { padding: 8px 12px; background: var(--dash-panel); cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.acc-tree-item { padding: 6px 12px 6px 24px; display: flex; justify-content: space-between; font-size: 12px; }
.acc-tree-item:hover { background: var(--dash-panel); }
.journal-entry-row:hover { background: var(--dash-panel); }
.entry-line { font-size: 0.85em; padding: 2px 0 2px 24px; color: var(--dash-muted); }
.status-badge { padding: 2px 8px; border-radius: 12px; font-size: 0.75em; font-weight: 600; display: inline-block; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-overdue { background: #fee2e2; color: #991b1b; }
.status-draft { background: #f3f4f6; color: #4b5563; }
.status-sent { background: #dbeafe; color: #1e40af; }
.status-cancelled { background: #e5e7eb; color: #6b7280; }
.kpi-card { background: var(--dash-panel); border: 1px solid var(--dash-border); border-radius: 10px; padding: 14px; }
.kpi-label { font-size: 11px; color: var(--dash-muted); margin-bottom: 4px; }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--dash-text1); }
.acc-input:focus { border-color: var(--dash-accent); outline: none; }
.acc-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.acc-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }
.acc-modal-content { position: relative; }
.acc-quick-btn { padding: 8px 16px; border: 1px solid var(--dash-border); border-radius: 8px; background: var(--dash-panel); color: var(--dash-text); cursor: pointer; font-size: 12px; transition: all .14s; }
.acc-quick-btn:hover { background: var(--dash-accent); color: #fff; border-color: var(--dash-accent); }
.bank-card { transition: all .14s; }
.bank-card:hover { border-color: var(--dash-accent) !important; transform: translateY(-1px); }

/* BOSS CORE Modules - 200-09 */
.boss-module-container { max-width: 100%; }
.boss-profile-header { display: flex; gap: 16px; align-items: center; padding: 24px; background: var(--dash-panel); border: 1px solid var(--dash-border); border-radius: 12px; margin-bottom: 20px; }
.boss-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--dash-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.boss-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.boss-detail-row { display: flex; flex-direction: column; }
.boss-detail-label { font-size: 0.8em; color: var(--dash-muted); }
.boss-detail-value { font-weight: 500; }
.boss-alert-item { padding: 8px 12px; border-radius: 6px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.boss-alert-critical { background: #fef2f2; border-left: 3px solid #ef4444; }
.boss-alert-warning { background: #fffbeb; border-left: 3px solid #eab308; }
.boss-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.boss-tab-bar { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--dash-border); }
.boss-tab { padding: 8px 14px; border: none; background: none; color: var(--dash-muted); cursor: pointer; font-size: 12px; border-bottom: 2px solid transparent; font-weight: 500; }
.boss-tab.active { color: var(--dash-accent); border-bottom-color: var(--dash-accent); }

/* CRM Module - 200-10 */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-column { min-width: 220px; max-width: 280px; background: var(--dash-bg2); border-radius: 8px; padding: 8px; }
.kanban-header { display: flex; justify-content: space-between; padding: 4px 8px; font-weight: 600; }
.kanban-cards { display: flex; flex-direction: column; gap: 4px; }
.kanban-card { background: var(--dash-panel); border-radius: 6px; padding: 8px; cursor: grab; border: 1px solid var(--dash-border); }
.kanban-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.kanban-card-title { font-weight: 500; font-size: 0.9em; }
.kanban-card-value { font-size: 0.85em; color: var(--dash-muted); }
.activity-feed { max-height: 400px; overflow-y: auto; }
.activity-item { padding: 8px 0; border-bottom: 1px solid var(--dash-border); font-size: 0.9em; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--dash-bg2); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 12px; background: var(--dash-bg2); font-size: 0.75em; margin: 1px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid label { font-size: 0.8em; color: var(--dash-muted); display: block; }
.timeline-item { display: flex; gap: 8px; padding: 8px 0; border-left: 2px solid var(--dash-border); padding-left: 12px; margin-left: 4px; }
.crm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.crm-header h2 { font-size: 18px; margin: 0; }

/* Logistics & Stock Module - 200-15 */
.warehouse-card { background: var(--dash-panel); border-radius: 8px; padding: 16px; border: 1px solid var(--dash-border); cursor: pointer; }
.warehouse-card:hover { border-color: var(--dash-accent); }
.stock-level-bar { height: 6px; border-radius: 3px; background: var(--dash-bg2); margin: 4px 0; }
.stock-level-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.stock-critical .stock-level-fill { background: #ef4444; width: 25%; }
.stock-low .stock-level-fill { background: #eab308; width: 50%; }
.stock-ok .stock-level-fill { background: #22c55e; width: 75%; }
.stock-overstock .stock-level-fill { background: #3b82f6; width: 100%; }
.shipment-timeline { margin: 16px 0; }
.shipment-step { display: flex; gap: 12px; padding: 8px 0; color: var(--dash-muted); }
.shipment-step.done { color: var(--dash-text); }

/* ── E-Commerce Styles ── */
.order-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.8em; font-weight: 500; text-transform: capitalize; }
.status-new { background: #dbeafe; color: #1d4ed8; }
.status-confirmed { background: #e0f2fe; color: #0369a1; }
.status-processing { background: #fef3c7; color: #b45309; }
.status-shipped { background: #d1fae5; color: #047857; }
.status-delivered { background: #bbf7d0; color: #166534; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.stock-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 0.85em; }
.stock-ok { background: #d1fae5; color: #047857; }
.stock-low { background: #fee2e2; color: #dc2626; }
.ecommerce-detail-grid .detail-card { background: var(--dash-panel); }
.ecommerce-detail-grid .detail-card h4 { color: var(--dash-muted); margin: 0 0 8px 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.ecommerce-detail-grid .detail-card p { margin: 2px 0; font-size: 14px; }
.ecommerce-detail-grid .detail-card pre { font-size: 12px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; margin: 0; background: var(--dash-bg2); padding: 8px; border-radius: 4px; }
.ecommerce-notification { animation: ecomFadeIn 0.3s; }
@keyframes ecomFadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.stat-card { transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* BOSS CARI — aging bar */
.aging-bar { height: 24px; border-radius: 4px; display: flex; }
.aging-segment { height: 100%; transition: width 0.3s; }
.aging-0-30 { background: #22c55e; }
.aging-31-60 { background: #eab308; }
.aging-61-90 { background: #f97316; }
.aging-90 { background: #ef4444; }

/* BOSS FATURA — invoice timeline */
.invoice-timeline { border-left: 2px solid var(--dash-border); padding-left: 16px; }
.invoice-timeline-item { position: relative; padding: 8px 0; }
.invoice-timeline-item::before { content: ''; position: absolute; left: -21px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--dash-accent); }

/* BOSS CARI — statement */
.statement-header { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.statement-table td:last-child, .statement-table td:nth-last-child(2) { text-align: right; font-variant-numeric: tabular-nums; }

/* BOSS FATURA — line items */
.line-item-row { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr 1fr; gap: 8px; align-items: center; }
