:root { --ink:#1f2937; --muted:#657384; --navy:#263d57; --blue:#4a6f9e; --blue-dark:#35577f; --blue-soft:#edf3f8; --line:#d9e0e7; --surface:#fff; --canvas:#f3f5f7; --success:#2f7d5b; --warning:#a36312; --danger:#b5413c; }
* { box-sizing:border-box; }
html { background:var(--canvas); }
body { margin:0; background:var(--canvas); color:var(--ink); font-family:Arial,Helvetica,sans-serif; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
.app-shell { min-height:100vh; }
.topbar { position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; min-height:66px; padding:0 28px; color:#fff; background:var(--navy); box-shadow:0 1px 6px rgb(16 31 48 / 22%); }
.brand { display:flex; align-items:center; gap:13px; }
.brand-mark { display:grid; place-items:center; width:48px; height:48px; padding-top:2px; background:#5079aa; color:#fff; font-size:11px; font-weight:700; line-height:1.05; letter-spacing:.03em; text-align:center; }
.brand-title { font-size:17px; font-weight:700; }
.brand-subtitle { margin-top:2px; font-size:12px; color:#cad7e5; }
.user-box { display:flex; align-items:center; gap:10px; font-size:13px; }
.avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#55789c; font-weight:700; }
.layout { display:grid; grid-template-columns:224px minmax(0,1fr); min-height:calc(100vh - 66px); }
.sidebar { position:sticky; top:66px; align-self:start; height:calc(100vh - 66px); padding:22px 14px; background:#fff; border-right:1px solid var(--line); }
.project-label { padding:0 10px 7px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.project-select { width:100%; min-height:42px; padding:0 10px; border:1px solid var(--line); background:#fff; color:var(--ink); }
.nav { display:grid; gap:4px; margin-top:22px; }
.nav-button { display:flex; align-items:center; gap:11px; width:100%; padding:11px 12px; border:0; border-left:3px solid transparent; background:transparent; color:#455568; text-align:left; }
.nav-button:hover { background:#f4f7fa; }
.nav-button.active { border-left-color:var(--blue); background:var(--blue-soft); color:#294b70; font-weight:700; }
.nav-button svg { width:18px; height:18px; }
.content { min-width:0; padding:28px clamp(18px,3vw,42px) 60px; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
.page-head > div { min-width:0; }
.eyebrow { margin:0 0 5px; color:var(--blue); font-size:11px; font-weight:700; letter-spacing:.11em; text-transform:uppercase; }
h1 { margin:0; color:#24374a; font-size:clamp(25px,3vw,35px); font-weight:500; line-height:1.16; overflow-wrap:anywhere; }
.subtitle { margin:7px 0 0; color:var(--muted); font-size:14px; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:0 16px; border:1px solid var(--blue); background:var(--blue); color:#fff; font-weight:700; text-decoration:none; }
.button:hover { background:var(--blue-dark); }
.button.secondary { border-color:var(--line); background:#fff; color:#38516b; }
.button.warning { border-color:#d6a459; background:#fff7e7; color:#7b4b08; }
.button.small { min-height:32px; padding:0 10px; font-size:12px; }
.button svg { width:16px; height:16px; }
.kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.card { border:1px solid var(--line); background:var(--surface); box-shadow:0 1px 2px rgb(26 48 70 / 5%); }
.kpi { padding:18px 19px; border-top:4px solid #7895b6; }
.kpi-label { color:var(--muted); font-size:12px; }
.kpi-value { margin-top:8px; color:#24394d; font-size:25px; font-weight:700; letter-spacing:-.025em; }
.kpi-detail { margin-top:7px; color:var(--muted); font-size:11px; }
.grid-2 { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(290px,.8fr); gap:16px; margin-top:16px; }
.panel { padding:20px; }
.panel-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:18px; }
.panel-title h2 { margin:0; color:#2b4054; font-size:17px; font-weight:700; }
.panel-title span { color:var(--muted); font-size:12px; }
.progress-track { height:9px; overflow:hidden; background:#e5ebf0; }
.progress-fill { height:100%; background:#557ca8; }
.budget-row { display:grid; grid-template-columns:minmax(120px,1fr) 130px 54px; gap:12px; align-items:center; margin:13px 0; }
.budget-name { overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.budget-amount { color:#506073; font-size:11px; text-align:right; }
.stage-list { display:grid; gap:14px; }
.stage-top { display:flex; justify-content:space-between; gap:12px; margin-bottom:7px; font-size:12px; }
.stage-top strong { color:#33485d; }
.alert { display:flex; align-items:flex-start; gap:12px; margin-top:16px; padding:13px 14px; border-left:4px solid #d39b43; background:#fff8e8; color:#6e501d; font-size:13px; }
.table-wrap { overflow:auto; border:1px solid var(--line); background:#fff; }
table { width:100%; border-collapse:collapse; font-size:12px; }
th { position:sticky; top:0; z-index:1; padding:11px 12px; background:#e9eef3; color:#394f65; font-size:11px; letter-spacing:.02em; text-align:left; white-space:nowrap; }
td { padding:11px 12px; border-top:1px solid #e5e9ed; vertical-align:top; }
tbody tr:hover { background:#fafcfd; }
.money { font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; }
.toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.search { min-width:min(330px,100%); min-height:40px; padding:0 12px; border:1px solid var(--line); background:#fff; }
.badge { display:inline-flex; align-items:center; min-height:24px; padding:2px 8px; border-radius:999px; background:#edf1f4; color:#4a5a69; font-size:10px; font-weight:700; white-space:nowrap; }
.badge.warning { background:#fff1d4; color:#865711; }
.badge.success { background:#e5f4ec; color:#27674a; }
.badge.danger { background:#fbe9e7; color:#98403a; }
.modal-backdrop { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:18px; background:rgb(18 31 45 / 56%); }
.modal { width:min(720px,100%); max-height:calc(100vh - 36px); overflow:auto; padding:24px; background:#fff; box-shadow:0 18px 55px rgb(0 0 0 / 25%); }
.modal h2 { margin:0; color:#2c4054; font-size:22px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:20px; }
.field { display:grid; gap:6px; }
.field.full { grid-column:1 / -1; }
.field label { color:#4f6072; font-size:11px; font-weight:700; text-transform:uppercase; }
.field input,.field select,.field textarea { width:100%; min-height:42px; padding:9px 10px; border:1px solid #cfd8e1; background:#fff; color:var(--ink); }
.field textarea { min-height:82px; resize:vertical; }
.form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.empty { padding:46px 20px; color:var(--muted); text-align:center; }
.report-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.report-card { padding:24px; }
.report-card h3 { margin:12px 0 6px; color:#2d4358; }
.report-card p { min-height:40px; margin:0 0 18px; color:var(--muted); font-size:13px; line-height:1.5; }
.stage-editor { display:grid; grid-template-columns:minmax(180px,1fr) minmax(180px,2fr) 54px; gap:14px; align-items:center; padding:14px 0; border-top:1px solid var(--line); }
.stage-editor input[type="range"] { width:100%; accent-color:var(--blue); }
.update-form { margin-top:18px; padding-top:18px; border-top:1px solid var(--line); }
.notice { padding:12px 14px; border:1px solid #bfd0e1; background:#f1f6fa; color:#365a79; font-size:13px; }
.loading { display:grid; place-items:center; min-height:60vh; color:var(--muted); }
.spinner { width:32px; height:32px; margin:0 auto 12px; border:3px solid #dce4eb; border-top-color:var(--blue); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width:1050px) { .kpis { grid-template-columns:repeat(2,1fr); } .grid-2 { grid-template-columns:1fr; } }
@media (max-width:760px) {
  .topbar { padding:0 14px; } .brand-subtitle,.user-name { display:none; } .layout { display:block; }
  .sidebar { position:sticky; top:66px; z-index:20; width:100%; height:auto; padding:10px 12px; border-right:0; border-bottom:1px solid var(--line); }
  .project-label { display:none; } .project-select { margin-bottom:8px; } .nav { display:flex; gap:5px; margin:0; overflow-x:auto; }
  .nav-button { width:auto; min-width:max-content; padding:9px 10px; border-left:0; border-bottom:3px solid transparent; }
  .nav-button.active { border-bottom-color:var(--blue); } .content { padding:20px 14px 46px; }
  .page-head { align-items:stretch; flex-direction:column; overflow:hidden; } .page-head h1 { width:100%; max-width:calc(100vw - 28px); white-space:normal; }
  .content { overflow:hidden; } .kpis,.report-grid { grid-template-columns:1fr; }
  .kpi-value { font-size:22px; } .form-grid { grid-template-columns:1fr; } .field.full { grid-column:auto; }
  .stage-editor { grid-template-columns:1fr; gap:7px; }
}

.hidden { display:none !important; }
.auth-view { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(145deg,#eef3f7,#f7f8f9); }
.auth-card { width:min(470px,100%); padding:30px; border:1px solid var(--line); background:#fff; box-shadow:0 18px 50px rgb(36 55 74 / 14%); }
.auth-brand { margin-bottom:28px; color:#263d57; }
.auth-brand .brand-subtitle { color:var(--muted); }
.form-grid.one { grid-template-columns:1fr; }
.form-grid label { display:grid; gap:6px; color:#4f6072; font-size:11px; font-weight:700; text-transform:uppercase; }
.form-grid input,.form-grid select,.form-grid textarea { width:100%; min-height:42px; padding:9px 10px; border:1px solid #cfd8e1; background:#fff; color:var(--ink); font-weight:400; text-transform:none; }
.form-grid textarea { min-height:82px; resize:vertical; }
.link-button { border:0; background:transparent; color:#fff; text-decoration:underline; }
dialog { width:min(720px,calc(100% - 28px)); max-height:calc(100vh - 28px); padding:24px; border:0; color:var(--ink); box-shadow:0 18px 55px rgb(0 0 0 / 28%); }
dialog::backdrop { background:rgb(18 31 45 / 58%); }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.dialog-head h2 { margin:0; color:#2c4054; }
.icon-button { display:grid; place-items:center; width:36px; height:36px; border:1px solid var(--line); background:#fff; color:#40556a; font-size:24px; }
.full { grid-column:1 / -1; }
.section-actions { display:flex; flex-wrap:wrap; gap:10px; }
.photo-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.photo-card { padding:14px; border:1px solid var(--line); background:#fff; }
.photo-card img { width:100%; aspect-ratio:16/10; object-fit:cover; background:#e8edf2; }
.danger-text { color:var(--danger); }
@media(max-width:760px){ .auth-card{padding:22px} dialog{padding:18px}.photo-grid{grid-template-columns:1fr}.full{grid-column:auto} }
