/* Pragya Go Ops — theme. Brand: yellow #FFC529, ink #121212. */
:root {
  --pg-yellow: #FFC529;
  --pg-ink: #121212;
  --pg-sidebar-w: 248px;
  --pg-surface: #ffffff;
  --pg-bg: #f5f6f8;
  --pg-border: #e7e9ee;
  --pg-text: #1d2430;
  --pg-muted: #6b7280;
}
[data-bs-theme="dark"] {
  --pg-surface: #161a22;
  --pg-bg: #0e1116;
  --pg-border: #262c38;
  --pg-text: #e6e9ef;
  --pg-muted: #9aa3b2;
}
body { background: var(--pg-bg); color: var(--pg-text); }

/* Shell layout */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { padding: 24px; flex: 1; }

/* Sidebar */
.sidebar {
  width: var(--pg-sidebar-w); background: var(--pg-ink); color: #cfd3da;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; transition: margin-left .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08); color: #fff;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--pg-yellow);
  color: var(--pg-ink); display: grid; place-items: center; font-size: 20px; font-weight: 800;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { color: var(--pg-yellow); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { color: #6b7280; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; padding: 14px 12px 6px; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: #cfd3da; font-size: 14px; font-weight: 500;
}
.sidebar .nav-link i { font-size: 17px; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--pg-yellow); color: var(--pg-ink); font-weight: 700; }
.app-shell.collapsed .sidebar { margin-left: calc(-1 * var(--pg-sidebar-w)); }

/* Header */
.app-header {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--pg-surface); border-bottom: 1px solid var(--pg-border); position: sticky; top: 0; z-index: 5;
}
.btn-icon { background: transparent; border: 1px solid var(--pg-border); border-radius: 9px; width: 38px; height: 38px; color: var(--pg-text); }
.header-search { position: relative; flex: 1; max-width: 460px; }
.header-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pg-muted); }
.header-search input { padding-left: 36px; border-radius: 10px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-menu { display: flex; align-items: center; gap: 10px; border: none; background: transparent; color: var(--pg-text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pg-yellow); color: var(--pg-ink); display: grid; place-items: center; font-weight: 800; }
.user-meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.user-meta small { color: var(--pg-muted); font-size: 11px; }

/* Cards / KPIs */
.card { background: var(--pg-surface); border: 1px solid var(--pg-border); border-radius: 14px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi .kpi-label { color: var(--pg-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.kpi .kpi-icon { float: right; font-size: 20px; color: var(--pg-yellow); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 22px; font-weight: 800; margin: 0; }
.table > :not(caption) > * > * { background: var(--pg-surface); color: var(--pg-text); }
.table thead th { color: var(--pg-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Responsive: sidebar becomes an off-canvas drawer */
@media (max-width: 992px) {
  .sidebar { position: fixed; z-index: 1040; margin-left: calc(-1 * var(--pg-sidebar-w)); }
  .app-shell.drawer-open .sidebar { margin-left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
}

/* Fallback styling for auto-generated (non-crispy) form widgets */
.app-content form input:not([type=checkbox]):not([type=radio]):not(.form-control),
.app-content form select:not(.form-select),
.app-content form textarea:not(.form-control) {
  display: block; width: 100%; padding: .5rem .75rem; font-size: .95rem;
  color: var(--pg-text); background: var(--pg-surface);
  border: 1px solid var(--pg-border); border-radius: .5rem;
}

/* Auth screens */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--pg-ink); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--pg-surface); border-radius: 18px; padding: 32px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { margin: 0 auto 10px; width: 48px; height: 48px; font-size: 26px; }
