:root {
  --navy: #062c58;
  --navy-deep: #031f40;
  --blue: #087cb5;
  --cyan: #1db8d5;
  --cyan-light: #77e2ed;
  --sky: #eaf8ff;
  --mint: #ebfbf7;
  --white: #fff;
  --surface: #f6fafc;
  --text: #18364d;
  --muted: #6b8191;
  --line: #d9e8ee;
  --danger: #cf4662;
  --warning: #e09a25;
  --success: #148c77;
  --gradient: linear-gradient(135deg, #052d5a 0%, #087fb7 52%, #20bdd5 100%);
  --gradient-light: linear-gradient(135deg, #e7f8ff 0%, #fff 48%, #e7fbf7 100%);
  --shadow: 0 20px 55px rgba(6, 64, 96, 0.1);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--surface); font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; font-feature-settings: "palt"; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; }
::selection { background: var(--cyan); color: #fff; }

.button { align-items: center; border: 0; border-radius: 999px; display: inline-flex; font-size: 12px; font-weight: 800; gap: 14px; justify-content: center; min-height: 48px; padding: 0 22px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button-primary { background: var(--gradient); box-shadow: 0 13px 27px rgba(7, 117, 164, .2); color: #fff; }
.button-primary:hover { box-shadow: 0 16px 32px rgba(7, 117, 164, .28); }
.button-secondary { background: #fff; border: 1px solid #cfe2e9; color: var(--navy); }
.button-small { background: #e8f8f5; color: #087e75; min-height: 38px; padding: 0 16px; }
.button-full { width: 100%; }
.text-link { color: var(--blue); font-size: 11px; font-weight: 800; white-space: nowrap; }

/* authentication */
.auth-body { min-height: 100vh; background: var(--gradient-light); }
.auth-shell { display: grid; grid-template-columns: minmax(470px, 1.1fr) minmax(420px, .9fr); min-height: 100vh; }
.auth-visual { background: linear-gradient(140deg, rgba(3,31,64,.96), rgba(7,105,158,.93) 56%, rgba(29,184,213,.86)), url("../img/shield-logo.png") center/52% no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; overflow: hidden; padding: clamp(36px, 5vw, 72px); position: relative; }
.auth-visual::after { background: linear-gradient(180deg, transparent, rgba(3,31,64,.22)); content: ""; inset: 0; pointer-events: none; position: absolute; }
.auth-brand, .auth-message, .auth-points { position: relative; z-index: 1; }
.auth-brand { align-items: center; display: flex; gap: 18px; }
.auth-brand img { background: rgba(255,255,255,.94); border-radius: 16px; height: 72px; object-fit: contain; padding: 6px; width: 72px; }
.auth-brand span { font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.auth-message { margin: auto 0; max-width: 690px; padding: 75px 0; }
.auth-message > p:first-child { color: #b9f4f5; font-size: 10px; font-weight: 800; letter-spacing: .19em; margin: 0 0 28px; }
.auth-message h1 { font-size: clamp(48px, 5.7vw, 84px); letter-spacing: -.06em; line-height: 1.18; margin: 0; }
.auth-message h1 span { color: #a9f0f3; }
.auth-description { color: rgba(255,255,255,.8); font-size: 14px; line-height: 2; margin: 34px 0 0; }
.auth-points { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-points span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: 10px; font-weight: 700; padding: 10px 15px; }
.auth-panel { align-items: center; display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(30px, 6vw, 90px); }
.auth-card { background: rgba(255,255,255,.92); border: 1px solid rgba(7,124,181,.12); border-radius: 24px; box-shadow: var(--shadow); max-width: 500px; padding: clamp(34px, 4.5vw, 58px); width: 100%; }
.form-heading { margin-bottom: 34px; }
.form-heading > p { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .2em; margin: 0 0 13px; }
.form-heading h2 { color: var(--navy); font-size: 34px; letter-spacing: -.04em; margin: 0 0 10px; }
.form-heading > span { color: var(--muted); font-size: 12px; }
.auth-note { color: #8498a7; font-size: 10px; line-height: 1.7; margin: 24px 0 0; text-align: center; }
.auth-copyright { color: #91a5b3; font-size: 9px; margin: 24px 0 0; }
.install-shell { display: grid; grid-template-columns: .78fr 1.22fr; margin: 0 auto; min-height: 100vh; }
.install-brand { background: var(--gradient); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: clamp(45px, 7vw, 100px); }
.install-brand img { background: #fff; border-radius: 22px; height: 140px; margin-bottom: 34px; object-fit: contain; padding: 12px; width: 125px; }
.install-brand > p { color: #b9f4f5; font-size: 10px; font-weight: 800; letter-spacing: .2em; margin: 0 0 24px; }
.install-brand h1 { font-size: clamp(40px, 4.7vw, 70px); letter-spacing: -.055em; line-height: 1.25; margin: 0; }
.install-brand > span { color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.8; margin-top: 30px; }
.install-card { background: #fff; padding: clamp(45px, 7vw, 100px); }
.install-card .stack-form { max-width: 740px; }
.install-card fieldset { border: 0; margin: 0; padding: 25px 0; }
.install-card fieldset + fieldset { border-top: 1px solid var(--line); }
.install-card legend { color: var(--navy); font-size: 14px; font-weight: 800; margin-bottom: 18px; }
.install-success { margin: 15vh auto 0; max-width: 550px; }
.install-success > span { color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.install-success h2 { color: var(--navy); font-size: 46px; letter-spacing: -.05em; margin: 18px 0; }
.install-success p { color: var(--muted); line-height: 1.9; margin-bottom: 30px; }

/* app chrome */
.app-shell { min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy-deep), #063f70 62%, #087ca4); bottom: 0; color: #fff; display: flex; flex-direction: column; left: 0; overflow-y: auto; padding: 28px 20px; position: fixed; top: 0; width: var(--sidebar); z-index: 50; }
.sidebar-brand { align-items: center; border-bottom: 1px solid rgba(255,255,255,.13); display: flex; gap: 12px; padding: 0 5px 24px; }
.sidebar-brand img { background: #fff; border-radius: 12px; height: 54px; object-fit: contain; padding: 4px; width: 54px; }
.sidebar-brand div { display: flex; flex-direction: column; gap: 4px; }
.sidebar-brand strong { font-size: 12px; letter-spacing: .08em; }
.sidebar-brand span { color: #a7e9ee; font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 7px; padding: 30px 0; }
.nav-item { border: 1px solid transparent; border-radius: 12px; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; position: relative; transition: background .18s ease, border .18s ease; }
.nav-item span { font-size: 13px; font-weight: 800; }
.nav-item small { color: rgba(255,255,255,.55); font-size: 8px; letter-spacing: .08em; }
.nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.is-active { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.16); box-shadow: 0 10px 22px rgba(0,0,0,.12); }
.nav-item.is-active::before { background: var(--cyan-light); border-radius: 999px; content: ""; height: 24px; left: -5px; position: absolute; top: 16px; width: 3px; }
.sidebar-help { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; margin-top: auto; padding: 18px; }
.sidebar-help span { color: #a6eef1; font-size: 7px; font-weight: 800; letter-spacing: .16em; }
.sidebar-help strong { display: block; font-size: 12px; line-height: 1.65; margin-top: 9px; }
.app-main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { align-items: center; background: rgba(255,255,255,.94); border-bottom: 1px solid rgba(9,90,125,.1); display: flex; height: 82px; justify-content: space-between; padding: 0 clamp(24px, 4vw, 58px); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(18px); }
.topbar-context { display: flex; flex-direction: column; gap: 4px; }
.topbar-context span { color: var(--muted); font-size: 9px; }
.topbar-context strong { color: var(--navy); font-size: 17px; }
.topbar-actions { align-items: center; display: flex; gap: 16px; }
.quick-report { background: var(--gradient); border-radius: 999px; box-shadow: 0 10px 24px rgba(7,117,164,.18); color: #fff; font-size: 11px; font-weight: 800; padding: 14px 19px; }
.user-menu { position: relative; }
.user-menu > button { align-items: center; background: transparent; border: 0; display: flex; gap: 10px; padding: 4px; text-align: left; }
.user-avatar { align-items: center; background: linear-gradient(135deg, #dff7ff, #dff8f2); border: 1px solid #c9e9eb; border-radius: 50%; color: var(--navy); display: inline-flex; flex: 0 0 auto; font-size: 12px; font-weight: 800; height: 38px; justify-content: center; width: 38px; }
.user-menu > button > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.user-menu strong { color: var(--navy); font-size: 11px; }
.user-menu small { color: var(--muted); font-size: 8px; }
.user-dropdown { background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); display: none; min-width: 220px; padding: 15px; position: absolute; right: 0; top: calc(100% + 12px); }
.user-dropdown.is-open { display: block; }
.user-dropdown p { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; margin: 0 0 10px; overflow-wrap: anywhere; padding: 0 4px 12px; }
.user-dropdown button { background: transparent; border: 0; color: var(--danger); font-size: 11px; font-weight: 800; padding: 7px 4px; width: 100%; text-align: left; }
.menu-button { background: transparent; border: 0; display: none; height: 42px; padding: 10px; width: 42px; }
.menu-button span { background: var(--navy); display: block; height: 2px; margin: 5px 0; width: 22px; }
.content { padding: clamp(34px, 4.5vw, 62px) clamp(24px, 4vw, 58px) 70px; }
.app-footer { border-top: 1px solid var(--line); color: #91a4b1; display: flex; font-size: 8px; justify-content: space-between; margin: 0 clamp(24px, 4vw, 58px); padding: 25px 0 35px; }
.sidebar-backdrop { display: none; }

/* page basics */
.page-heading { align-items: flex-end; display: flex; gap: 30px; justify-content: space-between; margin: 0 0 38px; }
.page-heading > div:first-child > p { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .19em; margin: 0 0 12px; }
.page-heading h1 { color: var(--navy); font-size: clamp(34px, 4vw, 55px); letter-spacing: -.055em; line-height: 1.2; margin: 0; }
.page-heading > div:first-child > span { color: var(--muted); display: block; font-size: 12px; line-height: 1.8; margin-top: 13px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 38px rgba(6,70,101,.06); }
.panel-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 24px 27px; }
.panel-heading p { color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: .18em; margin: 0 0 7px; }
.panel-heading h2 { color: var(--navy); font-size: 20px; letter-spacing: -.025em; margin: 0; }
.panel-heading > a { color: var(--blue); font-size: 10px; font-weight: 800; }
.panel-heading > span { color: var(--muted); font-size: 11px; }
.flash { align-items: center; border: 1px solid; border-radius: 12px; display: flex; font-size: 12px; font-weight: 700; justify-content: space-between; margin: 0 0 22px; padding: 14px 17px; }
.flash button { background: transparent; border: 0; color: inherit; font-size: 18px; }
.flash-success { background: #e9faf5; border-color: #bce8da; color: #147b69; }
.flash-error { background: #fff0f3; border-color: #f1c7d1; color: #ad3850; }
.flash-info { background: var(--sky); border-color: #c8e7f1; color: var(--blue); }
.empty-state { grid-column: 1 / -1; padding: 50px 25px; text-align: center; }
.empty-state strong { color: var(--navy); font-size: 15px; }
.empty-state p { color: var(--muted); font-size: 11px; margin: 10px 0 0; }
.status { border-radius: 999px; display: inline-flex; font-size: 8px; font-style: normal; font-weight: 800; justify-content: center; padding: 6px 9px; white-space: nowrap; }
.status-waiting { background: #edf2f5; color: #63798a; }
.status-progress { background: #e2f7ff; color: #0877ad; }
.status-hold { background: #fff5df; color: #a56d16; }
.status-complete { background: #e4f8f1; color: #117865; }
.progress { background: #e7eff2; border-radius: 999px; height: 6px; overflow: hidden; }
.progress i { background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; display: block; height: 100%; }

/* forms */
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .search-field > span, .select-field > span { color: #526f82; font-size: 10px; font-weight: 800; }
.field input, .field select, .field textarea, .search-field input, .select-field select { appearance: none; background: #fbfdfe; border: 1px solid #cfe1e8; border-radius: 10px; color: var(--text); font-size: 13px; min-height: 48px; outline: 0; padding: 11px 13px; transition: border .15s ease, box-shadow .15s ease, background .15s ease; width: 100%; }
.field textarea { line-height: 1.75; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-field input:focus, .select-field select:focus { background: #fff; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(29,184,213,.12); }
.field select, .select-field select { background-image: linear-gradient(45deg,transparent 50%,#5c7789 50%),linear-gradient(135deg,#5c7789 50%,transparent 50%); background-position: calc(100% - 17px) 21px,calc(100% - 12px) 21px; background-repeat: no-repeat; background-size: 5px 5px,5px 5px; padding-right: 34px; }
.form-layout { display: flex; flex-direction: column; gap: 20px; margin: 0 auto; max-width: 1150px; }
.form-section { padding: 30px; }
.form-section-heading { align-items: flex-start; display: flex; gap: 17px; margin-bottom: 28px; }
.form-section-heading > span { align-items: center; background: var(--gradient); border-radius: 50%; color: #fff; display: flex; flex: 0 0 auto; font-size: 9px; font-weight: 800; height: 35px; justify-content: center; width: 35px; }
.form-section-heading h2 { color: var(--navy); font-size: 20px; margin: 1px 0 6px; }
.form-section-heading p { color: var(--muted); font-size: 10px; margin: 0; }
.form-grid { display: grid; gap: 19px; }
.form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field-wide { grid-column: 1 / -1; }
.form-actions { align-items: center; display: flex; gap: 12px; justify-content: flex-end; padding: 10px 0; }
.check-row { align-items: center; color: #496579; cursor: pointer; display: flex; font-size: 11px; font-weight: 700; gap: 9px; }
.check-row input { accent-color: var(--blue); height: 18px; width: 18px; }
.drop-field { align-items: center; background: linear-gradient(135deg,#f2fbff,#f2fcf9); border: 1px dashed #8dcbd9; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; min-height: 130px; padding: 24px; text-align: center; }
.drop-field input { max-width: 100%; }
.drop-field strong { color: var(--navy); font-size: 13px; margin-top: 14px; }
.drop-field span { color: var(--muted); font-size: 9px; margin-top: 5px; }
.drop-field.large { min-height: 185px; }
.report-submit { align-items: center; display: grid; gap: 35px; grid-template-columns: 1fr minmax(230px,.35fr); padding: 25px 30px; }
.report-submit strong { color: var(--navy); font-size: 14px; }
.report-submit p { color: var(--muted); font-size: 10px; margin: 5px 0 0; }

/* dashboard */
.metric-grid { display: grid; gap: 16px; grid-template-columns: repeat(4,1fr); margin-bottom: 22px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px rgba(6,70,101,.05); display: grid; grid-template-columns: 1fr auto; min-height: 142px; padding: 24px; }
.metric-card > span { color: #537083; font-size: 11px; font-weight: 800; }
.metric-card > strong { color: var(--navy); font-size: 48px; letter-spacing: -.06em; line-height: 1; }
.metric-card > small { align-self: end; color: #9aadb8; font-size: 7px; font-weight: 800; grid-column: 1 / -1; letter-spacing: .15em; }
.metric-primary { background: var(--gradient); border: 0; }
.metric-primary > span, .metric-primary > strong { color: #fff; }
.metric-primary > small { color: rgba(255,255,255,.6); }
.alert-panel { align-items: stretch; background: linear-gradient(135deg,#fff8e9,#fff); border: 1px solid #f0dbb0; border-radius: 17px; display: grid; gap: 20px; grid-template-columns: .8fr 1.2fr; margin-bottom: 22px; overflow: hidden; padding: 23px 27px; }
.alert-copy span { color: #c38119; font-size: 8px; font-weight: 800; letter-spacing: .17em; }
.alert-copy strong { color: #79511a; display: block; font-size: 14px; margin: 8px 0; }
.alert-copy p { color: #8f7652; font-size: 10px; line-height: 1.7; margin: 0; }
.alert-list { display: grid; gap: 7px; grid-template-columns: repeat(2,1fr); }
.alert-list a { background: rgba(255,255,255,.78); border: 1px solid #ecd8b4; border-radius: 10px; display: grid; gap: 4px; padding: 11px 13px; }
.alert-list span { color: #a9803f; font-size: 7px; }
.alert-list strong { color: var(--navy); font-size: 10px; }
.alert-list small { color: var(--muted); font-size: 8px; }
.dashboard-grid { display: grid; gap: 22px; grid-template-columns: minmax(0,1.38fr) minmax(320px,.62fr); }
.project-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 23px; grid-template-columns: minmax(270px,1fr) .55fr .55fr; padding: 20px 27px; transition: background .15s ease; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: #f8fcfd; }
.project-main { align-items: flex-start; display: flex; gap: 13px; }
.project-main small { color: var(--blue); display: block; font-size: 8px; margin-bottom: 4px; }
.project-main strong { color: var(--navy); display: block; font-size: 13px; }
.project-main p { color: var(--muted); font-size: 9px; margin: 5px 0 0; }
.project-meta { display: flex; flex-direction: column; gap: 9px; }
.project-meta span { color: var(--muted); font-size: 8px; }
.project-meta strong { color: #3e5c70; display: block; font-size: 9px; margin-top: 2px; }
.progress-block > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; }
.progress-block span { color: var(--muted); font-size: 8px; }
.progress-block strong { color: var(--navy); font-size: 11px; }
.progress-block small { color: #8aa0ae; display: block; font-size: 7px; margin-top: 8px; }
.timeline-list { padding: 4px 25px 13px; }
.timeline-list > a { display: grid; gap: 15px; grid-template-columns: 40px 1fr; padding: 17px 0; position: relative; }
.timeline-list > a + a { border-top: 1px solid var(--line); }
.timeline-list time { color: var(--blue); font-size: 14px; font-weight: 800; }
.timeline-list small { color: #8aa0ae; font-size: 7px; }
.timeline-list strong { color: var(--navy); display: block; font-size: 11px; margin: 3px 0; }
.timeline-list p { color: var(--muted); font-size: 9px; line-height: 1.6; margin: 0 0 6px; }
.timeline-list > a > div > span { color: #79909f; font-size: 8px; }
.timeline-list em { margin-left: 5px; }

/* filters, project cards */
.filter-bar { align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: 15px; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 22px; padding: 17px 20px; }
.filter-bar form { align-items: flex-end; display: flex; flex: 1; gap: 10px; }
.search-field, .select-field { display: flex; flex-direction: column; gap: 6px; }
.search-field { min-width: 280px; }
.search-field input, .select-field select, .field.inline input { min-height: 43px; }
.select-field { min-width: 140px; }
.field.inline { min-width: 145px; }
.result-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.project-card-grid { display: grid; gap: 18px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.project-card { background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 12px 32px rgba(6,70,101,.05); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.project-card > a { display: block; padding: 23px; }
.project-card-top { align-items: center; display: flex; justify-content: space-between; }
.project-card-top small { color: var(--blue); font-size: 8px; font-weight: 800; }
.project-card h2 { color: var(--navy); font-size: 18px; line-height: 1.45; margin: 18px 0 8px; min-height: 52px; }
.project-address { color: var(--muted); font-size: 9px; margin: 0 0 20px; }
.project-card-meta { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin: 0; padding: 18px 0; }
.project-card-meta div { min-width: 0; }
.project-card-meta dt { color: #8ca0ad; font-size: 7px; margin-bottom: 4px; }
.project-card-meta dd { color: #415e72; font-size: 9px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-progress { padding: 18px 0 5px; }
.project-card-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; }
.project-card-progress span { color: var(--muted); font-size: 8px; }
.project-card-progress strong { color: var(--navy); font-size: 11px; }
.project-card-footer { align-items: center; display: flex; justify-content: space-between; padding-top: 16px; }
.project-card-footer span { color: var(--muted); font-size: 8px; }
.project-card-footer strong { color: var(--blue); font-size: 9px; }

/* project details */
.project-summary { background: var(--gradient); border-radius: 18px; color: #fff; display: grid; gap: 35px; grid-template-columns: .48fr 1.52fr; margin-bottom: 18px; padding: 26px 30px; }
.summary-status { display: grid; gap: 10px; grid-template-columns: auto 1fr; }
.summary-status .status { align-self: start; background: rgba(255,255,255,.15); color: #fff; }
.summary-status > div:nth-child(2) { display: flex; justify-content: space-between; }
.summary-status small { color: rgba(255,255,255,.68); font-size: 8px; }
.summary-status strong { font-size: 16px; }
.summary-status .progress { background: rgba(255,255,255,.2); grid-column: 1/-1; }
.summary-status .progress i { background: #aef3f4; }
.project-summary dl { display: grid; gap: 15px 26px; grid-template-columns: repeat(3,1fr); margin: 0; }
.project-summary dt { color: rgba(255,255,255,.58); font-size: 7px; margin-bottom: 4px; }
.project-summary dd { font-size: 10px; font-weight: 700; margin: 0; }
.tabs { background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; gap: 5px; margin-bottom: 22px; overflow-x: auto; padding: 6px; }
.tabs a { border-radius: 9px; color: var(--muted); font-size: 10px; font-weight: 800; padding: 12px 20px; white-space: nowrap; }
.tabs a.is-active { background: var(--gradient); color: #fff; }
.detail-grid { display: grid; gap: 22px; grid-template-columns: minmax(0,1.22fr) minmax(320px,.78fr); margin-bottom: 22px; }
.detail-list { display: grid; grid-template-columns: repeat(2,1fr); margin: 0; padding: 5px 27px 25px; }
.detail-list div { border-bottom: 1px solid var(--line); padding: 17px 0; }
.detail-list div:nth-child(odd):not(.wide) { padding-right: 15px; }
.detail-list .wide { grid-column: 1/-1; }
.detail-list dt { color: #879ca9; font-size: 8px; margin-bottom: 5px; }
.detail-list dd { color: #405e72; font-size: 10px; line-height: 1.8; margin: 0; }
.report-mini-list { padding: 5px 25px 20px; }
.report-mini-list > div:not(.empty-state) { display: grid; gap: 5px 10px; grid-template-columns: auto auto 1fr; padding: 15px 0; }
.report-mini-list > div + div { border-top: 1px solid var(--line); }
.report-mini-list time { color: var(--blue); font-size: 9px; font-weight: 800; }
.report-mini-list strong { color: var(--navy); font-size: 10px; grid-column: 1/-1; }
.report-mini-list p { color: var(--muted); font-size: 8px; grid-column: 1/-1; margin: 0; }
.file-grid { display: grid; gap: 12px; grid-template-columns: repeat(3,1fr); padding: 24px; }
.file-card { background: linear-gradient(135deg,#f6fbfd,#fff); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.file-card > span { color: var(--cyan); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.file-card strong { color: var(--navy); display: block; font-size: 10px; margin: 8px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card p { color: var(--muted); font-size: 8px; margin: 0; }
.section-toolbar { align-items: center; display: flex; justify-content: space-between; margin: 5px 0 18px; }
.section-toolbar > div { display: flex; flex-direction: column; gap: 4px; }
.section-toolbar strong { color: var(--navy); font-size: 15px; }
.section-toolbar span { color: var(--muted); font-size: 9px; }
.report-list { display: flex; flex-direction: column; gap: 16px; }
.report-card { background: #fff; border: 1px solid var(--line); border-radius: 17px; display: grid; grid-template-columns: 105px 1fr; overflow: hidden; }
.report-date { align-items: center; background: var(--gradient-light); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 25px 12px; }
.report-date strong { color: var(--navy); font-size: 38px; line-height: 1; }
.report-date span { color: var(--blue); font-size: 9px; font-weight: 800; margin-top: 3px; }
.report-date small { color: var(--muted); font-size: 8px; margin-top: 18px; }
.report-content { padding: 24px 27px; }
.report-top { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 16px; }
.report-top > div:first-child { align-items: center; display: flex; gap: 9px; }
.report-top strong { color: var(--navy); font-size: 11px; }
.report-top small { color: var(--muted); font-size: 9px; }
.report-actions { display: flex; gap: 12px; }
.report-actions span, .report-actions a { color: var(--blue); font-size: 9px; font-weight: 800; }
.report-content dl { display: grid; gap: 0 22px; grid-template-columns: repeat(2,1fr); margin: 0; }
.report-content dl > div { border-bottom: 1px solid var(--line); padding: 15px 0; }
.report-content dl > div:nth-child(2), .report-content dl > div:nth-child(5) { grid-column: 1/-1; }
.report-content dt { color: #879ba9; font-size: 8px; margin-bottom: 6px; }
.report-content dd { color: #405e72; font-size: 10px; line-height: 1.75; margin: 0; }
.confirm-form { display: flex; justify-content: flex-end; padding-top: 16px; }
.files-layout { grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); }
.files-layout.is-readonly { grid-template-columns: 1fr; }
.file-table { padding: 7px 25px 20px; }
.file-table > a { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: 47px 1fr auto auto; padding: 15px 0; }
.file-table > a:last-child { border-bottom: 0; }
.file-kind { align-items: center; background: var(--sky); border-radius: 8px; color: var(--blue); display: flex; font-size: 7px; font-weight: 800; height: 40px; justify-content: center; }
.file-table strong { color: var(--navy); display: block; font-size: 10px; }
.file-table small { color: var(--muted); display: block; font-size: 8px; margin-top: 4px; }
.file-table > a > span:nth-last-child(2) { color: var(--muted); font-size: 8px; }
.file-table b { color: var(--blue); }
.upload-panel { align-self: start; }
.upload-panel form { padding: 24px; }
.member-panel { padding-bottom: 25px; }
.member-grid { display: grid; gap: 12px; grid-template-columns: repeat(3,1fr); padding: 24px; }
.member-check { align-items: center; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; display: flex; gap: 12px; padding: 14px; }
.member-check input { accent-color: var(--blue); }
.member-check strong { color: var(--navy); display: block; font-size: 10px; }
.member-check small { color: var(--muted); display: block; font-size: 8px; margin-top: 3px; }
.member-check:has(input:checked) { background: var(--sky); border-color: #8ccedc; }
.member-check.readonly { cursor: default; }
.member-panel .form-actions { padding: 0 24px; }

/* tables and global files */
.table-panel { overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { border-collapse: collapse; min-width: 980px; width: 100%; }
th { background: #f5fafc; color: #7890a0; font-size: 8px; letter-spacing: .06em; padding: 13px 16px; text-align: left; }
td { border-top: 1px solid var(--line); color: #486579; font-size: 10px; padding: 16px; vertical-align: top; }
td strong { color: var(--navy); display: block; font-size: 10px; }
td small { color: #879ba8; display: block; font-size: 8px; margin-top: 4px; }
td > span { display: block; line-height: 1.6; max-width: 320px; }
.table-link { color: var(--blue); font-size: 9px; font-weight: 800; white-space: nowrap; }
.file-browser-grid { display: grid; gap: 17px; grid-template-columns: repeat(3,1fr); }
.browser-file-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; display: grid; grid-template-columns: 78px 1fr; overflow: hidden; }
.browser-file-type { align-items: center; background: linear-gradient(180deg,#edf5f8,#e2edf2); color: #6b8191; display: flex; justify-content: center; }
.browser-file-type.is-photo { background: var(--gradient); color: #fff; }
.browser-file-type span { font-size: 7px; font-weight: 800; letter-spacing: .1em; transform: rotate(-90deg); white-space: nowrap; }
.browser-file-card > div:last-child { min-width: 0; padding: 19px; }
.browser-file-card small { color: var(--blue); font-size: 7px; }
.browser-file-card h2 { color: var(--navy); font-size: 12px; margin: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-file-card p { color: var(--muted); font-size: 8px; margin: 0 0 13px; }
.browser-file-card dl { border-top: 1px solid var(--line); margin: 0; padding: 10px 0; }
.browser-file-card dl div { display: grid; grid-template-columns: 48px 1fr; padding: 3px 0; }
.browser-file-card dt { color: #8aa0ae; font-size: 7px; }
.browser-file-card dd { color: #526e81; font-size: 8px; margin: 0; }
.browser-file-actions { display: flex; gap: 8px; justify-content: space-between; }
.browser-file-actions a { color: var(--blue); font-size: 8px; font-weight: 800; }
.browser-file-actions .download { color: var(--success); }

/* users */
.users-layout { grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); }
.user-list { padding: 5px 24px 20px; }
.user-list > a { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 13px; grid-template-columns: 40px 1fr auto; padding: 15px 5px; }
.user-list > a.is-active { background: var(--sky); margin: 0 -10px; padding-left: 15px; padding-right: 15px; }
.user-list strong { color: var(--navy); display: block; font-size: 11px; }
.user-list p { color: var(--muted); font-size: 8px; margin: 3px 0; }
.user-list small { color: #78909f; font-size: 8px; }
.user-list em { border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 800; padding: 6px 9px; }
.user-list em.is-on { background: #e7f8f2; color: #137b68; }
.user-list em.is-off { background: #f0f2f3; color: #7b8d99; }
.user-form-panel { align-self: start; }
.user-form-panel form { padding: 24px; }

/* interactive preview */
.demo-banner { align-items: center; background: linear-gradient(135deg, #e6f8ff, #f2fdf8); border: 1px solid #bfe2eb; border-radius: 14px; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 28px; padding: 16px 20px; }
.demo-banner > div { display: flex; flex-direction: column; gap: 4px; }
.demo-banner span { color: var(--blue); font-size: 7px; font-weight: 800; letter-spacing: .18em; }
.demo-banner strong { color: var(--navy); font-size: 12px; }
.demo-banner p { color: var(--muted); font-size: 9px; line-height: 1.7; margin: 0; text-align: right; }
.demo-toast { background: var(--navy-deep); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; bottom: 24px; box-shadow: 0 16px 38px rgba(3,31,64,.28); color: #fff; font-size: 11px; font-weight: 700; left: 50%; max-width: calc(100vw - 32px); opacity: 0; padding: 14px 22px; pointer-events: none; position: fixed; transform: translate(-50%, 18px); transition: opacity .2s ease, transform .2s ease; z-index: 100; }
.demo-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.demo-reset { background: transparent; border: 0; }
.demo-gallery { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 22px; }
.demo-gallery article { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px rgba(6,70,101,.06); overflow: hidden; }
.demo-gallery img { aspect-ratio: 1.5 / 1; height: auto; object-fit: cover; width: 100%; }
.demo-gallery article > div { display: flex; flex-direction: column; gap: 5px; padding: 15px 17px; }
.demo-gallery span { color: var(--blue); font-size: 8px; font-weight: 800; }
.demo-gallery strong { color: var(--navy); font-size: 11px; }
.demo-gallery small { color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-file-actions button { background: transparent; border: 0; padding: 0; }
.user-list > button { align-items: center; background: transparent; border: 0; border-bottom: 1px solid var(--line); display: grid; gap: 13px; grid-template-columns: 40px 1fr auto; padding: 15px 5px; text-align: left; width: 100%; }
.user-list > button.is-active { background: var(--sky); margin: 0 -10px; padding-left: 15px; padding-right: 15px; width: calc(100% + 20px); }
.user-list > button strong { color: var(--navy); display: block; font-size: 11px; }
.user-list > button p { color: var(--muted); font-size: 8px; margin: 3px 0; }
.user-list > button small { color: #78909f; font-size: 8px; }
.user-list > button em { border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 800; padding: 6px 9px; }
.user-list > button em.is-on { background: #e7f8f2; color: #137b68; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .project-card-grid, .file-browser-grid { grid-template-columns: repeat(2,1fr); }
  .project-row { grid-template-columns: minmax(270px,1fr) .55fr; }
  .project-row .project-meta { display: none; }
  .filter-bar form { flex-wrap: wrap; }
}

@media (max-width: 930px) {
  :root { --sidebar: 232px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .menu-button { display: block; }
  .topbar-context { margin-right: auto; }
  .sidebar-backdrop { background: rgba(3,31,64,.42); inset: 0; position: fixed; z-index: 45; }
  body.menu-open .sidebar-backdrop { display: block; }
  .auth-shell { grid-template-columns: .85fr 1.15fr; }
  .auth-message h1 { font-size: 52px; }
  .install-shell { grid-template-columns: 1fr; }
  .install-brand { min-height: 420px; }
  .project-summary { grid-template-columns: 1fr; }
  .detail-grid, .files-layout, .users-layout { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: repeat(2,1fr); }
  .project-card-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid.three { grid-template-columns: repeat(2,1fr); }
  .demo-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 500px; padding: 28px 22px; }
  .auth-brand img { height: 57px; width: 57px; }
  .auth-message { padding: 52px 0; }
  .auth-message h1 { font-size: 46px; }
  .auth-panel { padding: 30px 18px 50px; }
  .auth-card { border-radius: 18px; padding: 30px 22px; }
  .install-brand, .install-card { padding: 48px 22px; }
  .install-brand { min-height: 380px; }
  .install-brand img { height: 105px; width: 95px; }
  .topbar { height: 70px; padding: 0 14px; }
  .topbar-context span { display: none; }
  .topbar-context strong { font-size: 14px; }
  .quick-report { font-size: 0; height: 43px; padding: 0; width: 43px; }
  .quick-report::after { content: "+"; font-size: 21px; }
  .user-menu > button > span:last-child { display: none; }
  .content { padding: 32px 14px 55px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 28px; }
  .page-heading h1 { font-size: 37px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 120px; padding: 18px; }
  .metric-card > strong { font-size: 39px; }
  .alert-panel { grid-template-columns: 1fr; padding: 20px; }
  .alert-list { grid-template-columns: 1fr; }
  .panel-heading { padding: 20px; }
  .project-row { gap: 15px; grid-template-columns: 1fr; padding: 18px 20px; }
  .project-main { align-items: center; }
  .project-row .progress-block { display: grid; }
  .project-card-grid, .file-browser-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; padding: 15px; }
  .filter-bar form { align-items: stretch; flex-direction: column; }
  .search-field, .select-field, .field.inline { min-width: 0; }
  .filter-bar .button { width: 100%; }
  .result-count { align-self: flex-end; }
  .form-section { padding: 22px 18px; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .report-submit { grid-template-columns: 1fr; }
  .project-summary { gap: 25px; padding: 22px 18px; }
  .project-summary dl { grid-template-columns: repeat(2,1fr); }
  .tabs a { padding: 11px 15px; }
  .detail-list { grid-template-columns: 1fr; padding: 5px 20px 20px; }
  .detail-list div, .detail-list div:nth-child(odd):not(.wide) { padding-right: 0; }
  .detail-list .wide { grid-column: auto; }
  .file-grid { grid-template-columns: 1fr; padding: 18px; }
  .section-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .section-toolbar .button { width: 100%; }
  .report-card { grid-template-columns: 1fr; }
  .report-date { align-items: baseline; border-bottom: 1px solid var(--line); border-right: 0; flex-direction: row; gap: 8px; padding: 14px 20px; }
  .report-date strong { font-size: 26px; }
  .report-date small { margin-left: auto; margin-top: 0; }
  .report-content { padding: 19px; }
  .report-top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .report-content dl { grid-template-columns: 1fr; }
  .report-content dl > div:nth-child(2), .report-content dl > div:nth-child(5) { grid-column: auto; }
  .file-table { padding: 7px 18px 18px; }
  .file-table > a { grid-template-columns: 43px 1fr auto; }
  .file-table > a > span:nth-last-child(2) { display: none; }
  .member-grid { grid-template-columns: 1fr; padding: 18px; }
  .app-footer { margin: 0 16px; }
  .demo-banner { align-items: flex-start; flex-direction: column; gap: 8px; }
  .demo-banner p { text-align: left; }
  .demo-gallery { grid-template-columns: 1fr; }
  .demo-toast { border-radius: 14px; bottom: 14px; text-align: center; width: calc(100vw - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
