:root {
  --bg: #f4f6fb;
  --panel: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --dark: #111827;
  --side: #111827;
  --side2: #1f2937;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: linear-gradient(180deg, var(--side), var(--side2)); color: white; padding: 18px 14px; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 8px 8px 22px; }
.brand-icon { width: 42px; height: 42px; border-radius: 12px; background: #fff; color: #111827; display: grid; place-items: center; font-weight: 900; font-size: 22px; }
.brand-title { font-size: 18px; font-weight: 800; }
.brand-sub { color: #cbd5e1; font-size: 12px; margin-top: 2px; }
.sidebar-group { margin: 16px 0; }
.sidebar-group-title { color: #94a3b8; font-size: 12px; padding: 0 10px 8px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 10px; margin: 3px 0; background: transparent; color: #e5e7eb; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: white; }
.nav-item b { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12px; text-align: center; }
.main { margin-left: 250px; min-height: 100vh; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
h1 { margin: 0; font-size: 26px; }
.topbar p { margin: 7px 0 0; color: var(--muted); }
.top-actions { display: flex; gap: 8px; }
.pill, .badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.success { background: #dcfce7; color: #166534; }
.neutral { background: #e5e7eb; color: #374151; }
.warning { background: #fef3c7; color: #92400e; }
.danger-b { background: #fee2e2; color: #991b1b; }
.info { background: #dbeafe; color: #1d4ed8; }
.page { display: none; }
.page.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card, .panel, .tenant-card, .list-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 34px; margin: 7px 0 4px; }
.stat-card small { color: var(--muted); }
.content-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.content-grid.aside { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.panel { overflow: hidden; }
.panel-head { min-height: 58px; display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.panel-head b { color: var(--muted); font-size: 13px; }
.primary, .danger { border: 0; border-radius: 10px; padding: 9px 13px; font-weight: 800; cursor: pointer; }
.primary { background: var(--blue); color: white; }
.danger { background: #fee2e2; color: #991b1b; }
.wide { width: calc(100% - 32px); margin: 16px; }
.risk-list { padding: 10px 18px 18px; }
.risk-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.risk-item:last-child { border-bottom: 0; }
.risk-item strong { display: block; margin-bottom: 3px; }
.risk-item p { margin: 0; color: var(--muted); font-size: 13px; }
.flow-list { margin: 0; padding: 14px 20px 18px 42px; color: #374151; }
.flow-list li { margin: 9px 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; text-align: left; font-size: 13px; white-space: nowrap; }
th { background: #f8fafc; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.list-card { padding: 18px; }
.list-card h3 { margin: 0 0 8px; }
.list-card p { margin: 0 0 14px; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row span { background: #f1f5f9; border-radius: 999px; padding: 5px 9px; font-size: 12px; color: #475569; }
.assignment-grid { padding: 16px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.assignment-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfdff; }
.assignment-card h3 { margin: 0 0 6px; }
.assignment-card .meter { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 12px 0; }
.assignment-card .meter span { display: block; height: 100%; background: var(--blue); }
.setting-row { display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f1f5f9; }
.sticky-panel { align-self: start; position: sticky; top: 18px; }
.job-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; padding: 16px; }
.job-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfdff; }
.job-box strong { display: block; font-size: 24px; margin-top: 4px; }
.tenant-card { padding: 18px; margin: 16px; }
.tenant-card h3 { margin: 0 0 8px; }
.tenant-card p { color: var(--muted); }
.muted { background: #fafafa; }
@media (max-width: 1100px) { .stats-grid, .content-grid.two, .cards, .assignment-grid { grid-template-columns: 1fr 1fr; } .content-grid.aside { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .sidebar { position: static; width: auto; } .main { margin-left: 0; } .stats-grid, .content-grid.two, .cards, .assignment-grid, .job-summary { grid-template-columns: 1fr; } .topbar { flex-direction: column; gap: 12px; } }

.project-grid { padding: 16px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.project-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; min-height: 190px; }
.project-card h3 { margin: 0 0 8px; display:flex; justify-content:space-between; gap:8px; }
.project-card p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 8px 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project-meta { display:flex; flex-wrap:wrap; gap:6px; }
.project-meta span { background:#f1f5f9; color:#475569; border-radius:999px; padding:4px 8px; font-size:12px; }
.source-admin { background:#dbeafe !important; color:#1d4ed8 !important; }
.source-user { background:#dcfce7 !important; color:#166534 !important; }
@media (max-width: 1100px) { .project-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .project-grid { grid-template-columns: 1fr; } }

.form-box { padding: 16px; display:flex; flex-direction:column; gap:8px; }
.form-box label { font-size:12px; color:var(--muted); font-weight:800; margin-top:6px; }
.form-box input, .form-box select { width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 11px; font-size:13px; background:#fff; }
.form-result { color:var(--muted); font-size:12px; line-height:1.4; min-height:18px; padding:0 16px 12px; white-space:pre-wrap; }
