/* G-SOFT ERP - stili kryesor (Bootstrap 5.3 + tema light/dark) */
:root {
  --app-font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --app-primary: #2f6fed;
  --app-primary-rgb: 47, 111, 237;
  --app-accent: #f5b301;
  --app-bg: #f4f6fb;
  --app-surface: #ffffff;
  --app-border: #e4e8f0;
  --app-muted: #6b7489;
  --app-sidebar-bg: #111a2e;
  --app-sidebar-fg: #aab4c8;
  --app-sidebar-active: #ffffff;
  --app-sidebar-hover: rgba(255, 255, 255, .06);
  --app-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .05);
  --sidebar-w: 256px;
}
[data-bs-theme="dark"] {
  --app-bg: #0d1220;
  --app-surface: #151c2e;
  --app-border: #252f47;
  --app-muted: #8d98b0;
  --app-sidebar-bg: #0a0f1b;
  --app-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --bs-body-bg: #0d1220;
  --bs-tertiary-bg: #1a2236;
}

html, body { height: 100%; }
body {
  font-family: var(--app-font);
  background: var(--app-bg);
  font-size: .9rem;
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: var(--app-primary-rgb);
  --bs-link-color-rgb: var(--app-primary-rgb);
}
.btn-primary {
  --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: #245ad0; --bs-btn-hover-border-color: #245ad0;
  --bs-btn-active-bg: #1f4fb8; --bs-btn-active-border-color: #1f4fb8;
}
.form-control:focus, .form-select:focus { border-color: rgba(var(--app-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--app-sidebar-bg); color: var(--app-sidebar-fg);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; color: #fff; text-decoration: none; font-size: 1.1rem; letter-spacing: .02em; }
.brand-icon { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; }
.brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.brand-text strong { color: var(--app-accent); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64708a; padding: 1rem .75rem .35rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 8px;
  color: var(--app-sidebar-fg); text-decoration: none; font-weight: 500; margin-bottom: 2px;
}
.sidebar .nav-link i { width: 18px; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { background: var(--app-sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: rgba(var(--app-primary-rgb), .9); color: var(--app-sidebar-active); box-shadow: 0 4px 12px rgba(var(--app-primary-rgb), .35); }
.sidebar .nav-link.disabled { opacity: .45; cursor: default; }
.badge-soon { margin-left: auto; font-size: .62rem; padding: .1rem .4rem; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.sidebar-footer { padding: .75rem 1.25rem; color: #4f5a72; border-top: 1px solid rgba(255, 255, 255, .05); }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.5rem; background: color-mix(in srgb, var(--app-surface) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--app-border);
}
.page-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.content { padding: 1.5rem; }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--app-border); background: var(--app-surface); color: inherit; }
.btn-icon:hover { background: var(--bs-tertiary-bg); }
[data-bs-theme="dark"] .theme-icon-dark, [data-bs-theme="light"] .theme-icon-light { display: none; }
.user-chip { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--app-border); border-radius: 999px; padding: .2rem .75rem .2rem .2rem; background: var(--app-surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--app-primary-rgb), .15); color: var(--app-primary); font-weight: 600; font-size: .75rem; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}

/* ---------- Komponentë ---------- */
.card { border: 1px solid var(--app-border); border-radius: 14px; background: var(--app-surface); box-shadow: var(--app-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--app-border); padding: .9rem 1.15rem; font-weight: 600; }
.card-body { padding: 1.15rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.toolbar .form-select, .toolbar .form-control { width: auto; min-width: 160px; }

.stat-card { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.15rem; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-label { color: var(--app-muted); font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--app-muted); font-size: .78rem; }
.tone-blue { background: rgba(47, 111, 237, .12); color: #2f6fed; }
.tone-green { background: rgba(18, 183, 106, .12); color: #12b76a; }
.tone-amber { background: rgba(245, 179, 1, .15); color: #c98f00; }
.tone-red { background: rgba(240, 68, 56, .12); color: #f04438; }
.tone-violet { background: rgba(122, 90, 248, .12); color: #7a5af8; }
.tone-slate { background: rgba(100, 116, 139, .14); color: #64748b; }

.chart-box { position: relative; height: 280px; }
.empty-state { text-align: center; color: var(--app-muted); padding: 2.5rem 1rem; }
.empty-state i { font-size: 2rem; opacity: .4; margin-bottom: .5rem; display: block; }

.money, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-muted-2 { color: var(--app-muted) !important; }
.badge-soft { font-weight: 500; padding: .35em .6em; border-radius: 6px; }
.badge-soft.success { background: rgba(18, 183, 106, .14); color: #0e9f5a; }
.badge-soft.danger { background: rgba(240, 68, 56, .13); color: #d92d20; }
.badge-soft.warning { background: rgba(245, 179, 1, .18); color: #a77700; }
.badge-soft.info { background: rgba(47, 111, 237, .13); color: #2f6fed; }
.badge-soft.secondary { background: rgba(100, 116, 139, .15); color: #64748b; }

/* Tabelat */
table.dataTable { font-size: .86rem; }
table.dataTable thead th { font-weight: 600; color: var(--app-muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; border-bottom-width: 1px !important; }
table.dataTable td { vertical-align: middle; }
.table > :not(caption) > * > * { background-color: transparent; }
.table-hover > tbody > tr:hover > * { background-color: rgba(var(--app-primary-rgb), .04); }
div.dt-container .dt-search input { min-width: 220px; }
.actions { white-space: nowrap; text-align: right; }
.actions .btn { padding: .2rem .5rem; }

.modal-content { border-radius: 16px; border: 1px solid var(--app-border); }
.modal-header, .modal-footer { border-color: var(--app-border); }
.form-label { font-weight: 500; font-size: .82rem; margin-bottom: .3rem; }
.form-text { font-size: .75rem; }
.required::after { content: ' *'; color: #f04438; }

.price-input { max-width: 140px; text-align: right; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.perm-module { border: 1px solid var(--app-border); border-radius: 12px; padding: .75rem 1rem; }
.perm-module h6 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--app-muted); }

.json-diff { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; max-width: 420px; white-space: pre-wrap; word-break: break-word; }

/* Login */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(1200px 600px at 10% -10%, rgba(var(--app-primary-rgb), .18), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(245, 179, 1, .16), transparent 60%), var(--app-bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 2rem; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; background: linear-gradient(135deg, var(--app-accent), #ff8a00); color: #1b1b1b; margin: 0 auto 1rem; }
.auth-logo-img { width: 72px; height: 72px; background: none; }
.auth-logo-img img { width: 100%; height: 100%; object-fit: contain; }
