:root {
  color-scheme: light;
  --ink: #17342d;
  --muted: #6d7f79;
  --line: #dce6e1;
  --paper: #ffffff;
  --canvas: #f2f6f3;
  --green: #1e725d;
  --green-dark: #173f35;
  --mint: #dff4e9;
  --amber: #f3b957;
  --amber-soft: #fff2d9;
  --red: #cf6b63;
  --red-soft: #fbe9e6;
  --blue: #557db8;
  --blue-soft: #e8effa;
  --shadow: 0 18px 48px rgba(28, 64, 54, 0.09);
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 83% 12%, rgba(219, 240, 231, 0.9), transparent 23rem),
    var(--canvas);
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 92px 1fr; direction: ltr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 14px;
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  direction: rtl;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: #f5fff9;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.brand-mark span { display: block; width: 5px; border-radius: 5px; background: var(--green); }
.brand-mark span:nth-child(1) { height: 10px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 15px; }

.side-nav { width: 100%; margin-top: 48px; display: grid; gap: 12px; }
.nav-item {
  width: 100%; min-height: 62px; border: 0; border-radius: 18px; background: transparent;
  color: #bbcec7; display: grid; place-items: center; gap: 3px; cursor: pointer; transition: .2s ease;
}
.nav-item b { font-size: 22px; font-weight: 500; line-height: 1; }
.nav-item span { font-size: 11px; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-item.settings { margin-top: auto; }

.workspace { direction: rtl; width: min(1540px, 100%); margin: 0 auto; padding: 34px clamp(24px, 4vw, 64px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 13px; font-weight: 750; letter-spacing: .03em; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
.top-actions { display: flex; gap: 10px; }
.cloud-mode #openDataButton, .cloud-mode #saveDataButton { display: none; }
.current-user-button { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--green-dark); }
.file-status { min-height: 46px; padding: 0 8px; border-radius: 14px; background: rgba(255,255,255,.64); display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.file-connection { min-height: 30px; padding: 0 8px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px; background: #f2f5f3; color: #8b9893; font-size: 11px; white-space: nowrap; }
.file-connection i { width: 8px; height: 8px; border-radius: 50%; background: #aeb9b4; }
.file-connection.connected { background: var(--mint); color: var(--green-dark); }
.file-connection.connected i { background: var(--green); box-shadow: 0 0 0 3px rgba(23,118,84,.14); }
.file-connection.saving i { animation: database-sync-pulse .8s ease-in-out infinite; }
.file-connection.failed { background: var(--red-soft); color: var(--red); }
.file-connection.failed i { background: var(--red); }
.file-status { display: flex; align-items: center; gap: 6px; }
.sync-retry-button { min-height: 30px; padding: 4px 9px; border: 1px solid #d9a0a0; border-radius: 9px; color: #a43c3c; background: #fff; font: 750 10px inherit; cursor: pointer; }
@keyframes database-sync-pulse { 50% { opacity:.25; transform:scale(.65); } }
.primary-button, .ghost-button {
  min-height: 48px; padding: 0 19px; border-radius: 15px; border: 1px solid var(--line); cursor: pointer; transition: .18s ease;
}
.icon-button { min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); color: var(--green-dark); cursor: pointer; }
.icon-button:hover { background: #fff; }
.primary-button { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 10px 22px rgba(30,114,93,.2); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button span { font-size: 19px; vertical-align: -1px; margin-left: 5px; }
.ghost-button { background: rgba(255,255,255,.72); }
.ghost-button:hover { background: #fff; }

.workspace-switch { width: fit-content; margin-top: 25px; padding: 5px; display: flex; gap: 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.72); box-shadow: 0 8px 24px rgba(28,64,54,.06); }
.workspace-switch button { min-width: 150px; min-height: 42px; padding: 0 20px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.workspace-switch button:hover { color: var(--green-dark); background: #f7faf8; }
.workspace-switch button.active { background: var(--green-dark); color: #fff; box-shadow: 0 7px 16px rgba(23,63,53,.18); }

.command-bar { margin-top: 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.search-box {
  flex: 1 1 620px; max-width: 780px; min-height: 58px; padding: 0 18px; display: flex; align-items: center; gap: 12px;
  border: 1px solid transparent; border-radius: 21px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); transition: .2s ease;
}
.search-box:focus-within { border-color: #89bbaa; box-shadow: 0 18px 50px rgba(28,64,54,.13); }
.search-box span { font-size: 27px; transform: rotate(-15deg); color: var(--green); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-box input::placeholder { color: #8fa09a; }
kbd { direction: ltr; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 8px; padding: 3px 8px; color: var(--muted); background: #f8faf9; }
.quick-filters { display: flex; gap: 8px; overflow-x: auto; padding: 3px; }
.filter-chip { white-space: nowrap; border: 0; border-radius: 999px; padding: 10px 15px; background: transparent; color: var(--muted); cursor: pointer; }
.filter-chip:hover, .filter-chip.active { color: var(--green-dark); background: #fff; box-shadow: 0 6px 18px rgba(32,70,59,.07); }

.summary-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.summary-grid.capacity-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-card {
  min-height: 112px; padding: 19px; border: 1px solid rgba(220,230,225,.8); border-radius: 24px; background: rgba(255,255,255,.72);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 10px 32px rgba(28,64,54,.05);
}
.summary-card p { margin: 0 0 7px; color: var(--muted); font-size: 13px; }
.summary-card strong { font-size: 29px; letter-spacing: -.03em; }
.summary-icon { width: 50px; height: 50px; border-radius: 18px; display: grid; place-items: center; font-size: 21px; }
.summary-icon.green { background: var(--mint); color: var(--green); }
.summary-icon.amber { background: var(--amber-soft); color: #a46b0e; }
.summary-icon.blue { background: var(--blue-soft); color: var(--blue); }
.summary-icon.red { background: var(--red-soft); color: var(--red); }

.projects-section { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.view-toggle { display: flex; padding: 4px; border-radius: 13px; background: rgba(255,255,255,.8); }
.view-toggle button { width: 36px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.view-toggle button.active { background: var(--green-dark); color: #fff; }

.calendar-view { margin-top: 34px; }
.calendar-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.calendar-heading h2 { margin: 0; font-size: 28px; }
.calendar-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.work-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-height: 520px; margin: 0 0 26px; padding: 16px; border: 1px solid #d7e4de; border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.work-board-section { display: flex; min-height: 220px; flex-direction: column; padding: 17px 18px; border: 1px solid #dce8e2; border-radius: 18px; background: #fff; }
.work-board-section > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid #e8f0ec; }
.work-board-section h3 { margin: 0; color: var(--green-dark); font-size: 18px; }
.work-board-add { min-height: 30px; padding: 0 10px; border: 1px solid #c9dcd3; border-radius: 9px; background: #f7fbf9; color: var(--green); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.work-board-add:hover { border-color: var(--green); background: var(--mint); }
.work-board-lines { display: grid; align-content: start; gap: 6px; padding-top: 11px; }
.work-board-line { display: grid; grid-template-columns: 23px minmax(0, 1fr) 24px; align-items: center; gap: 8px; min-height: 31px; border-bottom: 1px solid #e9efec; }
.work-board-line span { color: #9daaa4; font-size: 10px; font-weight: 750; text-align: center; }
.work-board-line input { box-sizing: border-box; width: 100%; min-width: 0; height: 30px; padding: 0 4px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.work-board-line input:focus { background: #f5fbf8; box-shadow: inset 0 -2px var(--green); }
.work-board-line input::placeholder { color: #b0bbb6; }
.work-board-line button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #a6b2ae; font: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
.work-board-line button:hover { background: var(--red-soft); color: var(--red); }
.reports-view, .issued-reports-view { margin-top: 34px; }
.advanced-management-view { margin-top: 34px; }
.external-sld-view { margin-top: 34px; }
.external-sld-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.external-sld-heading h2 { margin: 0 0 6px; font-size: 26px; }
.external-sld-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.external-sld-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.external-sld-actions .ghost-button, .external-sld-actions .primary-button { min-height: 40px; padding: 0 13px; border-radius: 11px; font-size: 11px; }
.external-sld-library { display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(210px, 1fr) auto auto; gap: 9px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.8); box-shadow: var(--shadow); }
.external-sld-library label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.external-sld-library input, .external-sld-library select { min-height: 38px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; font: inherit; }
.external-sld-library .ghost-button, .external-sld-library .primary-button { min-height: 38px; padding: 0 11px; border-radius: 10px; font-size: 10px; white-space: nowrap; }
.external-sld-editor { margin-top: 14px; padding: 16px; border: 1px solid #b9d6c9; border-radius: 20px; background: #f7fbf9; box-shadow: var(--shadow); }
.external-sld-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.external-sld-toolbar .ghost-button { display: grid; min-width: 60px; min-height: 52px; place-items: center; gap: 1px; padding: 5px 8px; border-radius: 11px; font-size: 22px; line-height: 1; }
.external-sld-toolbar .ghost-button small { font-size: 9px; line-height: 1.1; }
.external-sld-toolbar .selected { border-color: var(--green); background: var(--green); color: #fff; }
.external-sld-status { min-height: 20px; margin: 11px 0 0; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.external-sld-canvas { display: block; width: 100%; min-height: 300px; margin-top: 9px; border: 1px solid #a9cabb; border-radius: 14px; background: #fff; cursor: crosshair; touch-action: none; }
.external-sld-canvas.move-mode { cursor: move; }
.external-sld-canvas .sld-sketch-element { cursor: move; }
.external-sld-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.external-sld-item { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.external-sld-item.selected { border-color: var(--green); background: var(--mint); }
.external-sld-item strong { font-size: 11px; color: var(--green-dark); }
.external-sld-item input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 6px; font: inherit; font-size: 10px; }
.external-sld-item button { min-height: 29px; padding: 0 8px; border: 0; border-radius: 7px; background: var(--red-soft); color: var(--red); cursor: pointer; font: inherit; font-size: 10px; }
.external-sld-busbar-controls { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding-top: 8px; border-top: 1px solid var(--line); }
.external-sld-busbar-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 750; }
.external-sld-busbar-controls input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; background: #fff; font: inherit; font-size: 10px; }
.postgres-migration-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 13px; border: 1px solid #bfd8ea; border-radius: 14px; background: #f5faff; }
.postgres-migration-card strong, .postgres-migration-card p, .postgres-migration-card small { display: block; }
.postgres-migration-card strong { color: #1769aa; font-size: 13px; }
.postgres-migration-card p { margin: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.postgres-migration-card small { color: #557080; font-size: 10px; }
.postgres-migration-card .primary-button { flex: 0 0 auto; min-height: 38px; padding: 0 11px; border-radius: 10px; background: #1769aa; border-color: #1769aa; font-size: 10px; }
.postgres-migration-actions { display: grid; gap: 7px; flex: 0 0 auto; }
.postgres-migration-actions .ghost-button { min-height: 34px; font-size: 10px; }
.postgres-migration-result { margin-top: 8px; max-width: 520px; color: #557080; font-size: 10px; line-height: 1.6; }
.postgres-migration-result.pending { color: #1769aa; }
.postgres-migration-result.success { color: #18794e; font-weight: 700; }
.postgres-migration-result.error { color: var(--red); font-weight: 700; }
.postgres-local-card { margin-top: 10px; border-color: #9fcbb8; background: #f4fbf7; }
.postgres-local-fields { display: grid; grid-template-columns: minmax(150px, 1fr) 90px; gap: 8px; margin-top: 9px; }
.postgres-local-fields label { display: grid; gap: 3px; color: #557080; font-size: 9px; font-weight: 700; }
.postgres-local-fields input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 6px 7px; background: #fff; font: inherit; font-size: 10px; }
.advanced-heading { margin-bottom: 20px; }
.advanced-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.advanced-management-grid { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(0, 2fr); gap: 16px; align-items: start; margin-top: 18px; }
.advanced-project-list, .advanced-project-detail, .advanced-teams { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.advanced-project-list { display: grid; gap: 7px; padding: 15px; }
.advanced-project-list h3, .advanced-timeline h3, .advanced-teams h3 { margin: 0 0 6px; font-size: 16px; }
.advanced-project-select { display: grid; gap: 4px; width: 100%; padding: 11px 12px; border: 1px solid transparent; border-radius: 13px; background: #f7faf8; color: var(--ink); text-align: right; cursor: pointer; }
.advanced-project-select:hover, .advanced-project-select.selected { border-color: #9cc4b5; background: var(--mint); }
.advanced-project-select strong { font-size: 12px; }
.advanced-project-select span { color: var(--muted); font-size: 10px; }
.advanced-project-detail { overflow: hidden; }
.advanced-project-detail > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); background: #f6faf8; }
.advanced-project-detail > header h3 { margin: 0 0 5px; font-size: 18px; }
.advanced-project-detail > header p { margin: 0; color: var(--muted); font-size: 11px; }
.advanced-project-detail > header b { max-width: 200px; padding: 7px 9px; border-radius: 10px; background: var(--mint); color: var(--green-dark); font-size: 10px; text-align: center; }
.advanced-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.advanced-header-actions .ghost-button { min-height: 32px; padding: 0 9px; border-radius: 9px; font-size: 10px; white-space: nowrap; }
.advanced-project-reports-button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 12px; background: #1769aa; color: #fff; box-shadow: 0 7px 15px rgba(23,105,170,.2); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.advanced-project-reports-button span { margin-left: 5px; font-size: 15px; }
.advanced-project-reports-button:hover { background: #0e568f; transform: translateY(-1px); }
.advanced-stage-list { display: grid; }
.advanced-stage-row { display: grid; grid-template-columns: minmax(175px, 1.15fr) minmax(190px, 1fr) minmax(150px, .8fr) auto; gap: 12px; align-items: end; padding: 13px 16px; border-bottom: 1px solid #e8efeb; background: #fff; }
.advanced-stage-row.done { background: #fbfdfc; }
.advanced-stage-row label { display: grid; grid-template-rows: 15px 38px; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.advanced-stage-row input, .advanced-stage-row select, .advanced-team-form input, .advanced-team-form select { box-sizing: border-box; width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; }
.advanced-search { flex: 0 1 430px; min-height: 46px; margin: 0; }
.advanced-search input { min-width: 0; }
.advanced-tabs { display: flex; gap: 7px; margin: -5px 0 16px; padding: 4px; width: fit-content; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.78); }
.advanced-tabs button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.advanced-tabs button.active { background: var(--green-dark); color: #fff; }
.advanced-search-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: -8px 0 16px; }
.advanced-search-results > p { grid-column: 1 / -1; margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 11px; }
.advanced-project-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.advanced-project-info div { min-width: 0; padding: 11px 13px; background: #fff; }
.advanced-project-info span, .advanced-project-info strong { display: block; }
.advanced-project-info span { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.advanced-project-info strong { overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.advanced-project-editor { padding: 16px 18px; border-bottom: 1px solid var(--line); background: #f8fbf9; }
.advanced-reference-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: -16px -18px 15px; padding: 1px; background: var(--line); }
.advanced-reference-line label { display: grid; gap: 4px; padding: 10px 13px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 750; }
.advanced-reference-line input { height: 31px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; }
.advanced-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 66px; gap: 12px; }
.advanced-editor-grid label { display: grid; grid-template-rows: 16px 38px; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.advanced-editor-grid input, .advanced-editor-grid select, .advanced-editor-grid textarea, .advanced-inline-cable-row input { box-sizing: border-box; width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.advanced-editor-grid input, .advanced-editor-grid select { height: 38px; }
.advanced-editor-grid .wide { grid-column: 1 / -1; grid-row: span 2; grid-template-rows: 16px minmax(72px, 1fr); }
.advanced-inline-cables { margin-top: 14px; }
.advanced-inline-cables header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.advanced-inline-cables h3 { margin: 0; font-size: 13px; }
.advanced-inline-cables .ghost-button { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 10px; }
#advancedInlineCableRows { display: grid; gap: 7px; }
.advanced-inline-cable-row { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(85px, .8fr)) auto; gap: 7px; }
.advanced-inline-cable-row input { height: 34px; }
.advanced-inline-cable-row button { width: 34px; border: 1px solid #e7b9b4; border-radius: 8px; background: #fff4f2; color: var(--red); cursor: pointer; }
.advanced-project-editor footer { display: flex; gap: 8px; margin-top: 14px; }
.advanced-project-editor footer .primary-button, .advanced-project-editor footer .ghost-button { min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 11px; }
.advanced-progress-list { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.advanced-progress-list > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 18px; border-bottom: 1px solid var(--line); background: #f6faf8; }
.advanced-progress-list h3 { margin: 0 0 4px; font-size: 17px; }
.advanced-progress-list header p { margin: 0; color: var(--muted); font-size: 11px; }
.advanced-progress-list header b { padding: 7px 10px; border-radius: 10px; background: var(--mint); color: var(--green-dark); font-size: 11px; }
.advanced-progress-list > button { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; width: 100%; padding: 14px 18px; border: 0; border-bottom: 1px solid #e8efeb; background: #fff; color: var(--ink); text-align: right; cursor: pointer; }
.advanced-progress-list > button:hover { background: #f7fbf9; }
.advanced-progress-list > button > div:first-child { display: grid; gap: 4px; }
.advanced-progress-list > button strong { font-size: 13px; }
.advanced-progress-list > button span, .advanced-progress-list > button small { color: var(--muted); font-size: 10px; }
.advanced-progress-list > button > div:nth-child(2) { display: grid; justify-items: end; gap: 4px; }
.advanced-progress-list > button b { padding: 5px 8px; border-radius: 8px; background: var(--amber-soft); color: #875810; font-size: 11px; }
.advanced-progress-list > button > p { grid-column: 1 / -1; margin: 2px 0 0; color: var(--green-dark); font-size: 10px; }
.advanced-progress-empty { margin: 0; padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
.advanced-stage-name { display: grid; gap: 4px; padding-bottom: 4px; }
.advanced-stage-name strong { font-size: 12px; }
.advanced-stage-name span { color: var(--muted); font-size: 10px; }
.advanced-stage-row.done .advanced-stage-name span { color: var(--green); }
.advanced-stage-actions { display: flex; align-items: end; gap: 6px; }
.advanced-stage-actions .ghost-button, .advanced-stage-actions .primary-button { min-height: 38px; padding: 0 11px; border-radius: 9px; font-size: 11px; white-space: nowrap; }
.advanced-stage-complete { display: inline-flex !important; align-items: center; gap: 6px; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green-dark) !important; font-size: 11px !important; cursor: pointer; white-space: nowrap; }
.advanced-stage-complete input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.advanced-timeline { display: grid; gap: 0; padding: 17px 18px; background: #f9fbfa; }
.advanced-timeline article { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); }
.advanced-timeline article:first-of-type { border-top: 0; }
.advanced-timeline b { font-size: 11px; }
.advanced-timeline span, .advanced-timeline p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.advanced-teams { display: grid; grid-template-columns: minmax(190px, .75fr) 1.4fr; gap: 16px; align-items: start; margin-top: 16px; padding: 17px 18px; }
.advanced-teams p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.advanced-team-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.advanced-team-cards article { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; }
.advanced-team-cards strong { font-size: 11px; }
.advanced-team-cards span { color: var(--muted); font-size: 10px; }
.advanced-team-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.advanced-team-form .ghost-button { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 10px; white-space: nowrap; }
.advanced-registries { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.advanced-registries > article { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.advanced-registries > article > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #f6faf8; }
.advanced-registries h3 { margin: 0 0 4px; font-size: 16px; }
.advanced-registries header p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.advanced-registries header b { padding: 6px 9px; border-radius: 9px; background: var(--mint); color: var(--green-dark); font-size: 11px; }
.advanced-registry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.advanced-registry-form input, .advanced-registry-form select { box-sizing: border-box; width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; }
.advanced-registry-form .registry-field, .advanced-registry-edit-form .registry-field { display: grid; grid-template-rows: 15px 38px; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.cable-registry-field-group { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.cable-registry-field-group b { grid-column: 1 / -1; font-size: 11px; }
.cable-registry-field-group label { display: grid; grid-template-rows: 15px 38px; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.cable-registry-field-group.studied { background: #f7faf8; }
.cable-registry-field-group.studied b { color: var(--green-dark); }
.cable-registry-field-group.actual { border-color: #d5e6df; background: #eef8f2; }
.cable-registry-field-group.actual b { color: var(--green); }
.advanced-registry-form .ghost-button { grid-column: 1 / -1; min-height: 38px; padding: 0 11px; border-radius: 9px; font-size: 11px; }
.advanced-registry-list { display: grid; max-height: 255px; overflow-y: auto; }
.advanced-registry-list > p { display: grid; gap: 3px; margin: 0; padding: 10px 16px; border-bottom: 1px solid #e8efeb; }
.advanced-registry-item { border-bottom: 1px solid #e8efeb; }
.advanced-registry-item:last-child { border-bottom: 0; }
.advanced-registry-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; cursor: pointer; list-style: none; }
.advanced-registry-item summary::-webkit-details-marker { display: none; }
.advanced-registry-item summary > div { display: grid; min-width: 0; gap: 3px; }
.advanced-registry-item summary b { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--green-dark); font-size: 10px; }
.advanced-registry-edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; background: #f8fbf9; }
.advanced-registry-edit-form input, .advanced-registry-edit-form select { box-sizing: border-box; width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; }
.advanced-registry-edit-form footer { display: flex; grid-column: 1 / -1; gap: 8px; }
.advanced-registry-edit-form footer button { min-height: 38px; padding: 0 11px; border-radius: 9px; font-size: 11px; }
.advanced-registry-edit-form .registry-delete-button { border-color: #e7b9b4; background: #fff4f2; color: var(--red); }
.advanced-registry-list strong { font-size: 11px; }
.advanced-registry-list span, .advanced-registry-list p { color: var(--muted); font-size: 10px; line-height: 1.5; }
.reports-search { width: min(520px, 100%); margin: 0 0 18px auto; }
.reports-search-results { display: grid; gap: 8px; margin-bottom: 12px; }
.reports-search-results > p { margin: 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 12px; }
.report-project-result { width: 100%; display: grid; gap: 3px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: right; cursor: pointer; transition: .16s ease; }
.report-project-result:hover, .report-project-result.selected { border-color: var(--green); background: var(--mint); box-shadow: 0 6px 16px rgba(24,65,53,.08); }
.report-project-result strong { font-size: 13px; }
.report-project-result span { color: var(--muted); font-size: 11px; }
.reports-selected-project { margin: 0 0 18px; padding: 10px 14px; border-radius: 14px; background: #edf4f0; color: var(--green-dark); font-size: 12px; font-weight: 750; }
.reports-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-hub-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.report-hub-card[hidden] { display: none !important; }
.report-hub-card h3 { margin: 1px 0 6px; font-size: 18px; }
.report-hub-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.report-hub-card .primary-button { grid-column: 1 / -1; }
.report-hub-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; background: var(--mint); color: var(--green); font-size: 22px; font-weight: 800; }
.report-hub-icon.blue { background: var(--blue-soft); color: var(--blue); }
.report-hub-icon.amber { background: var(--amber-soft); color: #9a650f; }
.issued-reports-list { display: grid; gap: 15px; }
.issued-project-group { overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.issued-project-group > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 19px; background: #f6faf8; border-bottom: 1px solid var(--line); }
.issued-project-group h3 { margin: 0 0 4px; font-size: 16px; }
.issued-project-group p { margin: 0; color: var(--muted); font-size: 11px; }
.issued-project-group > header > b { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: 11px; }
.issued-report-rows { display: grid; }
.issued-report-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 19px; border-bottom: 1px solid #e8efeb; }
.issued-report-row:last-child { border-bottom: 0; }
.issued-report-row strong, .issued-report-row span { display: block; }
.issued-report-row strong { font-size: 13px; }
.issued-report-row span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.issued-report-actions { display: flex; align-items: center; gap: 8px; }
.issued-report-actions i { flex: 0 0 auto; padding: 5px 8px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-style: normal; font-weight: 750; }
.issued-report-actions i.report-status.issued { background: var(--mint); color: var(--green-dark); }
.issued-report-actions .ghost-button { min-height: 34px; padding: 0 11px; border-radius: 10px; color: var(--green-dark); font-size: 11px; font-weight: 750; white-space: nowrap; }
.issued-report-actions .issued-report-delete { min-width: 34px; padding: 0; color: #a33d31; border-color: #e7bbb5; font-size: 19px; line-height: 1; }
.issued-reports-empty { display: grid; gap: 5px; padding: 28px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }
.issued-reports-empty strong { color: var(--ink); }
.weekly-planner { display: grid; gap: 22px; }
.week-board { overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.week-title { min-height: 74px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: #f8fbf9; }
.week-title span { display: block; margin-bottom: 4px; color: var(--green); font-size: 12px; font-weight: 750; }
.week-title strong { font-size: 15px; }
.week-title > b { padding: 8px 11px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-size: 11px; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); direction: rtl; }
.plan-day { min-width: 0; min-height: 210px; padding: 12px 10px; border-left: 1px solid var(--line); background: rgba(255,255,255,.62); }
.plan-day:last-child { border-left: 0; }
.plan-day.today { background: #f0f8f4; box-shadow: inset 0 3px var(--green); }
.plan-day.past { background: #f7f9f8; color: #9da9a5; }
.plan-day > header { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.plan-day > header span { font-size: 11px; font-weight: 750; line-height: 1.45; }
.plan-day > header button { flex: 0 0 27px; width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); cursor: pointer; }
.plan-day > header button:hover { border-color: var(--green); background: var(--mint); }
.plan-day > header button:disabled { border-color: transparent; background: #edf1ef; color: #bdc6c2; cursor: not-allowed; }
.day-plans { margin-top: 8px; display: grid; gap: 7px; }
.no-plan { margin: 18px 0 0; color: #a0ada8; text-align: center; font-size: 10px; }
.plan-item { position: relative; padding: 10px 9px; border: 1px solid #d7e5df; border-radius: 13px; background: #fff; box-shadow: 0 5px 14px rgba(24,65,53,.06); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; transform-origin: center; }
.plan-item:hover { z-index: 3; transform: scale(1.5); border-color: #8fb8a8; box-shadow: 0 16px 32px rgba(24,65,53,.22); }
.plan-item > button { position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #a6b2ae; cursor: pointer; }
.plan-item > button:hover { background: var(--red-soft); color: var(--red); }
.plan-item strong { display: block; padding-left: 17px; font-size: 11px; line-height: 1.45; }
.plan-item span { display: block; margin-top: 5px; color: var(--green); font-size: 9px; font-weight: 700; line-height: 1.45; }
.plan-project-type { display: inline-flex; margin-top: 6px; padding: 2px 7px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: 8px; font-weight: 800; line-height: 1.35; }
.plan-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-grid.list-view { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.78); box-shadow: 0 12px 36px rgba(27,60,51,.05); }
.project-list-header, .project-list-row { display: grid; grid-template-columns: minmax(200px, 2fr) 105px 90px 145px 72px 72px minmax(150px, 1.25fr) 54px; gap: 12px; align-items: center; }
.project-list-header { padding: 12px 18px; border-bottom: 1px solid var(--line); background: #edf4f0; color: var(--muted); font-size: 10px; font-weight: 750; }
.project-list-header > span:last-child { text-align: center; }
.project-list-row { min-height: 78px; padding: 13px 18px; border-bottom: 1px solid #e8efeb; cursor: pointer; transition: .16s ease; }
.project-list-row:last-child { border-bottom: 0; }
.project-list-row:hover { background: #fff; box-shadow: inset -3px 0 var(--green); }
.project-list-row:focus-visible { outline: 2px solid #74aa97; outline-offset: -2px; }
.project-list-main { min-width: 0; }
.project-list-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.project-list-main small { display: block; margin-top: 4px; color: var(--muted); }
.list-cell { min-width: 0; }
.list-cell > span { display: none; color: var(--muted); font-size: 9px; }
.list-cell strong { font-size: 12px; }
.list-stage-bubbles { display: grid; grid-template-columns: repeat(4, 26px); gap: 5px; }
.list-stage-bubbles i { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: #e7eeea; color: #fff; font-style: normal; font-size: 10px; }
.list-stage-bubbles i.done { background: var(--green); }
.progress-cell strong { display: inline-grid; min-width: 38px; padding: 6px 7px; border-radius: 10px; text-align: center; background: #eef4f1; }
.list-next-action { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; }
.list-next-action i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.list-next-action span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-complete-check { width: 36px; height: 36px; justify-self: center; border: 2px solid #b8ccc4; border-radius: 12px; background: #fff; color: transparent; font-size: 18px; font-weight: 900; cursor: pointer; transition: .16s ease; }
.project-complete-check:hover { border-color: var(--green); background: var(--mint); color: #91b7a9; }
.project-complete-check.done { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 6px 15px rgba(31,122,92,.24); }
.project-card {
  position: relative; overflow: hidden; min-height: 255px; border: 1px solid rgba(220,230,225,.92); border-radius: 29px; padding: 21px;
  background: rgba(255,255,255,.9); box-shadow: 0 12px 36px rgba(27,60,51,.06); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.project-card::after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; left: -55px; top: -52px; background: var(--card-tint, var(--mint)); opacity: .75; }
.project-card:hover { transform: translateY(-4px); border-color: #accbc0; box-shadow: 0 22px 48px rgba(27,60,51,.12); }
.project-head { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 15px; }
.project-head h3 { margin: 0 0 7px; font-size: 18px; line-height: 1.45; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.project-meta span + span::before { content: "•"; margin-left: 7px; color: #afbbb7; }
.progress-orb {
  --progress: 0%; flex: 0 0 58px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--green) var(--progress), #e5eee9 0); position: relative;
}
.progress-orb::before { content: ""; position: absolute; inset: 6px; border-radius: inherit; background: #fff; }
.progress-orb strong { position: relative; z-index: 1; font-size: 12px; }
.next-action { margin-top: 22px; min-height: 47px; border-radius: 16px; padding: 11px 13px; background: #f5f8f6; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.next-action i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.next-action.complete i { background: var(--green); box-shadow: 0 0 0 5px var(--mint); }
.stage-track { margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.stage-track.three-stages { grid-template-columns: repeat(3, 1fr); }
.stage-track.two-stages { grid-template-columns: repeat(2, 1fr); }
.list-stage-bubbles.two-stages { grid-template-columns: repeat(2, 26px); }
.stage { text-align: center; }
.stage-bubble { width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: #edf2ef; color: #91a09b; font-size: 13px; font-weight: 800; }
.stage.done .stage-bubble { background: var(--green); color: #fff; }
.stage.active .stage-bubble { background: var(--amber-soft); color: #9b6510; box-shadow: inset 0 0 0 1px #efcc89; }
.stage span { display: block; font-size: 10px; color: var(--muted); }
.card-substages { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card-substages.capacity-workflow { grid-template-columns: 1fr; }
.card-substage-group { padding: 10px; border-radius: 15px; background: #f5f8f6; }
.card-substage-group > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.card-substage-group > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.card-substage-group.equipment > div { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card-substage-group i { min-width: 0; height: 27px; border-radius: 9px; display: grid; place-items: center; background: #e5ece8; color: #8b9a95; font-style: normal; font-size: 10px; }
.card-substage-group i.done { background: var(--green); color: #fff; }
.card-substage-group i small { display: block; max-width: 100%; padding-inline: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.card-substage-group i.done small { display: none; }
.list-stage-bubbles.three-stages { grid-template-columns: repeat(3, 26px); }
.field[hidden], #cableFormSection[hidden] { display: none !important; }

.empty-state { padding: 64px 20px; text-align: center; border: 1px dashed #c8d5d0; border-radius: 28px; color: var(--muted); }
.empty-state div { font-size: 42px; color: var(--green); }
.empty-state h3 { margin: 10px 0 5px; color: var(--ink); }
.empty-state p { margin: 0; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(12,31,26,.32); backdrop-filter: blur(3px); z-index: 30; }
.project-drawer { position: fixed; top: 0; right: 0; width: min(520px, 100%); height: 100vh; padding: 30px; background: #f9fbfa; z-index: 31; transform: translateX(105%); transition: transform .25s ease; overflow-y: auto; box-shadow: -20px 0 60px rgba(15,39,32,.18); }
.project-drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; left: 24px; top: 24px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 24px; cursor: pointer; }
.drawer-title { padding-left: 50px; }
.drawer-title .eyebrow { margin-top: 8px; }
.drawer-title h2 { margin: 0; font-size: 27px; }
.drawer-title p { color: var(--muted); }
.drawer-identifiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.drawer-identifiers div { min-width: 0; padding: 10px 8px; border-left: 1px solid var(--line); text-align: center; }
.drawer-identifiers div:last-child { border-left: 0; }
.drawer-identifiers span, .drawer-identifiers strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-identifiers span { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.drawer-identifiers strong { color: var(--ink); font-size: 12px; font-weight: 850; }
.drawer-title .drawer-context-line { margin: 5px 0 0; }
.drawer-stages { margin-top: 28px; display: grid; gap: 10px; }
.drawer-stage { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-stage div { display: flex; align-items: center; gap: 10px; }
.drawer-stage b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #edf2ef; color: #8b9b95; }
.drawer-stage.done b { background: var(--green); color: #fff; }
.drawer-stage small { color: var(--muted); }
.drawer-stage button { border: 0; border-radius: 11px; padding: 8px 11px; background: #eef4f1; cursor: pointer; }
.drawer-stage button:hover { background: var(--mint); color: var(--green-dark); }
.drawer-stage-group { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.drawer-stage-group .drawer-stage.parent { border: 0; border-radius: 0; background: #f7faf8; }
.parent-stage-check { flex: 0 0 28px; width: 28px; height: 28px; padding: 0 !important; border: 2px solid #b8ccc4 !important; border-radius: 8px !important; background: #fff !important; color: transparent; font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; }
.parent-stage-check:hover { border-color: var(--green) !important; background: var(--mint) !important; color: #8ab2a3; }
.parent-stage-check.done { border-color: var(--green) !important; background: var(--green) !important; color: #fff; }
.substage-checklist { padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.substage-check { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: flex; align-items: center; gap: 9px; text-align: right; cursor: pointer; }
.substage-check:hover { border-color: #9fc6b8; background: #f7fbf9; }
.substage-check > b { flex: 0 0 25px; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; background: #edf2ef; color: #fff; }
.substage-check.done > b { background: var(--green); }
.substage-check > span { min-width: 0; font-size: 11px; font-weight: 700; }
.substage-check small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 400; }
.drawer-block { margin-top: 18px; border-radius: 20px; padding: 18px; background: #fff; border: 1px solid var(--line); }
.drawer-block h3 { margin: 0 0 13px; font-size: 15px; }
.capacity-required-equipment { background: linear-gradient(135deg, #f4fbf7, #fff); border-color: #b8d9c8; }
.capacity-required-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.capacity-required-heading h3 { margin-bottom: 5px; color: var(--green-dark); }
.capacity-required-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.capacity-required-heading > span { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #dff1e6; color: var(--green-dark); font-size: 10px; font-weight: 800; }
.capacity-required-equipment .capacity-report-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 0; border-top: 0; }
.capacity-required-equipment .capacity-report-choice label { min-height: 42px; padding: 9px 11px; border: 1px solid #c9dfd1; border-radius: 12px; background: #fff; color: var(--ink); font-size: 12px; }
.capacity-required-equipment .capacity-report-choice input { width: 16px; height: 16px; accent-color: var(--green); }
.capacity-required-equipment .capacity-report-choice input:disabled { opacity: .8; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.detail-grid p { margin: 0; }
.detail-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.drawer-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.drawer-actions button { min-height: 45px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.drawer-actions button.primary { border-color: var(--green); background: var(--green); color: #fff; }
.drawer-actions button.danger { border-color: #e8a8a1; background: #fff5f3; color: #b23a30; }
.drawer-actions button.danger:hover { border-color: #c85b51; background: #fde8e5; }
.drawer-actions button:disabled { cursor: not-allowed; opacity: .48; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { padding: 12px; border-radius: 14px; background: #f4f8f6; }
.metric span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.metric strong { font-size: 15px; }
.metric.overrun { background: var(--red-soft); color: #9d423b; }
.metric.saving { background: var(--mint); color: var(--green-dark); }
.suborder-list { display: flex; gap: 7px; flex-wrap: wrap; }
.suborder-list span { padding: 7px 10px; border-radius: 999px; background: #eef4f1; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(12,31,26,.42); backdrop-filter: blur(5px); }
.modal {
  position: fixed; z-index: 41; top: 50%; left: 50%; width: min(760px, calc(100% - 30px)); max-height: calc(100vh - 36px); overflow-y: auto;
  border-radius: 28px; padding: 25px; background: #f9fbfa; box-shadow: 0 30px 90px rgba(10,32,25,.26); transform: translate(-50%, -46%) scale(.98); opacity: 0; pointer-events: none; transition: .2s ease;
}
.modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.compact-modal { width: min(560px, calc(100% - 30px)); }
.report-modal { width: min(620px, calc(100% - 30px)); }
.advanced-reports-modal { width: min(820px, calc(100% - 30px)); }
.advanced-report-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.advanced-report-option { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.advanced-report-option strong, .advanced-report-option span { display: block; }
.advanced-report-option strong { font-size: 13px; }
.advanced-report-option span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.advanced-report-option .primary-button { grid-column: 1 / -1; }
.advanced-project-report-history { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.advanced-project-report-history h3 { margin: 0 0 10px; font-size: 15px; }
.advanced-project-report-history .issued-report-row { padding-inline: 0; }
.trench-excavation-modal { width: min(700px, calc(100% - 30px)); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-header h2 { margin: 0; font-size: 25px; }
.modal-close { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 23px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.project-number-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; outline: 0; color: var(--ink); background: #fff; transition: .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #7daf9e; box-shadow: 0 0 0 4px rgba(96,157,136,.12); }
.form-section-heading { margin: 24px 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.form-section-heading h3 { margin: 0 0 3px; font-size: 15px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.small-button { border: 1px solid var(--line); border-radius: 11px; padding: 8px 11px; background: #fff; cursor: pointer; }
.cable-lines { display: grid; gap: 9px; margin-bottom: 15px; }
.cable-line-editor { display: grid; grid-template-columns: 1.2fr repeat(4, .8fr) 34px; gap: 7px; align-items: end; padding: 11px; border-radius: 16px; background: #eef4f1; }
.cable-line-editor label { display: grid; gap: 4px; }
.cable-line-editor span { color: var(--muted); font-size: 9px; }
.cable-line-editor input { min-width: 0; width: 100%; border: 1px solid #d5e2dc; border-radius: 10px; padding: 8px; background: #fff; }
.remove-line { width: 32px; height: 34px; border: 0; border-radius: 10px; background: #fff; color: var(--red); cursor: pointer; }
.modal-footer { margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.login-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.import-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0; }
.import-stats div { padding: 16px; border-radius: 16px; text-align: center; background: #eef4f1; }
.import-stats strong { display: block; font-size: 24px; }
.import-stats span { color: var(--muted); font-size: 11px; }
.import-note { padding: 13px; border-radius: 14px; background: var(--amber-soft); color: #775019; font-size: 12px; line-height: 1.7; }
.report-summary { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: #fff; line-height: 1.8; font-size: 13px; }
.trench-type-options { display: flex; gap: 10px; flex-wrap: wrap; }
.trench-type-options label { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 700; }
.trench-type-options input { width: 17px; height: 17px; accent-color: var(--green); }
.trench-project-cable-data { margin: 13px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--mint); color: var(--green-dark); font-size: 12px; line-height: 1.7; }
#trenchFeederFields { margin-top: 14px; }
.energization-report-modal { width: min(1080px, calc(100% - 30px)); }
.capacity-report-modal { width: min(1080px, calc(100% - 30px)); }
.automation-report-modal { width: min(1080px, calc(100% - 30px)); }
.lv-meter-report-modal { width: min(980px, calc(100% - 30px)); }
.energization-form-summary { margin-bottom: 16px; padding: 14px 16px; border-radius: 16px; background: var(--mint); }
.energization-form-summary strong, .energization-form-summary span { display: block; }
.energization-form-summary span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.equipment-section { margin: 0 0 15px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.equipment-section legend { padding: 0 8px; color: var(--green-dark); font-size: 13px; font-weight: 800; }
.equipment-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.equipment-grid.five-fields { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.meter-readings-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meter-readings-grid > div { padding: 11px; border-radius: 13px; background: #f3f7f5; }
.meter-readings-grid strong { display: block; margin-bottom: 8px; font-size: 11px; }
.meter-readings-grid label { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.meter-readings-grid input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; background: #fff; }
.capacity-report-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.capacity-report-choice > span { color: var(--green-dark); font-weight: 800; }
.capacity-report-choice label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.equipment-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.equipment-compare-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.equipment-compare-card h3 { margin: 0 0 10px; font-size: 12px; }
.capacity-report-modal #capacityTransformerSection .transformer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.capacity-report-modal #capacityTransformerSection .field-with-unit { min-width: 0; }
.capacity-report-modal #capacityTransformerSection .input-with-unit input { min-width: 90px; text-align: center; font-weight: 750; }
.old-equipment { background: #fff6f2; border-color: #e9b9a4; }
.old-equipment h3 { color: #99512e; }
.new-equipment { background: #eef8f2; border-color: #a9d7bb; }
.new-equipment h3 { color: #187043; }
.input-with-unit { display: flex; align-items: stretch; direction: ltr; }
.input-with-unit input { min-width: 0; flex: 1; border-radius: 9px 0 0 9px; }
.input-with-unit b { display: grid; place-items: center; min-width: 42px; padding: 0 8px; border: 1px solid var(--line); border-right: 0; border-radius: 0 9px 9px 0; background: rgba(255,255,255,.7); color: var(--muted); font-size: 11px; direction: ltr; }
.capacity-items-grid { display: grid; grid-template-columns: .75fr 1.35fr 1fr .6fr 1.2fr .9fr; gap: 9px; }
.capacity-items-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.capacity-items-grid input, .capacity-items-grid select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: #fff; font: inherit; }
.automation-items-editor { display: grid; gap: 9px; margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.automation-equipment-row { display: grid; grid-template-columns: 1.35fr 1.2fr .8fr auto; gap: 9px; align-items: end; }
.automation-row-remove { align-self: end; white-space: nowrap; }
.form-note { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.report-inline-equipment { margin-top: 10px; padding: 10px; border-top: 1px dashed var(--line); background: #fbfdfc; }
.report-inline-equipment .ghost-button { margin-top: 9px; }
.report-inline-add { margin-top: 10px; }

.toast { position: fixed; z-index: 60; bottom: 26px; left: 50%; max-width: calc(100% - 32px); transform: translate(-50%, 24px); opacity: 0; pointer-events: none; padding: 12px 17px; border-radius: 13px; background: var(--green-dark); color: #fff; box-shadow: 0 12px 32px rgba(10,32,25,.22); transition: .22s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.modal-note { margin: 0 0 14px; color: var(--muted); line-height: 1.75; }
.excel-link-review-list { display: grid; gap: 12px; }
.excel-link-review-item { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fbf9; }
.excel-link-review-item strong, .excel-link-review-item small { display: block; }
.excel-link-review-item small { margin-top: 3px; color: var(--muted); }
.excel-link-review-item .form-grid { margin-top: 12px; }
.print-report { display: none; }
.print-page { width: 210mm; min-height: 297mm; padding: 10mm 20mm 8mm; margin: 0 auto; background: #fff; color: #000; font-family: Arial, Tahoma, sans-serif; direction: rtl; }
.report-letterhead { display: grid; grid-template-columns: 22mm 1fr 22mm; align-items: center; min-height: 22mm; padding-bottom: 7mm; border-bottom: 1.6px solid #111; direction: rtl; }
.report-letterhead img { grid-column: 1; width: 19mm; height: 19mm; object-fit: contain; justify-self: center; }
.report-letterhead h1 { grid-column: 2; margin: 0; text-align: center; font-size: 21pt; font-weight: 700; line-height: 1.25; }
.report-letterhead > span { grid-column: 3; }
.report-body { padding-top: 5mm; font-size: 13.5pt; line-height: 1.55; }
.report-body p { margin: 0 0 3mm; }
.report-recipient { padding-right: 11mm; margin-bottom: 14mm !important; font-weight: 700; }
.report-subject { text-align: right; }
.report-subject u { text-underline-offset: 2px; }
.report-cable-list { margin: 0 7mm 2mm 0; }
.report-cable-list div { margin-bottom: 1mm; }
.report-beneficiary { text-align: center; }
.report-voucher { padding-right: 10mm; margin-top: 5mm !important; font-weight: 700; }
.report-respect { text-align: center; margin-top: 7mm !important; }
.signature-row { margin-top: 10mm; display: grid; grid-template-columns: 1fr 1fr; text-align: center; min-height: 24mm; }
.approval-block { margin-top: 6mm; }
.approval-title { padding-right: 10mm; font-weight: 700; }
.approval-instruction { display: inline-block; margin-right: 10mm !important; font-weight: 700; }
.approval-choice { display: inline-flex; align-items: center; gap: 10mm; margin-right: 8mm; font-weight: 700; }
.approval-choice .selected { text-decoration: underline; text-underline-offset: 3px; }
.approval-signature { margin-top: 20mm !important; text-align: left; padding-left: 10mm; }

.energization-print-page { page: energization-report; position: relative; width: 216mm; min-height: 279mm; margin: 0 auto; padding: 9.5mm 18mm 12mm 31.5mm; background: #fff; color: #000; font-family: "Times New Roman", Arial, sans-serif; direction: rtl; }
.energization-letter { font-size: 10pt; line-height: 1.16; }
.energization-topline { display: flex; justify-content: space-between; gap: 12mm; margin-bottom: 2mm; font-size: 12.5pt; }
.energization-topline strong { border-bottom: 1.2px solid #000; }
.energization-subject, .energization-intro { margin: 0 0 1.4mm; }
.energization-subject { font-size: 11.3pt; }
.energization-intro { text-align: justify; }
.energization-letter h3 { margin: 1.25mm 0 .55mm; text-align: right; font-size: 11.3pt; }
.technical-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
.technical-table th, .technical-table td { border: .8px solid #111; padding: 1.1mm .8mm; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }
.technical-table th { background: #d9d9d9; font-weight: 700; }
.meter-report-table { font-family: Arial, Tahoma, sans-serif; font-size: 8.4pt; }
.meter-report-table td span { display: block; text-align: left; white-space: nowrap; }
.sld-title { margin: 1.2mm 0 0; text-align: left; direction: ltr; font-size: 13.5pt; font-weight: 400; }
.single-line-diagram { position: relative; height: 38mm; }
.single-line-diagram svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sld-label { position: absolute; z-index: 1; top: 1.5mm; width: 30%; text-align: center; font-family: Arial, Tahoma, sans-serif; font-size: 11.2pt; font-weight: 600; direction: rtl; }
.sld-label.incoming { left: 0; }
.sld-label.project { left: 35%; }
.sld-label.outgoing { right: 0; }
.sld-sketcher-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.sld-sketcher-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.sld-sketcher-toggle strong, .sld-sketcher-toggle span { display: block; }
.sld-sketcher-toggle strong { font-size: 12px; color: var(--green-dark); }
.sld-sketcher-toggle span, .sld-sketcher > p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.sld-sketcher-toggle .ghost-button, .sld-sketcher-tools .ghost-button { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 11px; white-space: nowrap; }
.sld-sketcher { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #f7fbf9; }
.sld-template-manager { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto minmax(130px, .7fr) auto auto; align-items: center; gap: 7px; margin-bottom: 11px; padding: 9px; border: 1px solid #c9ddd3; border-radius: 11px; background: #fff; color: var(--green-dark); font-size: 11px; }
.sld-template-manager select, .sld-template-manager input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: #fff; font: inherit; }
.sld-template-manager .ghost-button { min-height: 31px; padding: 0 9px; border-radius: 8px; font-size: 10px; }
.sld-sketcher-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.sld-symbol-palette .ghost-button { display: grid; min-width: 54px; min-height: 47px; place-items: center; gap: 0; padding: 4px 7px; font-size: 21px; line-height: 1; }
.sld-symbol-palette .ghost-button small { font-size: 9px; line-height: 1.1; }
.sld-sketcher-tools .selected { border-color: var(--green); background: var(--green); color: #fff; }
.sld-tool-separator { width: 1px; height: 30px; background: var(--line); }
.sld-snap-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 11px; cursor: pointer; }
.sld-snap-toggle input { accent-color: var(--green); }
.sld-sketch-canvas { display: block; width: 100%; aspect-ratio: 5 / 1; min-height: 150px; margin-top: 10px; border: 1px solid #b8d2c7; border-radius: 10px; background: #fff; cursor: crosshair; touch-action: none; }
.sld-sketch-canvas.select-mode { cursor: default; }
.sld-sketch-canvas.select-mode .sld-sketch-element { cursor: move; }
.sld-line-endpoint { fill: #fff; stroke: #1e725d; stroke-width: 2; cursor: crosshair; }
.sld-sketch-element.selected { filter: drop-shadow(0 0 3px #1e725d); }
.sld-sketch-element.ghost { opacity: .48; pointer-events: none; }
.sld-sketch-items { display: grid; gap: 7px; margin-top: 10px; }
.sld-sketch-items > p { margin: 0; padding: 9px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.sld-sketch-item { display: grid; grid-template-columns: 115px 1fr auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sld-sketch-item.selected { border-color: var(--green); background: var(--mint); }
.sld-select-item { padding: 0; border: 0; background: transparent; color: var(--green-dark); font: inherit; font-size: 11px; font-weight: 750; text-align: right; cursor: pointer; }
.sld-select-item:hover { text-decoration: underline; }
.sld-sketch-item input { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font: inherit; }
.sld-sketch-item .ghost-button { min-height: 31px; padding: 0 9px; border-radius: 8px; font-size: 10px; }
.sld-cable-head-controls { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px; border-top: 1px solid var(--line); }
.sld-cable-head-controls label { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 750; }
.sld-cable-head-controls input[type="range"] { width: 100%; padding: 0; accent-color: var(--green); }
.sld-busbar-controls { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr 1fr; gap: 9px; padding: 8px; border-top: 1px solid var(--line); }
.sld-busbar-controls label { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.sld-busbar-controls input, .sld-busbar-controls select { min-width: 0; width: 100%; accent-color: var(--green); }
.sld-only-page { display: none; }
.energization-bottom { position: relative; height: 90mm; margin: 6mm 0 0; font-family: "Times New Roman", Arial, sans-serif; font-size: 11.5pt; line-height: 1.18; direction: rtl; }
.energization-bottom p { margin: 0; }
.energization-respect { position: absolute; width: 34%; text-align: center; font-size: 12.5pt; }
.engineer-respect { top: 0; left: 33%; }
.engineer-signature { position: absolute; top: 7.5mm; left: 0; width: 31%; text-align: center; }
.circulation-block { position: absolute; top: 10.5mm; right: 0; width: 67%; text-align: right; line-height: 1.08; }
.circulation-block strong, .diwan-block strong { display: block; font-size: 11.8pt; text-decoration: underline; text-underline-offset: 1.2px; }
.circulation-block p { margin-top: 1mm; }
.circulation-block ul { margin: 1.4mm 0 0; padding: 0 7mm 0 0; list-style-position: outside; }
.circulation-block li { margin: 0; padding-right: .6mm; }
.station-head-respect { top: 48.5mm; left: 33%; }
.station-head-signature { position: absolute; top: 53.5mm; left: 0; width: 34%; text-align: center; }
.diwan-block { position: absolute; top: 64mm; right: 0; width: 50%; text-align: right; }
.diwan-block p { margin-top: 1.5mm; }
.director-respect { top: 75mm; left: 33%; }
.director-signature { position: absolute; top: 78.5mm; left: 0; width: 34%; text-align: center; }

.capacity-upgrade-print-page { page: capacity-upgrade-report; position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 13mm; background: #fff; color: #000; font-family: "Times New Roman", Arial, sans-serif; direction: rtl; }
.report-form-code { position: absolute; left: 13mm; bottom: 9mm; direction: ltr; font-family: Arial, sans-serif; font-size: 8pt; }
.capacity-upgrade-letter { font-size: 11pt; line-height: 1.28; }
.capacity-upgrade-letter p { margin: 0 0 4mm; }
.capacity-recipient { margin-bottom: 11mm !important; font-weight: 700; }
.capacity-subject { display: flex; justify-content: space-between; gap: 12mm; font-weight: 700; }
.capacity-intro { text-align: justify; }
.capacity-upgrade-letter h3 { margin: 3mm 0 1.2mm; font-size: 11pt; }
.capacity-technical-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 3mm; font-size: 8.7pt; direction: ltr !important; unicode-bidi: isolate; }
.capacity-technical-table th, .capacity-technical-table td { border: .8px solid #111; padding: 1.25mm .7mm; text-align: center; vertical-align: middle; overflow-wrap: anywhere; direction: ltr !important; unicode-bidi: plaintext; }
.capacity-technical-table th { background: #d9d9d9; font-weight: 700; }
.capacity-upgrade-bottom { position: relative; height: auto; margin-top: 6mm; }
.capacity-respect { text-align: center; margin-top: 4mm !important; }
.capacity-engineer { margin: 0 0 6mm 0 !important; text-align: left; padding-left: 24mm; }
.capacity-signature { margin: 0 0 5mm !important; text-align: left; padding-left: 18mm; }
.capacity-circulation, .capacity-diwan { margin-top: 4mm; }
.capacity-circulation strong, .capacity-diwan strong { text-decoration: underline; text-underline-offset: 1.2px; }
.capacity-circulation ul { margin: 1.5mm 0 0; padding-right: 7mm; }
.capacity-circulation li { margin: 0; }

.automation-print-page { page: automation-report; position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 13mm; background: #fff; color: #000; font-family: "Times New Roman", Arial, sans-serif; direction: rtl; }
.automation-letter { font-size: 11pt; line-height: 1.28; }
.automation-letter p { margin: 0 0 4mm; }
.automation-recipient { margin-bottom: 11mm !important; font-weight: 700; }
.automation-subject { display: flex; justify-content: space-between; gap: 12mm; font-weight: 700; }
.automation-intro { text-align: justify; }
.automation-letter h3 { margin: 3mm 0 1.2mm; font-size: 11pt; }
.automation-technical-table, .automation-technical-table thead, .automation-technical-table tbody, .automation-technical-table tr { direction: ltr !important; unicode-bidi: isolate; }
.automation-technical-table { width: 92%; margin: 0 auto 4mm; border-collapse: collapse; table-layout: fixed; font-size: 9pt; }
.automation-technical-table th, .automation-technical-table td { border: .8px solid #111; padding: 1.25mm .7mm; text-align: center; vertical-align: middle; overflow-wrap: anywhere; direction: ltr !important; unicode-bidi: isolate; }
.automation-technical-table th { background: #d9d9d9; font-weight: 700; }
.automation-technical-table th:nth-child(1) { width: 37%; }
.automation-technical-table th:nth-child(2) { width: 34%; }
.automation-technical-table th:nth-child(3) { width: 29%; }
.automation-bottom { margin-top: 12mm; }
.automation-respect { text-align: center; margin-top: 4mm !important; }
.automation-engineer { margin: 0 0 7mm !important; padding-left: 24mm; text-align: left; }
.automation-circulation, .automation-diwan { margin-top: 4mm; }
.automation-circulation strong, .automation-diwan strong { text-decoration: underline; text-underline-offset: 1.2px; }
.automation-circulation ul { margin: 1.5mm 0 0; padding-right: 7mm; }
.automation-circulation li { margin: 0; }
.automation-signature { width: 34%; margin: 0 auto 5mm 0 !important; text-align: center; }

.lv-meter-print-page { page: lv-meter-report; position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 13mm; background: #fff; color: #000; font-family: "Times New Roman", Arial, sans-serif; direction: rtl; }
.trench-excavation-print-page { page: trench-excavation-request; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 13mm 18mm; background: #fff; color: #000; font-family: Arial, Tahoma, sans-serif; direction: rtl; }
.trench-excavation-letter { font-size: 12.5pt; line-height: 1.27; }
.trench-excavation-letter h1 { margin: 0 0 7.65mm; text-align: center; font-size: 18pt; text-decoration: underline; text-underline-offset: 3px; }
.trench-excavation-letter p { margin: 0 0 2.5mm; }
.trench-recipient { font-weight: 700; }
.trench-intro { margin-bottom: 4mm !important; }
.trench-details-table { width: 100%; border-collapse: collapse; margin: 0 0 4mm; font-size: 11.25pt; }
.trench-details-table th, .trench-details-table td { border: 1px solid #111; padding: 1.65mm 3mm; vertical-align: middle; text-align: right; }
.trench-details-table thead th { text-align: center; background: #f2f2f2; font-weight: 700; }
.trench-details-table tbody th { width: 35%; background: #fafafa; font-weight: 700; }
.trench-details-table tbody td { text-align: center; }
.trench-date { margin-top: 5mm !important; }
.trench-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 16mm; margin-top: 9mm; text-align: center; }
.trench-signatures div { display: grid; gap: 2mm; min-height: 23mm; }
.trench-signatures strong { font-size: 12.5pt; }
.trench-signatures em { margin-top: auto; font-style: normal; text-align: right; }
.trench-copy { margin-top: 9mm !important; font-size: 11pt; }
.cement-base-print-page { page: cement-base-request; position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 20.32mm 25.4mm; background: #fff; color: #000; font-family: Arial, Tahoma, sans-serif; direction: rtl; }
.cement-base-letter { font-size: 14pt; line-height: 1.25; font-weight: 700; }
.cement-base-letter h1 { margin: 0 0 11mm; text-align: center; font-size: 14pt; }
.cement-base-letter p { margin: 0 0 4mm; }
.cement-recipient { margin-top: 2mm !important; }
.cement-intro { margin-bottom: 6mm !important; }
.cement-base-details-table { width: 87%; margin: 0 auto 6mm; border-collapse: collapse; table-layout: fixed; font-size: 14pt; }
.cement-base-details-table th, .cement-base-details-table td { border: 1px solid #111; padding: 1.55mm 2mm; text-align: center; vertical-align: middle; font-weight: 700; overflow-wrap: anywhere; }
.cement-base-details-table thead th { background: #fff; }
.cement-base-details-table tbody th { width: 46%; }
.cement-date { margin-top: 5mm !important; }
.cement-signature-lines { display: grid; gap: 5mm; margin-top: 8mm; }
.cement-signature-lines p { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 8mm; }
.cement-signature-lines strong { text-align: center; }
.cement-fp-number { position: absolute; bottom: 12mm; left: 25.4mm; direction: ltr; font-size: 10pt; font-weight: 700; }
.lv-meter-letter { font-size: 10.5pt; line-height: 1.22; }
.lv-meter-topline { display: grid; justify-items: end; gap: 2mm; margin-bottom: 8mm; font-size: 11.5pt; }
.lv-meter-topline span { font-weight: 700; }
.lv-meter-subject { margin: 0 0 7mm; font-weight: 700; text-align: right; }
.lv-meter-intro { margin: 0 0 5mm; text-align: justify; }
.lv-meter-letter h3 { margin: 2.4mm 0 1mm; font-size: 11pt; }
.lv-meter-data-table { border-collapse: collapse; table-layout: fixed; margin-right: auto; margin-left: auto; margin-bottom: 2.5mm; font-size: 9.2pt; direction: rtl; }
.lv-meter-main-table { width: 62%; }
.lv-meter-unit-table { width: 62%; }
.lv-meter-data-table th, .lv-meter-data-table td { border: .8px solid #111; padding: 1mm 1.2mm; text-align: center; vertical-align: middle; }
.lv-meter-data-table th { width: 37%; background: #d9d9d9; font-weight: 700; }
.lv-meter-data-table td { font-weight: 700; }
.lv-meter-ltr-value { display: inline-block; direction: ltr; unicode-bidi: isolate; }
.lv-meter-main-table.has-additional-meter { width: 94%; }
.lv-meter-main-table.has-additional-meter th { width: 33.33%; }
.lv-meter-main-table.has-additional-meter .lv-meter-title-row th:not(:first-child) { background: #fff; }
.lv-meter-title-row th:last-child { background: #fff; }
.lv-meter-main-table .lv-meter-readings { height: 31mm; }
.lv-meter-readings { text-align: left !important; font-family: Arial, Tahoma, sans-serif; font-size: 8.5pt; }
.lv-meter-readings span, .lv-meter-readings em { display: block; margin-bottom: .6mm; white-space: nowrap; }
.lv-meter-readings em { margin: 1.2mm 0 0; font-style: normal; direction: rtl; text-align: right; white-space: normal; }
.lv-meter-bottom { margin-top: 14mm; font-size: 10.2pt; line-height: 1.16; }
.lv-meter-bottom p { margin: 0; }
.lv-meter-respect { margin: 0 0 2mm !important; text-align: center; }
.lv-meter-engineer { margin: 0 0 8mm !important; padding-left: 24mm; text-align: left; }
.lv-meter-approval { display: grid; grid-template-columns: 1.7fr 1fr; gap: 12mm; align-items: start; margin-bottom: 2mm; }
.lv-meter-approval > p { text-align: center; padding-left: 0; }
.lv-meter-signature-name { display: block; text-align: center; }
.lv-meter-circulation { width: 68%; margin: 0 0 2mm auto; padding: 0 7mm 0 0; }
.lv-meter-circulation li { margin: 0 0 .7mm; }
.lv-meter-director { width: 34%; margin: 2mm auto 0 0 !important; padding-left: 0; text-align: center; }
.lv-meter-attachments { width: 46%; display: grid; grid-template-columns: auto 1fr; gap: 5mm; margin: 2mm 0 0 auto; }

@page cable-report { size: A4 portrait; margin: 0; }
@page energization-report { size: Letter portrait; margin: 0; }
@page capacity-upgrade-report { size: A4 portrait; margin: 0; }
@page automation-report { size: A4 portrait; margin: 0; }
@page lv-meter-report { size: A4 portrait; margin: 0; }
@page trench-excavation-request { size: A4 portrait; margin: 0; }
@page cement-base-request { size: A4 portrait; margin: 0; }
@page sld-only { size: A4 landscape; margin: 0; }
.print-page { page: cable-report; }

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid.capacity-summary { grid-template-columns: repeat(2, 1fr); }
  .advanced-summary { grid-template-columns: repeat(2, 1fr); }
  .advanced-registries { grid-template-columns: 1fr; }
  .advanced-stage-row { grid-template-columns: 1fr 1fr; }
  .advanced-stage-name, .advanced-stage-actions { grid-column: 1 / -1; }
  .advanced-stage-spacer { display: none; }
  .advanced-search-results, .advanced-project-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-reference-line { grid-template-columns: 1fr 1fr 1fr; }
  .advanced-inline-cable-row { grid-template-columns: 1fr 1fr 1fr; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .command-bar { align-items: stretch; flex-direction: column; }
  .search-box { flex-basis: auto; max-width: none; }
  .week-board { overflow-x: auto; }
  .week-days { min-width: 1050px; }
  .work-board { min-height: auto; }
  .equipment-grid, .equipment-grid.five-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; width: 100%; height: 70px; padding: 8px 16px; flex-direction: row; justify-content: space-around; }
  .brand-mark, .nav-item.settings { display: none; }
  .side-nav { margin: 0; display: flex; justify-content: space-around; }
  .nav-item { width: 82px; min-height: 52px; }
  .workspace { padding: 24px 16px 100px; }
  .topbar { align-items: flex-start; }
  .top-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .file-status, .top-actions .icon-button, .top-actions .ghost-button { display: none; }
  .primary-button { padding-inline: 13px; }
  .summary-grid, .summary-grid.capacity-summary, .project-grid { grid-template-columns: 1fr; }
  .advanced-summary, .advanced-team-cards, .advanced-team-form, .advanced-search-results, .advanced-project-info { grid-template-columns: 1fr; }
  .advanced-editor-grid, .advanced-inline-cable-row, .advanced-registry-edit-form, .cable-registry-field-group { grid-template-columns: 1fr; }
  .advanced-reference-line { grid-template-columns: 1fr; }
  .advanced-registry-form { grid-template-columns: 1fr; }
  .advanced-teams { grid-template-columns: 1fr; }
  .advanced-stage-row { grid-template-columns: 1fr 1fr; padding: 12px; }
  .project-list-header { display: none; }
  .project-list-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 16px; }
  .project-list-main, .list-stage-bubbles, .list-next-action { grid-column: 1 / -1; }
  .list-cell > span { display: block; margin-bottom: 3px; }
  .list-next-action span { white-space: normal; }
  .quick-filters { margin-inline: -4px; }
  .project-card { min-height: 245px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .cable-line-editor { grid-template-columns: 1fr 1fr; }
  .cable-line-editor > label:first-child { grid-column: 1 / -1; }
  .drawer-actions { grid-template-columns: 1fr; }
  .calendar-heading { align-items: stretch; flex-direction: column; }
  .calendar-heading .primary-button { align-self: flex-start; }
  .work-board { grid-template-columns: 1fr; padding: 12px; }
  .reports-hub-grid { grid-template-columns: 1fr; }
  .advanced-report-options { grid-template-columns: 1fr; }
  .external-sld-heading { align-items: stretch; flex-direction: column; }
  .external-sld-actions { justify-content: flex-start; }
  .external-sld-library { grid-template-columns: 1fr 1fr; }
  .external-sld-library label { grid-column: 1 / -1; }
  .external-sld-busbar-controls { grid-template-columns: 1fr; }
  .postgres-migration-card { align-items: stretch; flex-direction: column; }
  .equipment-grid, .equipment-grid.five-fields, .meter-readings-grid, .capacity-items-grid, .automation-equipment-row, .equipment-compare-grid { grid-template-columns: 1fr; }
  .sld-sketch-item, .sld-cable-head-controls, .sld-busbar-controls, .sld-template-manager { grid-template-columns: 1fr; }
  .sld-sketcher-toggle { align-items: stretch; flex-direction: column; }
  .sld-sketcher-actions { width: 100%; }
  .sld-sketcher-actions .ghost-button { flex: 1; }
}

@media print {
  html, body { background: #fff !important; }
  body > *:not(#printReport) { display: none !important; }
  #printReport { display: block !important; }
  .print-page, .energization-print-page, .capacity-upgrade-print-page, .automation-print-page, .lv-meter-print-page, .trench-excavation-print-page, .cement-base-print-page { margin: 0; box-shadow: none; }
  .sld-only-page { display: block; page: sld-only; width: 297mm; height: 210mm; min-height: 210mm; padding: 0; color: #111; font-family: Arial, Tahoma, sans-serif; overflow: hidden; }
  .sld-only-diagram { position: relative; height: 210mm; margin: 0; }
  .sld-only-diagram svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .sld-only-diagram .sld-label { top: 5mm; font-size: 17pt; }
}

/* Premium office interface. Screen-only so official report printing is unchanged. */
@media screen {
  :root {
    --ink: #102b25;
    --muted: #667872;
    --line: #d9e2de;
    --paper: #fff;
    --canvas: #f5f7f6;
    --green: #176b55;
    --green-dark: #0d4a3b;
    --mint: #e5f4ed;
    --shadow: 0 12px 30px rgba(18, 50, 42, .065);
  }

  body {
    background: var(--canvas);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr) 228px;
  }

  .sidebar {
    grid-column: 2;
    grid-row: 1;
    align-items: stretch;
    padding: 22px 16px;
    background: linear-gradient(180deg, #0b4a3a 0%, #0c3d32 100%);
    border-left: 1px solid rgba(255, 255, 255, .08);
  }

  .brand-mark {
    width: 100%;
    height: 58px;
    justify-content: flex-start;
    align-items: center;
    padding: 0 15px;
    border-radius: 14px;
    background: rgba(255,255,255,.075);
    box-shadow: none;
  }

  .brand-mark::after {
    content: "إدارة المحطات";
    margin-right: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 750;
  }

  .brand-mark span { flex: 0 0 4px; background: #bce4d3; }
  .side-nav { margin-top: 26px; gap: 7px; }
  .nav-item {
    min-height: 48px;
    grid-template-columns: 28px minmax(0, 1fr);
    place-items: center stretch;
    gap: 10px;
    padding: 0 13px;
    border-radius: 11px;
    color: #bfd2cb;
    text-align: right;
  }
  .nav-item b { text-align: center; font-size: 18px; }
  .nav-item span { font-size: 13px; font-weight: 650; }
  .nav-item:hover { background: rgba(255,255,255,.07); }
  .nav-item.active { background: rgba(255,255,255,.14); box-shadow: inset -3px 0 #b8ead6; }
  .nav-item.settings { margin-top: auto; }

  .workspace {
    grid-column: 1;
    grid-row: 1;
    width: min(1600px, 100%);
    padding: 26px clamp(24px, 3vw, 48px) 72px;
  }

  .topbar {
    min-height: 70px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }
  .eyebrow { font-size: 11px; letter-spacing: .02em; }
  h1 { font-size: clamp(25px, 2.3vw, 33px); }
  .top-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
  .file-status { min-height: 38px; padding: 0; background: transparent; }
  .file-connection { min-height: 32px; background: transparent; }
  .primary-button, .ghost-button { min-height: 42px; border-radius: 10px; }
  .icon-button { min-height: 40px; border-radius: 10px; }
  .primary-button { box-shadow: 0 7px 16px rgba(23,107,85,.18); }

  .workspace-switch {
    width: 100%;
    margin-top: 20px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-radius: 11px;
    border-color: #d7dcb2;
    background: #edf0d6;
    box-shadow: none;
  }
  .workspace-switch button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    border-left: 1px solid #d7dcb2;
    border-radius: 0;
    font-size: 13px;
  }
  .workspace-switch button:last-child { border-left: 0; }
  .workspace-switch button:hover { color: var(--green-dark); background: #e3e8c4; }
  .workspace-switch button.active { background: var(--green-dark); box-shadow: none; }

  .command-bar { margin-top: 20px; }
  .search-box {
    min-height: 48px;
    border-color: var(--line);
    border-radius: 11px;
    box-shadow: none;
  }
  .search-box:focus-within { border-color: #72aa97; box-shadow: 0 0 0 3px rgba(23,107,85,.1); }
  .search-box span { font-size: 22px; }
  .filter-chip { padding: 9px 13px; border: 1px solid transparent; font-size: 12px; }
  .filter-chip:hover, .filter-chip.active { border-color: var(--line); box-shadow: none; }

  .summary-grid { margin-top: 18px; gap: 10px; }
  .summary-card {
    min-height: 82px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
  }
  .summary-card p { margin-bottom: 4px; font-size: 11px; }
  .summary-card strong { font-size: 24px; }
  .summary-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 17px; }

  .projects-section, .calendar-view, .reports-view, .issued-reports-view,
  .advanced-management-view, .external-sld-view { margin-top: 26px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2, .calendar-heading h2 { font-size: 22px; }
  .view-toggle { border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .view-toggle button { border-radius: 6px; }

  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .project-card {
    min-height: 0;
    padding: 14px;
    border-radius: 13px;
    background: #fff;
    box-shadow: none;
  }
  .project-card::after { display: none; }
  .project-card:hover { transform: translateY(-2px); border-color: #91b9aa; box-shadow: var(--shadow); }
  .project-head { align-items: center; }
  .project-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
  .project-meta { gap: 0; font-size: 11px; }
  .project-meta span { padding: 2px 0; }
  .progress-orb { flex-basis: 42px; width: 42px; height: 42px; }
  .progress-orb::before { inset: 5px; }
  .progress-orb strong { font-size: 10px; }
.project-card-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 11px -14px 0; border-block: 1px solid var(--line); background: #fbfcfb; }
.project-card-identifiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 11px -14px 0; border-block: 1px solid var(--line); background: #f7faf8; }
.project-card-identifiers div { min-width: 0; padding: 8px 7px; border-left: 1px solid var(--line); text-align: center; }
.project-card-identifiers div:last-child { border-left: 0; }
.project-card-identifiers span, .project-card-identifiers .copy-fact { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-identifiers span { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.project-card-identifiers .copy-fact { width: 100%; min-width: 0; padding: 0 2px; border: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 800; cursor: copy; }
.project-card-context { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; border-top: 0; }
  .project-card-facts div { min-width: 0; padding: 8px 7px; border-left: 1px solid var(--line); text-align: center; }
  .project-card-facts div:last-child { border-left: 0; }
  .project-card-facts span, .project-card-facts strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .project-card-facts span { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
  .project-card-facts strong { font-size: 11px; font-weight: 800; }
  .next-action { min-height: 36px; margin-top: 10px; padding: 8px 10px; border-radius: 7px; font-size: 12px; font-weight: 750; }
  .stage-track { margin-top: 11px; }
  .stage-bubble { width: 24px; height: 24px; margin-bottom: 4px; font-size: 10px; }
  .stage span { font-size: 11px; font-weight: 750; }
  .card-substages { display: none; }
  .project-card-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 9px; border-top: 1px solid #edf1ef; color: var(--muted); font-size: 10px; font-weight: 700; }
  .project-card-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .current-user-button { cursor: default; border-color: transparent; background: transparent; font-weight: 750; }
  .current-user-button:hover { background: transparent; }
  .project-grid.list-view, .project-list-row { border-radius: 12px; box-shadow: none; }

  .work-board, .week-board, .report-hub-card, .issued-report-card,
  .advanced-project-list, .advanced-project-detail, .advanced-teams,
  .advanced-progress-list, .advanced-registries > article,
  .external-sld-editor, .external-sld-library {
    border-radius: 13px;
    background: #fff;
    box-shadow: none;
  }
  .work-board { padding: 12px; }
  .work-board-section { border-radius: 10px; }
  .week-board { border-radius: 13px; }
  .week-header, .week-day { background: #fff; }
  .reports-hub-grid { gap: 12px; }
  .report-hub-card { padding: 18px; }
  .report-hub-card h3 { font-size: 16px; }
  .report-hub-icon { border-radius: 10px; }
  .reports-selected-project { border: 1px solid #d6e7df; border-radius: 9px; }

  .advanced-tabs { border-radius: 9px; }
  .advanced-tabs button { border-radius: 6px; }
  .advanced-project-select { border-radius: 8px; }
  .advanced-project-detail > header, .advanced-progress-list > header,
  .advanced-registries > article > header { background: #f8faf9; }
  .advanced-editor-grid input, .advanced-editor-grid select,
  .advanced-editor-grid textarea, .advanced-stage-row input,
  .advanced-stage-row select, .advanced-team-form input,
  .advanced-team-form select, .advanced-registry-form input,
  .advanced-registry-form select { border-radius: 7px; }

  .external-sld-editor { padding: 14px; background: #fff; }
  .external-sld-canvas { border-radius: 8px; }
  .external-sld-toolbar .ghost-button { border-radius: 8px; }

  .drawer {
    width: min(620px, 94vw);
    padding: 24px;
    background: #f6f8f7;
    box-shadow: -18px 0 45px rgba(12,42,34,.18);
  }
  .drawer-close, .modal-close { border-radius: 9px; }
  .drawer-stage, .drawer-stage-group, .drawer-block { border-radius: 11px; }
  .drawer-actions button { border-radius: 9px; }
  .modal { border-radius: 15px; box-shadow: 0 25px 70px rgba(13,46,37,.2); }
  .modal input, .modal select, .modal textarea { border-radius: 8px; }

  #cloudAuthOverlay {
    background: #f3f6f4 !important;
  }
  #cloudAuthOverlay form {
    border: 1px solid var(--line);
    border-radius: 16px !important;
    box-shadow: 0 24px 70px rgba(13,46,37,.14) !important;
  }
  #cloudAuthOverlay input {
    min-height: 44px;
    border-color: var(--line) !important;
    border-radius: 8px !important;
    background: #fbfcfc;
  }
  #cloudAuthOverlay button { min-height: 44px; border-radius: 8px !important; }
}

@media screen and (max-width: 1180px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) 88px; }
  .sidebar { align-items: center; padding-inline: 12px; }
  .brand-mark { width: 52px; justify-content: center; padding: 0; }
  .brand-mark::after { display: none; }
  .nav-item { width: 62px; min-height: 56px; grid-template-columns: 1fr; gap: 2px; padding: 5px; text-align: center; }
  .nav-item span { font-size: 9px; }
  .nav-item.active { box-shadow: inset -2px 0 #b8ead6; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: 72px;
    padding: 8px 10px;
    flex-direction: row;
    justify-content: center;
  }
  .brand-mark, .nav-item.settings { display: none; }
  .side-nav { width: 100%; margin: 0; display: flex; justify-content: space-around; gap: 2px; }
  .nav-item { width: auto; min-width: 52px; min-height: 54px; }
  .workspace { padding: 20px 14px 94px; }
  .topbar { align-items: flex-start; }
  .project-grid, .summary-grid, .summary-grid.capacity-summary { grid-template-columns: 1fr; }
  .workspace-switch { overflow-x: auto; }
  .workspace-switch button { flex: 0 0 132px; }
}

/* Premium UX polish: preserves the compact information density */
@media screen {
  .nav-item .nav-icon { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; font: 800 16px/1 "Segoe UI Symbol", sans-serif; }
  .nav-item .nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .nav-item.active .nav-icon { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.12); }
  .account-menu-wrap { position: relative; }
  .current-user-button { display: flex; align-items: center; gap: 8px; max-width: 230px; }
  .current-user-button #currentUserLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-avatar { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #fff; background: var(--green); font-size: 12px; }
  .account-menu { position: absolute; top: calc(100% + 7px); left: 0; z-index: 40; width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 36px rgba(15,39,32,.16); }
  .account-menu[hidden] { display: none; }
  .account-signout { width: 100%; min-height: 40px; border: 0; border-radius: 9px; color: #a13a3a; text-align: right; background: transparent; font: 750 12px inherit; cursor: pointer; }
  .account-signout:hover { background: #fff0f0; }
  .project-card h3 { font-size: 17px; line-height: 1.35; }
  .project-card-facts span { font-size: 10px; }
  .project-card-identifiers span { font-size: 10px; }
  .project-card-identifiers .copy-fact { font-size: 12px; }
  .project-card-facts strong, .project-card-facts .copy-fact { font-size: 12px; }
  .project-card-facts .copy-fact { display: block; width: 100%; min-width: 0; padding: 0 2px; border: 0; color: var(--ink); white-space: normal; overflow-wrap: anywhere; background: transparent; font-weight: 800; cursor: copy; }
  .project-card-facts .copy-fact:hover { color: var(--green); text-decoration: underline dotted; text-underline-offset: 3px; }
  .project-card-facts div:nth-child(-n+2) { background: #f7faf8; }
  .project-card-footer { font-size: 11px; }
  .modal { max-height: calc(100dvh - 36px); overflow-y: auto; }
  .modal-header { position: sticky; top: 0; z-index: 3; flex: 0 0 auto; padding-bottom: 13px; border-bottom: 1px solid var(--line); background: inherit; }
  .modal form { padding-inline: 2px; }
  .modal form > .modal-footer { position: sticky; bottom: 0; z-index: 3; margin-inline: -2px; padding: 14px 2px 2px; background: linear-gradient(180deg,rgba(255,255,255,0),#fff 20%); }
  .project-drawer { padding: 0; background: #f7faf8; }
  .project-drawer > .drawer-close { position: sticky; top: 16px; z-index: 4; display: block; margin: 16px 16px -40px auto; box-shadow: 0 7px 18px rgba(15,39,32,.1); }
  .project-drawer > #drawerContent { margin-inline: 26px; padding-block: 26px; }
  .file-connection { font-weight: 750; }
}

@media screen and (max-width: 720px) {
  .project-number-fields { grid-template-columns: 1fr; }
  .top-actions .account-menu-wrap, .top-actions .file-status { display: block; }
  .top-actions .current-user-button { display: flex; }
  .top-actions { width: 100%; justify-content: space-between; }
  .current-user-button { max-width: 180px; }
}
