:root {
  --ink: #161a1d;
  --muted: #687078;
  --line: #e2e5e7;
  --soft: #f2f4f4;
  --paper: #fbfbf8;
  --white: #ffffff;
  --accent: #e23b2e;
  --accent-dark: #b92820;
  --amber: #e8a11a;
  --green: #238263;
  --blue: #2a64b7;
  --sidebar: #16191c;
  --sidebar-soft: #24282c;
  --shadow: 0 18px 48px rgba(21, 25, 29, 0.09);
  --radius: 18px;
  font-family: Inter, "Segoe UI", "Noto Sans", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(226, 59, 46, 0.25);
  outline-offset: 2px;
}

.eyebrow { margin: 0 0 10px; color: rgba(255,255,255,.58); font-size: 11px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow.dark { color: #838a90; }
.muted { color: var(--muted); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: white; font-weight: 900; box-shadow: inset -8px -8px 18px rgba(0,0,0,.12); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.login-partners { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 14px; }
.partner-logo-card { margin: 0; display: grid; gap: 8px; }
.partner-logo-surface { height: 62px; padding: 10px 14px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.partner-logo-card.installer .partner-logo-surface { width: 224px; background: white; }
.partner-logo-card.manufacturer .partner-logo-surface { width: 150px; background: #30353a; }
.partner-logo-surface img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.partner-logo-card figcaption { color: rgba(255,255,255,.58); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 1.12fr) minmax(420px, .88fr); background: var(--white); }
.login-brand { position: relative; overflow: hidden; padding: clamp(44px, 7vw, 96px); display: flex; flex-direction: column; justify-content: space-between; color: white; background:
  linear-gradient(135deg, rgba(22,25,28,.97), rgba(22,25,28,.84)),
  repeating-linear-gradient(90deg, transparent 0 78px, rgba(255,255,255,.05) 78px 79px),
  repeating-linear-gradient(0deg, transparent 0 78px, rgba(255,255,255,.04) 78px 79px);
}
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -230px; top: -120px; box-shadow: 0 0 0 74px rgba(255,255,255,.025), 0 0 0 148px rgba(255,255,255,.018); }
.login-brand h1 { position: relative; max-width: 650px; margin: 18px 0; font-size: clamp(42px, 6vw, 76px); line-height: .98; letter-spacing: -.045em; }
.login-intro { max-width: 560px; color: rgba(255,255,255,.67); font-size: 19px; line-height: 1.6; }
.login-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; position: relative; z-index: 1; }
.login-stats div { padding-top: 18px; border-top: 1px solid rgba(255,255,255,.19); display: flex; flex-direction: column; gap: 6px; }
.login-stats strong { font-size: 30px; }
.login-stats span { color: rgba(255,255,255,.58); font-size: 13px; }
.login-panel { position: relative; padding: clamp(40px, 7vw, 100px); display: flex; flex-direction: column; justify-content: center; }
.login-panel h2 { margin: 0 0 12px; font-size: 32px; letter-spacing: -.03em; }
.language-row { position: absolute; right: 34px; top: 30px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.select { appearance: none; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687078' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; padding: 10px 34px 10px 12px; color: var(--ink); }
.select.compact { padding-top: 8px; padding-bottom: 8px; }
.login-options { display: grid; gap: 12px; margin-top: 32px; }
.role-card { width: 100%; border: 1px solid var(--line); border-radius: 15px; padding: 18px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 15px; text-align: left; color: var(--ink); background: white; transition: border-color .2s, transform .2s, box-shadow .2s; }
.role-card:hover { transform: translateY(-2px); border-color: #c7cbce; box-shadow: var(--shadow); }
.role-card strong, .role-card small { display: block; }
.role-card small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.role-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--ink); font-size: 12px; font-weight: 800; }
.role-icon.client { color: var(--blue); background: #eaf1fb; }
.security-note { display: grid; grid-template-columns: 25px 1fr; gap: 10px; margin-top: 24px; padding: 14px; border-radius: 12px; background: #fff8e8; color: #70500d; font-size: 12px; line-height: 1.5; }
.security-note span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #d7b66b; border-radius: 50%; font-weight: 800; }
.security-note p { margin: 1px 0 0; }
.secure-login-form { display: grid; gap: 15px; margin-top: 28px; }
.secure-login-form .field { display: grid; gap: 7px; }
.secure-login-form .input { min-height: 46px; }
.login-submit { width: 100%; min-height: 46px; margin-top: 4px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 9px; color: #8e1c22; background: #fdebec; font-size: 12px; line-height: 1.45; }
.secure-note { background: #edf7f2; color: #17674e; }
.secure-note span { border-color: #77ad99; }
.invitation-banner { align-items: end; background: #edf7f2; color: #17674e; }
.invitation-url { width: min(720px, 100%); margin-top: 10px; color: var(--ink); background: white; }
.invitation-banner .button { white-space: nowrap; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; background: var(--sidebar); color: white; z-index: 20; }
.sidebar-brand { padding: 0 8px 16px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-logo-surface { height: 42px; padding: 7px 9px; display: grid; place-items: center; border-radius: 10px; background: white; }
.sidebar-logo-surface img { display: block; width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-brand > div { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { letter-spacing: .12em; font-size: 12px; }
.sidebar-brand small { max-width: 135px; color: rgba(255,255,255,.5); font-size: 8px; line-height: 1.25; text-align: right; }
.main-nav { min-height: 0; flex: 1 1 auto; display: grid; align-content: start; gap: 4px; overflow-y: auto; padding-top: 12px; }
.nav-button { width: 100%; border: 0; border-radius: 11px; padding: 11px 12px; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; text-align: left; color: rgba(255,255,255,.62); background: transparent; }
.nav-button:hover { color: white; background: rgba(255,255,255,.055); }
.nav-button.active { color: white; background: var(--sidebar-soft); box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { font-size: 16px; opacity: .9; }
.nav-badge { min-width: 22px; padding: 2px 6px; border-radius: 99px; background: rgba(255,255,255,.09); font-size: 10px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.manufacturer-card { margin-bottom: 14px; padding: 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; background: rgba(255,255,255,.035); }
.manufacturer-card > small { display: block; color: rgba(255,255,255,.45); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.manufacturer-card > span { height: 34px; margin-top: 7px; display: grid; place-items: center; }
.manufacturer-card img { display: block; max-width: 120px; max-height: 32px; object-fit: contain; }
.project-chip { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; }
.project-chip > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #3a3f44; font-size: 11px; font-weight: 800; }
.project-chip small, .project-chip strong { display: block; }
.project-chip small { color: rgba(255,255,255,.43); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.project-chip strong { margin-top: 3px; font-size: 12px; }
.text-button { margin-top: 16px; border: 0; padding: 7px 0; color: rgba(255,255,255,.48); background: transparent; font-size: 12px; }
.text-button:hover { color: white; }

.main-content { min-width: 0; }
.topbar { height: 88px; padding: 0 32px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(251,251,248,.94); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 4px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.language-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--ink); background: white; }
.notification-button { position: relative; }
.notification-button span { position: absolute; right: 8px; top: 5px; color: var(--accent); font-size: 8px; }
.menu-button { display: none; }
.user-pill { display: flex; align-items: center; gap: 9px; padding-left: 5px; }
.user-pill > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--ink); font-size: 10px; font-weight: 800; }
.user-pill strong, .user-pill small { display: block; white-space: nowrap; }
.user-pill strong { font-size: 12px; }
.user-pill small { color: var(--muted); font-size: 10px; margin-top: 2px; }

.page { max-width: 1600px; margin: 0 auto; padding: 28px 32px 54px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-heading h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.button { border: 0; border-radius: 10px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.button:disabled { opacity: .45; cursor: not-allowed; }

.reconcile-banner { margin-bottom: 20px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #edd59c; border-radius: 13px; background: #fff9eb; color: #66480f; font-size: 13px; }
.reconcile-banner strong { color: #493207; }
.reconcile-banner .banner-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; background: #f4e2b6; font-weight: 800; }
.client-banner { border-color: #bfd1eb; background: #f1f6fd; color: #24496f; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 138px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); color: var(--ink); }
.metric-value { margin: 20px 0 6px; font-size: 31px; line-height: 1; font-weight: 780; letter-spacing: -.04em; }
.metric-foot { color: var(--muted); font-size: 11px; }
.metric-foot.warning { color: #96660c; }
.metric-progress { height: 5px; margin-top: 16px; border-radius: 99px; overflow: hidden; background: #ecefee; }
.metric-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 1px 0 rgba(0,0,0,.02); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-header { min-height: 62px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-title { margin: 0; font-size: 15px; }
.panel-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.panel-body { padding: 18px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--soft); }
.segmented button { border: 0; border-radius: 7px; padding: 6px 10px; color: var(--muted); background: transparent; font-size: 11px; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.schedule-view-control { display: flex; align-items: center; gap: 10px; }
.schedule-view-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.schedule-view-tabs { padding: 4px; border: 1px solid var(--line); background: #f4f5f3; }
.schedule-view-tabs button { min-height: 36px; padding: 8px 13px; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 750; }
.schedule-view-tabs button.active { color: white; background: var(--ink); box-shadow: none; }

.filters { padding: 13px 18px; display: flex; flex-wrap: wrap; gap: 9px; border-bottom: 1px solid var(--line); background: #fdfdfb; }
.search { flex: 1 1 230px; min-width: 180px; position: relative; }
.search input, .input, .textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: var(--ink); background: white; }
.search input { padding-left: 34px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 8px; color: var(--muted); }
.filters .select { min-width: 125px; }

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 11px 14px; text-align: left; color: #747b81; background: #fafbf9; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #edf0f0; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .15s; }
.data-table tbody tr:hover { background: #fafaf7; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.unit-name { font-weight: 720; color: #22272b; }
.subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 7px; color: #475057; background: #eff1f1; font-size: 10px; font-weight: 750; }
.tag.type-dm1 { color: #355987; background: #eaf1fa; }
.status { display: inline-flex; align-items: center; gap: 6px; color: #596168; font-size: 11px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #bbc1c4; }
.status.assembly::before, .status.in_progress::before { background: var(--amber); }
.status.electrical::before { background: var(--blue); }
.status.commissioning::before, .status.commissioned::before, .status.complete::before { background: var(--green); }
.mini-progress { min-width: 105px; display: grid; grid-template-columns: 1fr 30px; gap: 8px; align-items: center; }
.mini-progress > span:first-child { height: 5px; border-radius: 99px; overflow: hidden; background: #e8ebeb; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.mini-progress b { font-size: 10px; text-align: right; }

.building-bars { display: grid; gap: 16px; }
.building-row { display: grid; grid-template-columns: 31px 1fr 34px; gap: 10px; align-items: center; font-size: 11px; }
.building-row > span:first-child { font-weight: 800; }
.building-track { height: 8px; border-radius: 99px; background: #ecefee; overflow: hidden; }
.building-track i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.building-row b { text-align: right; }
.empty-state { padding: 30px 18px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 42px; height: 42px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--ink); }
.empty-state strong { display: block; color: var(--ink); font-size: 13px; }
.empty-state p { max-width: 350px; margin: 7px auto 0; font-size: 11px; line-height: 1.5; }
.activity-list { display: grid; gap: 0; }
.activity-item { padding: 13px 0; display: grid; grid-template-columns: 9px 1fr; gap: 12px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--accent); }
.activity-item p { margin: 0; font-size: 11px; line-height: 1.45; }
.activity-item time { color: var(--muted); font-size: 9px; }

.unit-dialog { width: min(920px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 34px 90px rgba(0,0,0,.25); }
.unit-dialog::backdrop { background: rgba(10,13,15,.55); backdrop-filter: blur(4px); }
.dialog-header { padding: 22px 24px 18px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 4px 0 3px; font-size: 24px; letter-spacing: -.03em; }
.dialog-header p { margin: 0; color: var(--muted); font-size: 12px; }
.dialog-close { flex: 0 0 auto; }
.dialog-content { padding: 22px 24px 28px; overflow: auto; }
.unit-summary { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center; margin-bottom: 24px; }
.progress-ring { --progress: 0deg; width: 132px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) var(--progress), #edf0ef 0); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: white; }
.progress-ring span { position: relative; z-index: 1; font-size: 25px; font-weight: 800; }
.unit-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.fact { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fcfcfa; }
.fact small, .fact strong { display: block; }
.fact small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.fact strong { margin-top: 5px; font-size: 12px; }
.dimension-panel { padding: 18px; border: 1px solid #d9e5e0; border-radius: 15px; background: linear-gradient(145deg, #f8fbfa, #fff); }
.dimension-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dimension-heading h3 { margin: 0; font-size: 14px; }
.dimension-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.dimension-heading > span { padding: 5px 8px; border-radius: 999px; color: #48655a; background: #eaf4f0; font-size: 9px; white-space: nowrap; }
.dimension-summary { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dimension-stat { padding: 10px 11px; border-radius: 10px; background: white; box-shadow: inset 0 0 0 1px rgba(23,103,78,.09); }
.dimension-stat small, .dimension-stat strong { display: block; }
.dimension-stat small { color: var(--muted); font-size: 9px; }
.dimension-stat strong { margin-top: 4px; font-size: 13px; }
.dimension-stat strong span, .dimension-sections strong span { color: var(--muted); font-size: 9px; font-weight: 650; }
.dimension-section-title { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; }
.dimension-section-title strong { font-size: 11px; }
.dimension-section-title small { color: var(--muted); font-size: 9px; }
.dimension-sections { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dimension-sections article { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.7); }
.dimension-sections small, .dimension-sections strong { display: block; }
.dimension-sections small { color: var(--muted); font-size: 9px; }
.dimension-sections strong { margin-top: 4px; font-size: 11px; }
.section-title { margin: 24px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.milestone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.milestone-card { border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: white; }
.milestone-card button { width: 100%; margin-top: 13px; border: 0; border-radius: 9px; padding: 9px; color: #5f666c; background: var(--soft); font-size: 11px; font-weight: 700; }
.milestone-card button.in_progress { color: #7e5508; background: #fff2cf; }
.milestone-card button.complete { color: #17674e; background: #e2f3ec; }
.milestone-card button:disabled { cursor: default; opacity: 1; }
.milestone-top { display: flex; justify-content: space-between; gap: 8px; }
.milestone-top strong { font-size: 12px; }
.milestone-top span { color: var(--muted); font-size: 10px; }
.milestone-dates { margin-top: 11px; padding-top: 10px; display: grid; gap: 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.milestone-dates b { color: var(--ink); font-weight: 700; }
.milestone-dates em { margin-top: 3px; color: #a72b24; font-style: normal; font-weight: 800; }
.detail-tabs { margin-top: 24px; display: flex; gap: 5px; border-bottom: 1px solid var(--line); overflow: auto; }
.detail-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
.detail-tabs button.active { color: var(--ink); border-color: var(--accent); font-weight: 750; }
.detail-placeholder { min-height: 120px; padding: 22px; display: grid; place-items: center; text-align: center; color: var(--muted); background: #fafbf9; border-radius: 0 0 13px 13px; font-size: 12px; }
.detail-placeholder.with-content { display: block; padding: 18px; text-align: left; color: var(--ink); }
.attachment-panel-inner { display: grid; gap: 16px; }
.unit-upload-form { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; align-items: end; border: 1px solid var(--line); border-radius: 12px; background: white; }
.unit-upload-form .inline-check { align-self: center; }
.attachment-list { display: grid; gap: 9px; }
.attachment-card { padding: 12px; display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: start; border: 1px solid var(--line); border-radius: 11px; background: white; }
.attachment-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--accent-dark); background: #edf7f3; font-size: 16px; }
.attachment-card strong, .attachment-card small { display: block; }
.attachment-card strong { margin-bottom: 4px; font-size: 12px; }
.attachment-card small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.simple-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.textarea { min-height: 86px; resize: vertical; }
.inline-check { display: flex; grid-template-columns: none; align-items: center; gap: 8px; }
.inline-check input { margin: 0; }
.inline-check span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.file-input { padding: 7px; font-size: 11px; }
.file-input::file-selector-button { margin-right: 10px; border: 0; border-radius: 7px; padding: 6px 9px; color: var(--ink); background: var(--soft); font-weight: 700; }
.documents-layout { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(0, 1.55fr); gap: 18px; align-items: start; }
.documents-layout .panel + .panel { margin-top: 0; }
.metadata-note { margin: 15px 0 0; padding: 11px 12px; border-radius: 9px; color: #5d666b; background: var(--soft); font-size: 10px; line-height: 1.5; }
.upload-table tbody tr, .audit-table tbody tr { cursor: default; }
.audit-banner { border-color: #bfd1eb; background: #f1f6fd; color: #24496f; }
.audit-action { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: #17674e; background: #e2f3ec; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.permission-table td:not(:first-child), .permission-table th:not(:first-child) { text-align: center; }
.check { color: var(--green); font-weight: 900; }
.dash { color: #b2b7ba; }
.user-metrics { margin-bottom: 18px; }
.user-management-grid { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.7fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.user-directory { overflow: visible; }
.enroll-card { border-bottom: 1px solid var(--line); background: #fafbf9; }
.enroll-card summary { padding: 13px 18px; display: flex; align-items: center; gap: 8px; color: var(--accent-dark); font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; }
.enroll-card summary::-webkit-details-marker { display: none; }
.enroll-card summary span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--accent); font-size: 15px; }
.compact-form { padding: 4px 18px 18px; }
.user-list { max-height: 725px; overflow: auto; padding: 8px; }
.user-list-item { width: 100%; padding: 11px 10px; border: 1px solid transparent; border-radius: 11px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 10px; gap: 10px; align-items: center; color: var(--ink); background: transparent; text-align: left; }
.user-list-item:hover { background: #f7f8f5; }
.user-list-item.active { border-color: #c9ddd7; background: #f0f7f4; }
.person-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--ink); font-size: 10px; font-weight: 850; letter-spacing: .03em; }
.person-avatar.large { width: 52px; height: 52px; border-radius: 14px; font-size: 13px; }
.person-copy { min-width: 0; }
.person-copy strong, .person-copy small, .person-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-copy strong { font-size: 12px; }
.person-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.person-copy em { margin-top: 4px; color: #65706d; font-size: 9px; font-style: normal; }
.account-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8bec0; }
.account-dot.active { background: var(--green); }
.account-dot.pending { background: var(--amber); }
.account-dot.disabled { background: #a9afb2; }
.user-editor-head { padding: 20px; display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.user-editor-head h3 { margin: 2px 0 4px; font-size: 18px; }
.user-editor-head p { margin: 0; color: var(--muted); font-size: 11px; }
.account-status { padding: 6px 9px; border-radius: 8px; color: #5a6267; background: #edf0f0; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.account-status.active { color: #17674e; background: #e2f3ec; }
.account-status.pending { color: #7e5508; background: #fff2cf; }
.profile-grid { padding: 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; border-bottom: 1px solid var(--line); }
.profile-actions { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.template-strip { padding: 14px 20px; display: grid; grid-template-columns: minmax(170px,1fr) minmax(180px,240px) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); background: #fafbf9; }
.template-strip strong, .template-strip small { display: block; }
.template-strip strong { font-size: 11px; }
.template-strip small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.permission-heading { padding: 19px 20px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.permission-heading h3 { margin: 0 0 4px; font-size: 14px; }
.permission-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.individual-permissions tbody tr { cursor: default; }
.individual-permissions td { padding-top: 9px; padding-bottom: 9px; }
.permission-option { min-width: 82px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); background: white; font-size: 10px; font-weight: 700; }
.permission-option span { width: 7px; height: 7px; border: 1px solid #aab1b3; border-radius: 50%; background: white; }
.permission-option:hover { border-color: #aeb8b5; color: var(--ink); }
.permission-option.active { border-color: #a6c8bd; color: #17674e; background: #edf7f3; }
.permission-option.active span { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 2px #edf7f3; }
.permission-note { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.55; }
.schedule-table { min-width: 1120px; }
.schedule-table tbody tr { cursor: default; }
.schedule-table tbody tr.schedule-overdue { background: #fff8f6; }
.schedule-table tbody tr.schedule-overdue:hover { background: #fff3f0; }
.compact-button { padding: 7px 9px; font-size: 10px; white-space: nowrap; }
.delay-badge { display: inline-flex; max-width: 150px; padding: 5px 7px; border-radius: 7px; color: #7e5508; background: #fff2cf; font-size: 9px; font-weight: 800; line-height: 1.25; }
.delay-badge.overdue { color: #94251f; background: #fde8e5; }
.overdue-list { display: grid; gap: 0; }
.overdue-item { padding: 10px 0; display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.overdue-item:last-child { border-bottom: 0; }
.overdue-item strong, .overdue-item small { display: block; }
.overdue-item strong { font-size: 10px; }
.overdue-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.overdue-item > span { align-self: center; color: #94251f; font-size: 9px; font-weight: 800; white-space: nowrap; }
.empty-state.compact { padding: 10px 4px; }
.gantt-legend { padding: 12px 18px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.gantt-legend span { width: 18px; height: 5px; margin-left: 10px; border-radius: 99px; }
.gantt-legend span:first-child { margin-left: 0; }
.baseline-dot { background: #9aa2a7; }
.forecast-dot { background: var(--blue); }
.actual-dot { background: var(--green); }
.gantt-scroll { width: 100%; max-height: 650px; overflow: auto; overscroll-behavior: contain; }
.gantt-wrap { min-width: 900px; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 220px minmax(620px, 1fr); }
.gantt-head { position: sticky; top: 0; z-index: 2; min-height: 50px; border-bottom: 1px solid var(--line); background: #fafbf9; }
.gantt-head > strong { padding: 17px 16px; color: #747b81; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.gantt-head > div { position: relative; border-left: 1px solid var(--line); }
.gantt-head span { position: absolute; top: 17px; transform: translateX(-50%); color: var(--muted); font-size: 9px; white-space: nowrap; }
.gantt-row { min-height: 54px; border-bottom: 1px solid #edf0f0; }
.gantt-row > div:first-child { padding: 11px 16px; }
.gantt-row > div:first-child strong, .gantt-row > div:first-child small { display: block; }
.gantt-row > div:first-child strong { font-size: 10px; }
.gantt-row > div:first-child small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.gantt-row.overdue > div:first-child { box-shadow: inset 3px 0 0 var(--accent); background: #fff8f6; }
.gantt-track { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), #eef0ef calc(12.5% - 1px) 12.5%); }
.gantt-bar { position: absolute; height: 7px; min-width: 4px; border-radius: 99px; }
.gantt-bar.baseline { top: 10px; background: #9aa2a7; }
.gantt-bar.forecast { top: 23px; background: var(--blue); }
.gantt-bar.actual { top: 36px; background: var(--green); }
.schedule-edit-form { display: grid; gap: 18px; }
.schedule-edit-form section { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fafbf9; }
.schedule-edit-form section h3 { margin: 0 0 12px; font-size: 13px; }
.schedule-meta-fields { padding-top: 2px; }
.schedule-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.schedule-dialog-actions .muted { font-size: 10px; }
.coming-card { padding: 32px; border: 1px dashed #cbd0d2; border-radius: 16px; background: #fafbf9; text-align: center; }
.coming-card h3 { margin: 10px 0 8px; }
.coming-card p { max-width: 560px; margin: 0 auto; color: var(--muted); line-height: 1.6; font-size: 13px; }

.quality-metrics { margin-bottom: 18px; }
.quality-view-tabs { width: max-content; margin: 0 0 18px; }
.quality-view-tabs button { min-width: 150px; }
.quality-view-tabs button span { margin-left: 6px; opacity: .68; }
.quality-create { margin: 0 0 18px; overflow: hidden; }
.quality-create summary { padding: 15px 18px; display: flex; align-items: center; gap: 9px; color: var(--accent-dark); font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; }
.quality-create summary::-webkit-details-marker { display: none; }
.quality-create summary span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--accent); font-size: 15px; }
.quality-create[open] summary { border-bottom: 1px solid var(--line); background: #fafbf9; }
.quality-table { min-width: 900px; }
.quality-table tbody tr { cursor: pointer; }
.severity { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: #5e656a; background: #edf0f0; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.severity.high { color: #8a4e09; background: #fff0d4; }
.severity.critical { color: #94251f; background: #fde8e5; }
.status.quality-waiting { color: #7e5508; background: #fff2cf; }
.status.quality-critical { color: #94251f; background: #fde8e5; }
.quality-dialog { display: grid; gap: 18px; }
.record-facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.record-facts .fact { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.record-facts small, .record-facts strong { display: block; }
.record-facts small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.record-facts strong { margin-top: 6px; font-size: 11px; }
.record-description, .record-action, .record-columns > section, .decision-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.record-description h3, .record-action h3, .record-columns h3, .decision-card h3 { margin: 0 0 10px; font-size: 13px; }
.record-description p, .decision-card p { margin: 0; color: #4f585d; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.record-action { background: #fafbf9; }
.record-columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.record-timeline { display: grid; }
.record-timeline article { padding: 10px 0; display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 9px; border-bottom: 1px solid var(--line); }
.record-timeline article:last-child { border-bottom: 0; }
.record-timeline strong, .record-timeline p, .record-timeline small { display: block; }
.record-timeline strong { font-size: 10px; }
.record-timeline p { margin: 4px 0; color: #4f585d; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.record-timeline small { color: var(--muted); font-size: 9px; }
.decision-card.approved { border-color: #b8dccf; background: #edf7f3; }
.decision-card.rejected { border-color: #efc7c3; background: #fff4f2; }
.unit-record-list { width: 100%; display: grid; gap: 8px; }
.unit-record-list button { width: 100%; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; text-align: left; }
.unit-record-list button:hover { border-color: #b9ccc6; background: #f7fbf9; }
.unit-record-list strong, .unit-record-list small { display: block; }
.unit-record-list strong { font-size: 11px; }
.unit-record-list small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px); padding: 11px 15px; border-radius: 10px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .user-management-grid { grid-template-columns: 1fr; }
  .user-list { max-height: 390px; }
  .documents-layout { grid-template-columns: 1fr; }
  .record-columns { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 410px; }
  .login-panel { min-height: 540px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -260px; width: 245px; transition: left .2s; box-shadow: 18px 0 40px rgba(0,0,0,.18); }
  .sidebar.open { left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  .language-control > span, .user-pill div { display: none; }
  .page { padding: 22px 16px 44px; }
  .unit-summary { grid-template-columns: 1fr; justify-items: center; }
  .unit-facts { width: 100%; }
  .dimension-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .login-brand, .login-panel { padding: 34px 24px; }
  .login-brand { min-height: 370px; }
  .login-brand h1 { font-size: 44px; }
  .login-stats { gap: 8px; }
  .login-stats strong { font-size: 23px; }
  .login-partners { gap: 9px; }
  .partner-logo-surface { height: 54px; padding: 9px 11px; }
  .partner-logo-card.installer .partner-logo-surface { width: 188px; }
  .partner-logo-card.manufacturer .partner-logo-surface { width: 126px; }
  .partner-logo-card figcaption { max-width: 170px; font-size: 8px; }
  .language-row { position: static; margin: 0 0 50px; justify-content: flex-end; }
  .topbar h1 { font-size: 18px; }
  .topbar-actions { gap: 6px; }
  .notification-button { display: none; }
  .metric-grid, .simple-grid, .form-grid, .milestone-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .schedule-panel-header { align-items: flex-start; flex-direction: column; }
  .schedule-view-control { width: 100%; align-items: flex-start; flex-direction: column; gap: 7px; }
  .schedule-view-tabs { width: 100%; }
  .schedule-view-tabs button { flex: 1 1 50%; }
  .reconcile-banner { align-items: flex-start; }
  .dialog-header, .dialog-content { padding-left: 18px; padding-right: 18px; }
  .unit-facts { grid-template-columns: 1fr; }
  .dimension-heading, .dimension-section-title { align-items: flex-start; flex-direction: column; }
  .dimension-heading > span { white-space: normal; }
  .dimension-summary, .dimension-sections { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .template-strip { grid-template-columns: 1fr; }
  .user-editor-head { grid-template-columns: 45px 1fr; }
  .person-avatar.large { width: 45px; height: 45px; }
  .account-status { grid-column: 1 / -1; justify-self: start; }
  .permission-option { min-width: 64px; padding-left: 5px; padding-right: 5px; }
  .unit-upload-form { grid-template-columns: 1fr; }
  .schedule-dialog-actions { align-items: stretch; flex-direction: column; }
  .record-facts { grid-template-columns: 1fr 1fr; }
  .quality-view-tabs { width: 100%; }
  .quality-view-tabs button { min-width: 0; flex: 1 1 50%; }
}
