/* PanchamiHub ERP v2 — application styles.
   The pentagonal-prism brand idea shows up as the clipped "chip" shape and the
   per-subsidiary accent variable (--accent) set by the layout. */

:root {
  --ink: #1a1a2e;
  --accent: #6366f1;
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bs-body-bg); }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--ink);
  color: #cbd2e0;
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 1040;
  transition: transform .2s ease;
}
.sidebar-brand { padding: 18px 20px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-word { font-weight: 800; letter-spacing: .18em; color: #fff; font-size: 1.05rem; }
.brand-dot { color: var(--accent); }
.brand-sub { color: #7c8499; letter-spacing: .25em; font-size: .62rem; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 12px;
  color: #b6bdcf; text-decoration: none;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 2px;
  font-size: .92rem;
}
.sidebar-nav .nav-item i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-item.active {
  background: linear-gradient(90deg, var(--accent), transparent 140%);
  color: #fff;
}
.sidebar-foot {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px; font-size: .8rem; color: #9aa2b5;
}
.company-chip {
  --chip: var(--accent);
  background: var(--chip); color: #fff; font-weight: 700; font-size: .68rem;
  padding: 4px 8px; letter-spacing: .06em;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); /* pentagonal prism nod */
  min-width: 38px; text-align: center;
}

.main-col { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  position: sticky; top: 0; z-index: 1030;
}
.company-switch {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; border: 1px solid var(--bs-border-color); border-radius: 10px;
  background: var(--bs-body-bg); font-size: .9rem;
}
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dropdown-item .dot { margin-right: 6px; }

.search-form { position: relative; width: min(380px, 34vw); }
.search-form i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); }
.search-form input { padding-left: 36px; border-radius: 10px; }

.btn-icon { border: none; background: transparent; color: var(--bs-body-color); padding: 6px 10px; border-radius: 10px; }
.btn-icon:hover { background: var(--bs-secondary-bg); }
.notif-dot {
  position: absolute; top: 2px; right: 2px;
  background: #ef4444; color: #fff; font-size: .6rem; font-weight: 700;
  border-radius: 999px; padding: 1px 5px;
}

.content { padding: 22px; flex: 1; }

/* ---------- Cards, stats ---------- */
.stat-card { border: none; border-radius: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.stat-card .icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); font-size: 1.2rem;
}
.stat-card h3 { font-weight: 700; margin: 0; }
.card { border-radius: 14px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h4 { margin: 0; font-weight: 700; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.92); color: #fff; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--bs-secondary-color); }
.empty-state i { font-size: 2.4rem; opacity: .6; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(60% 80% at 80% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent),
    var(--ink);
  padding: 24px;
}
.auth-card { max-width: 420px; margin: 0 auto; border: none; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }

/* ---------- Tables ---------- */
.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); }

/* ---------- Kanban (used by CRM/projects modules) ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { min-width: 265px; width: 265px; background: var(--bs-secondary-bg); border-radius: 14px; padding: 10px; }
.kanban-col h6 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 4px 6px; display:flex; justify-content: space-between; }
.kanban-card { background: var(--bs-body-bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(16,24,40,.1); cursor: grab; }
.kanban-card.dragging { opacity: .5; }
.kanban-col.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-col { margin-left: 0; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; display: none; }
  .sidebar-backdrop.show { display: block; }
  .content { padding: 14px; }
}

/* Dark-mode fine tuning */
[data-bs-theme="dark"] .topbar { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .kanban-card { box-shadow: 0 1px 2px rgba(0,0,0,.5); }

@media print {
  .sidebar, .topbar { display: none !important; }
  .main-col { margin: 0; }
}
