* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #0f172a; color: #111827; }
a { color: inherit; text-decoration: none; }
.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0b1220, #111827); color: #e5e7eb; padding: 24px 18px; border-right: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand h1 { font-size: 20px; margin: 0; }
.brand p { margin: 3px 0 0; font-size: 13px; color: #94a3b8; }
.brand-mark { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-weight: 800; background: #2563eb; color: white; }
.nav { display: grid; gap: 8px; }
.nav a { padding: 12px 14px; border-radius: 12px; color: #d1d5db; font-weight: 600; }
.nav a:hover, .nav a.active { background: rgba(37, 99, 235, 0.18); color: white; }
.main { background: #f8fafc; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.topbar h2 { margin: 0 0 4px; font-size: 28px; }
.topbar p { margin: 0; color: #64748b; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 700; }
.button-primary { background: #2563eb; color: white; }
.button-secondary { background: white; color: #0f172a; border: 1px solid #dbe3f0; }
.button-danger { background: #b91c1c; color: white; }
.card { background: white; border: 1px solid #e2e8f0; border-radius: 18px; padding: 18px; box-shadow: 0 12px 30px rgba(15,23,42,.04); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 18px; border-radius: 18px; background: white; border: 1px solid #e2e8f0; }
.kpi h3 { margin: 0; font-size: 13px; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.kpi strong { display: block; font-size: 32px; margin-top: 10px; color: #0f172a; }
.kpi span { display: block; margin-top: 6px; color: #64748b; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: top; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #e5e7eb; color: #374151; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; color: #166534; border-color: #a7f3d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
form { margin: 0; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: #334155; }
.field small { color: #64748b; font-size: 12px; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
    width: 100%; border-radius: 12px; border: 1px solid #cbd5e1; padding: 11px 12px; background: #fff; font: inherit; color: #0f172a;
}
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"] { transform: scale(1.1); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.section-title { margin: 0 0 12px; font-size: 18px; color: #0f172a; }
.muted { color: #64748b; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.flex { display: flex; gap: 12px; align-items: center; }
.space-between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.details-card { border: 1px solid #e2e8f0; border-radius: 16px; background: white; }
.details-card summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 800; color: #0f172a; }
.details-card[open] summary { border-bottom: 1px solid #e2e8f0; }
.details-card .details-body { padding: 16px 18px 18px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #1d4ed8 0%, #0f172a 58%); }
.login-card { width: min(460px, 92vw); background: rgba(255,255,255,.96); border-radius: 24px; padding: 28px; box-shadow: 0 25px 60px rgba(2, 6, 23, .38); }
.login-card h1 { margin: 0 0 8px; }
.login-card p { color: #64748b; margin-top: 0; }
.tabs-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs-inline a { border-radius: 999px; padding: 9px 12px; background: white; border: 1px solid #dbe3f0; font-size: 13px; font-weight: 700; }
.tabs-inline a.active { background: #2563eb; color: white; border-color: #2563eb; }
.file-card, .note-card, .user-card { border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; background: #fff; }
.quick-cards { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-card { border-radius: 16px; padding: 14px; background: linear-gradient(180deg, #ffffff, #eff6ff); border: 1px solid #dbeafe; }
.quick-card h4 { margin: 0 0 6px; font-size: 14px; }
.quick-card p { margin: 0 0 8px; color: #475569; font-size: 13px; }
.kanban { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; }
.kanban-col { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 16px; padding: 12px; min-height: 180px; }
.kanban-col h4 { margin: 0 0 10px; font-size: 14px; }
.kanban-card { background: white; border: 1px solid #dbe3f0; border-radius: 14px; padding: 10px; margin-bottom: 10px; cursor: grab; }
.kanban-card strong { display: block; margin-bottom: 4px; font-size: 13px; }
.helper-list { display: grid; gap: 8px; padding-left: 18px; }
.portal-shell { max-width: 980px; margin: 0 auto; padding: 36px 18px; }
.portal-hero { background: white; border: 1px solid #e2e8f0; padding: 26px; border-radius: 20px; margin-bottom: 18px; }
.meta-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meta-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; }
.meta-item span { display: block; font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.hr { height: 1px; background: #e2e8f0; margin: 16px 0; }
@media (max-width: 1200px) {
    .grid-4, .quick-cards, .kanban, .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { padding-bottom: 8px; }
    .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .grid-3, .quick-cards, .meta-grid, .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; }
}

.pill-row { display:flex; gap:8px; flex-wrap:wrap; }
.pill { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; border:1px solid #dbe3f0; background:#fff; font-size:13px; font-weight:700; }
.actions-row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.button-link { color:#2563eb; font-weight:700; }
.rich-text { line-height:1.65; color:#0f172a; }
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 { margin:0 0 10px; }
.rich-text p { margin:0 0 12px; }
.rich-text ul { margin:0 0 14px 18px; }
.code-chip { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background:#eff6ff; color:#1d4ed8; border-radius:999px; padding:5px 10px; font-size:12px; }
.small-grid { display:grid; gap:12px; grid-template-columns:repeat(2, minmax(0, 1fr)); }
.definition-card { border:1px solid #e2e8f0; border-radius:16px; padding:14px; background:#fff; }
.definition-card h4 { margin:0 0 8px; font-size:15px; }
.definition-card p { margin:0 0 8px; color:#334155; font-size:14px; }
.help-text { color:#64748b; font-size:12px; }
.progress-strip { display:grid; gap:10px; grid-template-columns:repeat(3, minmax(0,1fr)); }
.progress-tile { border:1px solid #dbeafe; background:linear-gradient(180deg,#fff,#eff6ff); border-radius:16px; padding:14px; }
.progress-tile strong { display:block; font-size:28px; margin-top:8px; }
.proposal-card { border:1px solid #e2e8f0; border-radius:16px; padding:16px; background:#fff; }
.kicker { font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#64748b; font-weight:700; }
.step-card { border:1px solid #e2e8f0; border-radius:18px; padding:16px; background:#fff; }
.step-card h4 { margin:0 0 6px; }
.step-toolbar { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; flex-wrap:wrap; }
.tooltip-help { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:999px; background:#e0f2fe; color:#0369a1; font-size:12px; font-weight:800; cursor:help; }
.empty-state { padding:24px; border:1px dashed #cbd5e1; border-radius:16px; text-align:center; color:#64748b; background:#fff; }
.tight-table th, .tight-table td { padding:10px 8px; }
@media (max-width: 920px) {
    .small-grid, .progress-strip { grid-template-columns:1fr; }
}
.service-template-grid { display:grid; gap:12px; grid-template-columns:repeat(2, minmax(0,1fr)); }
.service-template-card { border:1px solid #dbe3f0; border-radius:16px; padding:14px; background:#fff; display:block; cursor:pointer; }
.service-template-card strong { display:block; margin-bottom:6px; }
@media (max-width: 920px) {
    .service-template-grid { grid-template-columns:1fr; }
}
