:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --ink: #1c1e2e;
  --muted: #6b7086;
  --line: #e6e8f2;
  --accent: #6d5cff;
  --accent-2: #9a6bff;
  --green: #22b573;
  --amber: #f5a623;
  --pink: #ef5da8;
  --danger: #e5484d;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(28, 30, 46, 0.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 250px; flex-shrink: 0;
  background: linear-gradient(180deg, #23243a 0%, #1a1b2c 100%);
  color: #e9eaf5; display: flex; flex-direction: column;
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff;
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 12px; color: #9a9db8; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 0; border-radius: 10px;
  background: transparent; color: #c6c8de; font-size: 14.5px; font-weight: 500;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 14px rgba(109,92,255,.4); }
.nav-item .ico { width: 20px; text-align: center; }
.sidebar-foot { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 6px 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #22b573, #6d5cff);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.user-name { font-size: 14px; font-weight: 600; }
.user-role { font-size: 12px; color: #9a9db8; }

/* Main */
.main { flex: 1; padding: 26px 34px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.topbar h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; flex: 1; }
.menu-btn { display: none; border: 0; background: var(--panel); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.pill { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); }

.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 16.5px; font-weight: 700; }
.card-head.row { margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.pad { padding: 12px 2px 0; }
.sr { position: absolute; left: -9999px; }

.hero {
  background: linear-gradient(120deg, #6d5cff 0%, #9a6bff 55%, #ef5da8 130%);
  color: #fff; margin-bottom: 22px;
}
.hero h2 { font-size: 24px; margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,.85); max-width: 520px; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn { border: 0; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .12s, box-shadow .12s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(109,92,255,.45); }
.hero .btn.primary { background: #fff; color: var(--accent); }
.btn.ghost { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.card .btn.ghost, .view .btn.ghost { background: #eef0fa; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.link { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13.5px; cursor: pointer; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; }
.stat-ico.indigo { background: #ece9ff; }
.stat-ico.green { background: #e2f7ec; }
.stat-ico.amber { background: #fdf1da; }
.stat-ico.pink { background: #fde6f1; }
.stat-num { font-size: 24px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Lists */
.doc-list, .event-list, .task-list { list-style: none; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; cursor: pointer; }
.doc-list li:hover, .doc-list li.active { background: #f2f3fb; }
.doc-list .doc-ico { width: 34px; height: 34px; border-radius: 9px; background: #ece9ff; display: grid; place-items: center; flex-shrink: 0; }
.doc-list .doc-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list .doc-date { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 14px 6px; }
.event-list li { display: flex; gap: 12px; padding: 10px 6px; align-items: baseline; }
.event-list .day-badge { background: #ece9ff; color: var(--accent); font-weight: 700; border-radius: 8px; padding: 4px 10px; font-size: 13px; flex-shrink: 0; }

/* Documents */
.doc-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.doc-editor { display: flex; flex-direction: column; min-height: 480px; }
.doc-title { border: 0; border-bottom: 1px solid var(--line); font-size: 20px; font-weight: 700; padding: 4px 0 12px; outline: none; }
#docBody { flex: 1; border: 0; outline: none; resize: vertical; min-height: 320px; font-size: 15px; line-height: 1.65; padding: 14px 0; font-family: inherit; }
.editor-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }

/* Sheets */
.sheet-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.sheet { border-collapse: collapse; width: 100%; min-width: 640px; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 0; }
.sheet th { background: #f4f5fb; font-size: 12px; color: var(--muted); padding: 6px 10px; font-weight: 600; }
.sheet td input { border: 0; outline: none; width: 100%; min-width: 90px; padding: 8px 10px; font-size: 14px; font-family: inherit; background: transparent; }
.sheet td input:focus { background: #eef0ff; box-shadow: inset 0 0 0 2px var(--accent); }
.sheet td.total input { font-weight: 700; background: #f8f9ff; color: var(--accent); }

/* Notes */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.note { border-radius: 14px; padding: 16px; min-height: 130px; box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column; }
.note textarea { border: 0; background: transparent; outline: none; resize: none; flex: 1; font-family: inherit; font-size: 14px; line-height: 1.5; color: inherit; }
.note .note-del { position: absolute; top: 10px; right: 10px; border: 0; background: rgba(0,0,0,.08); border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 13px; }
.note.c0 { background: #fff7d6; } .note.c1 { background: #e2f7ec; }
.note.c2 { background: #ece9ff; } .note.c3 { background: #fde6f1; }
.note.c4 { background: #e0f2fe; }

/* Tasks */
.progress { height: 8px; background: #eceef7; border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--accent)); border-radius: 999px; transition: width .3s; }
.task-form { display: flex; gap: 10px; margin-bottom: 14px; }
.task-form input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit; }
.task-form input:focus { border-color: var(--accent); }
.task-list li { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c9cddd; background: #fff; cursor: pointer; display: grid; place-items: center; color: #fff; font-size: 13px; flex-shrink: 0; }
.task-check.done { background: var(--green); border-color: var(--green); }
.task-text { flex: 1; font-size: 14.5px; }
.task-text.done { text-decoration: line-through; color: var(--muted); }
.task-del { border: 0; background: none; color: #c0c3d4; cursor: pointer; font-size: 16px; }
.task-del:hover { color: var(--danger); }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { margin-bottom: 6px; }
.cal-head div { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px; }
.cal-cell { min-height: 84px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; font-size: 12.5px; cursor: pointer; background: #fff; transition: border-color .15s; }
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.out { opacity: .35; background: #fafbfe; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(109,92,255,.25); }
.cal-cell .d { font-weight: 700; font-size: 13px; }
.cal-ev { margin-top: 4px; background: #ece9ff; color: var(--accent); border-radius: 6px; padding: 2px 6px; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: block; }
  .main { padding: 18px 16px 50px; }
  .two-col, .doc-layout { grid-template-columns: 1fr; }
}

/* BuildControl construction operations layer */
:root { --accent:#e67e22; --accent-2:#f1a14d; --green:#23845c; --danger:#c3403d; --ink:#17212b; --muted:#6c7782; --line:#dfe4e8; --bg:#edf0f2; --panel:#fff; }
body { background:linear-gradient(135deg,#eef1f3 0%,#f6f7f8 60%,#e8ecef 100%); color:var(--ink); }
h1,h2,h3,.brand-name { font-family:Inter,-apple-system,"Segoe UI",sans-serif; }
.sidebar { width:258px; background:linear-gradient(180deg,#18232c,#10191f); padding:25px 17px; box-shadow:10px 0 34px rgba(15,24,31,.12); }
.brand-mark { background:var(--accent); border-radius:5px; font-size:14px; letter-spacing:.08em; box-shadow:none; }
.brand-name { font-size:18px; letter-spacing:.01em; }
.brand-sub { color:#82929d; text-transform:uppercase; font-size:9px; letter-spacing:.12em; }
.nav-item { color:#aab6bd; border-radius:5px; }
.nav-item.active { background:#263640; box-shadow:inset 3px 0 var(--accent); color:white; }
.nav-item.active .ico { color:var(--accent); }
.avatar { background:var(--accent); border-radius:5px; }
.main { padding:25px 34px 60px; }
.topbar { margin-bottom:18px; }
.topbar h1 { font-size:25px; }
.card { border-radius:7px; border:1px solid #e0e5e8; box-shadow:0 5px 18px rgba(19,35,45,.065); backdrop-filter:none; }
.project-strip { display:flex; align-items:center; gap:18px; margin:-4px 0 18px; font-size:12px; color:var(--muted); }
.project-strip div { color:var(--green); font-size:9px; font-weight:800; letter-spacing:.11em; }
.project-strip strong { color:var(--ink); }
.project-strip span:last-child { margin-left:auto; padding:5px 10px; background:#fff; border:1px solid var(--line); border-radius:4px; }
.live-dot { display:inline-block; width:6px; height:6px; background:var(--green); border-radius:50%; margin-right:5px; }
.hero { min-height:235px; padding:31px 34px; background:linear-gradient(90deg,rgba(14,25,32,.98),rgba(20,38,47,.92) 55%,rgba(23,53,61,.76)),repeating-linear-gradient(135deg,transparent 0 24px,rgba(255,255,255,.025) 25px 26px); }
.hero h2 { font:700 34px/1.08 Inter,sans-serif; letter-spacing:-.04em; }
.hero p { color:#b7c5cb; }
.hero .btn.primary { background:var(--accent); color:#fff; }
.eyebrow { color:#f2a354; }
.hero-caption { color:#a8b7be; }
.status-dot { background:var(--green); box-shadow:0 0 0 4px rgba(35,132,92,.18); }
.stat-grid { grid-template-columns:repeat(4,1fr); }
.stat { align-items:flex-start; }
.stat-ico { border-radius:5px; font-size:11px; height:42px; width:42px; }
.stat-ico.indigo { background:#e9eef2; color:#425e70; }.stat-ico.green{background:#e2f1e9;color:var(--green)}.stat-ico.amber{background:#fff0df;color:#bd681c}.stat-ico.pink{background:#fae7e6;color:var(--danger)}
.stat-num { font-family:Inter,sans-serif; font-size:25px; }
.trend { display:block; margin-top:4px; font-size:10px; font-weight:600; }.trend.good{color:var(--green)}.trend.warn{color:#bd681c}.trend.bad{color:var(--danger)}
.dashboard-grid { display:grid; grid-template-columns:1.25fr .9fr; gap:16px; }
.activity-card { grid-column:1/-1; }
.zone-chart { display:grid; gap:14px; }
.zone-row { display:grid; grid-template-columns:42px 1fr 38px; align-items:center; gap:10px; font-size:12px; }
.zone-row>div { height:8px; background:#edf0f2; border-radius:2px; overflow:hidden; }.zone-row i{display:block;height:100%}.zone-row b{text-align:right;font-size:11px}.complete{background:var(--green)!important}.progressing{background:var(--accent)!important}.blocked{background:var(--danger)!important}
.chart-legend { display:flex; gap:18px; margin-top:18px; color:var(--muted); font-size:10px; }.chart-legend i{display:inline-block;width:7px;height:7px;margin-right:5px}
.count-badge { color:var(--danger); background:#fbe9e8; padding:4px 8px; border-radius:3px; font-size:10px; font-weight:700; }
.attention-list { display:grid; gap:8px; }.attention-list button{position:relative;text-align:left;border:1px solid var(--line);background:#fff;padding:10px 42px 10px 10px;cursor:pointer;border-radius:4px}.attention-list button:hover{border-color:var(--accent)}.attention-list strong,.attention-list small{display:block;margin-left:62px}.attention-list strong{font-size:12px}.attention-list small{color:var(--muted);font-size:10px;margin-top:3px}.attention-list b{position:absolute;right:11px;top:19px;color:var(--muted);font-size:10px}
.severity { float:left;width:54px;padding:4px 2px;text-align:center;font-size:8px;font-weight:800;border-radius:2px}.severity.critical{background:#f9dddd;color:#a52b28}.severity.high{background:#fff0df;color:#a55a17}.severity.medium{background:#e9eef2;color:#4d6573}
.sync-badge { color:var(--green); font-size:9px; font-weight:800; letter-spacing:.05em; }
.source-health { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }.source-health>div{display:flex;align-items:center;gap:10px;border:1px solid var(--line);padding:12px;border-radius:4px}.source-health p{flex:1}.source-health strong,.source-health small{display:block}.source-health strong{font-size:12px}.source-health small{color:var(--muted);font-size:9px;margin-top:3px}.source-health b{font-size:9px;color:var(--muted)}.file-icon{display:grid;place-items:center;width:27px;height:31px;background:#e2f1e9;color:var(--green);font-size:11px;font-weight:800;border-radius:2px}
.sheet-intro h2 { font-family:Inter,sans-serif; }.workbook-card{border-radius:7px}.sheet-badge{background:#e2f1e9;color:var(--green)}
.query-panel { display:none; align-items:center;gap:18px;padding:12px 22px;background:#16242c;color:#fff;border-bottom:1px solid #34454e}.query-panel.open{display:flex}.query-panel>div:first-child strong,.query-panel>div:first-child small{display:block}.query-panel small{color:#9aabb3;font-size:9px;margin-top:3px}.query-steps{display:flex;align-items:center;gap:8px;flex:1}.query-steps span{background:#263841;border:1px solid #40515a;padding:6px 8px;border-radius:3px;font-size:9px}.query-steps i{color:var(--accent)}
.sheet-tabs{background:#f4f6f7}.sheet-tab:hover,.sheet-tab.active{color:var(--green);border-bottom-color:var(--green)}.sheet th{background:#e9eff1;color:#4e606a}.sheet td input:focus{background:#fff8ed;box-shadow:inset 0 0 0 2px var(--green)}.sheet td.total input{background:#eef5f1;color:var(--green)}
@media(max-width:1050px){.stat-grid{grid-template-columns:repeat(2,1fr)}.source-health{grid-template-columns:1fr}.dashboard-grid{grid-template-columns:1fr}.activity-card{grid-column:auto}.query-steps{display:none}}
@media(max-width:600px){.stat-grid{grid-template-columns:1fr 1fr}.project-strip{flex-wrap:wrap}.project-strip span:last-child{margin-left:0}.hero{padding:25px 22px}.hero h2{font-size:28px}.workbook-actions{flex-wrap:wrap}.sheet-intro{align-items:flex-start;flex-direction:column}.integration-note{border-left:0;padding-left:0}.stat{padding:14px}.stat-ico{display:none}}
