:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #191e1b;
  background: #f7f8f6;
  font-synthesis: none;
  --ink: #191e1b;
  --muted: #59635d;
  --border: #e0e5df;
  --line: #edf0ec;
  --paper: #fff;
  --lime: #c9fa63;
  --lime-hover: #b8e953;
  --black: #111111;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
:focus-visible { outline: 2px solid #467900; outline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { display: block; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.5; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 20; background: #fff; padding: 12px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
}
.login-hero {
  background:
    linear-gradient(180deg, #0b100dc9 0%, #161d1640 39%, #0b100de8 100%),
    url("/obra.webp") 54% 50% / cover,
    repeating-linear-gradient(126deg, transparent 0 109px, #c9fa631d 110px 111px, transparent 112px 151px),
    radial-gradient(ellipse at 78% 18%, #343d27, #141a15 56%, #111111);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 570px;
  padding: clamp(32px, 5.2vw, 84px);
  color: #fff;
}
.hero-logo { width: min(420px, 100%); height: auto; border-radius: 7px; }
.hero-content { padding-top: 76px; }
.hero-project {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid #ffffff48;
  border-radius: 999px;
  background: #10171190;
  font-size: .875rem;
  font-weight: 600;
}
.hero-project span { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.hero-content p {
  margin-top: 17px;
  font-size: clamp(2.4rem, 4.4vw, 5rem);
  line-height: 1.04;
  font-weight: 660;
  letter-spacing: -.062em;
}
.login-main { display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.login-content { width: min(100% - 72px, 400px); align-self: center; justify-self: center; padding: 56px 0; }
.login-mark {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  border: 1px solid #dcebbd;
  border-radius: 14px;
  margin-bottom: 23px;
  background: #f1f8de;
}
.login-content h1 { font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1.08; letter-spacing: -.052em; }
.login-content > p { margin-top: 13px; color: var(--muted); }
#login-form { margin-top: 31px; display: grid; gap: 9px; }
#login-form label:not(:first-child) { margin-top: 8px; }
label, .field-label { color: #333c36; font-size: .875rem; font-weight: 650; }
input:not([type=file]), select, textarea {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d5dcd4;
  border-radius: 8px;
  padding: 11px 13px;
  min-height: 45px;
}
input::placeholder, textarea::placeholder { color: #67726a; }
textarea { resize: vertical; min-height: 92px; }
select { appearance: none; padding-right: 34px; }
.select-wrap { position: relative; }
.select-wrap > svg { pointer-events: none; position: absolute; right: 12px; top: 50%; color: #566259; transform: translateY(-50%); }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle { position: absolute; top: 5px; right: 5px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.32;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
.button-primary { background: var(--lime); color: #17230b; border-color: #bbe65e; }
.button-primary:hover:not(:disabled) { background: var(--lime-hover); }
.button-secondary { background: #fff; color: #39433d; border-color: #dce3db; }
.button-secondary:hover:not(:disabled) { background: #f2f5ef; border-color: #b6c4b7; }
.button-small { min-height: 36px; padding: 7px 11px; font-size: .875rem; }
.login-submit { margin-top: 13px; min-height: 48px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #57645c;
  background: transparent;
}
.icon-button:hover:not(:disabled) { color: #202a24; background: #edf2ea; }
.login-note { text-align: center; font-size: .875rem; }
.login-content .login-note { margin-top: 20px; }
.login-footer { padding: 22px 25px 26px; color: var(--muted); text-align: center; font-size: .875rem; }
.login-footer span { padding: 0 5px; color: #7d887e; }
.field-error { background: #fff0ef; color: #942721; border-radius: 7px; padding: 8px 11px; font-size: .875rem; }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100svh;
  padding: 23px 16px 17px;
  background: #111111;
  color: #eef1ec;
}
.sidebar-brand { flex: 0 0 auto; min-width: 0; margin: 0 0 15px; }
.sidebar-brand img { width: 100%; height: auto; }
.sidebar-workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 10px;
  background: #1d211e;
  border: 1px solid #323834;
}
.workspace-icon, .avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--lime);
  background: #303a25;
}
.workspace-name, .account-name { display: block; font-size: .88rem; font-weight: 690; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-meta, .account-role { display: block; color: #b0b8b0; font-size: .78rem; line-height: 1.35; margin-top: 3px; }
.sidebar-nav { min-height: 0; margin-top: 24px; padding: 3px; overflow-y: auto; scrollbar-color: #47534a transparent; }
.section-links { display: grid; gap: 5px; }
.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  width: 100%;
  padding: 9px 11px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c0c7c0;
  font-size: .925rem;
  font-weight: 560;
  text-align: left;
  text-decoration: none;
}
.nav-button:hover { background: #232924; color: #fff; }
.nav-button[aria-current] { color: var(--lime); background: #26311d; border-color: #394b29; font-weight: 700; }
.mobile-folder-toggle { display: none; }
.folder-tree { padding-top: 20px; padding-bottom: 6px; }
.folder-tree h2 { margin: 0 8px 6px; color: #b0b8b0; font-size: .8rem; font-weight: 670; }
.folder-branches, .folder-children { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.folder-children { margin-left: 9px; padding-left: 7px; border-left: 1px solid #3b453b; }
.folder-button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #cbd1c8;
  text-align: left;
  font-size: .875rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.folder-button:hover, .folder-button[aria-expanded="true"] { background: #212822; color: #fff; }
.folder-button[aria-current] { border-color: #394b29; background: #26311d; color: var(--lime); font-weight: 680; }
.folder-button[aria-expanded="false"] svg { transform: rotate(-90deg); }
.sidebar button:focus-visible { outline-color: var(--lime); }
.sidebar-account {
  flex: 0 0 auto;
  margin-top: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 15px 0 0;
  border-top: 1px solid #313631;
}
.avatar { color: #eef3e6; background: #383e37; font-size: .8rem; font-weight: 720; }
.sidebar-account .icon-button { color: #c0c7c0; }
.sidebar-account .icon-button:hover { background: #292f2a; color: #fff; }
.workspace-main { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 12px clamp(26px, 3.6vw, 56px);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; gap: 4px 9px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.breadcrumbs strong { color: var(--ink); font-weight: 680; }
.breadcrumbs button { padding: 3px 0; border: 0; border-radius: 2px; background: transparent; color: #4c5d4b; font-size: inherit; }
.breadcrumbs button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb-divider { color: #88938a; }
.pilot-label {
  white-space: nowrap;
  border: 1px solid #e0e6dd;
  border-radius: 99px;
  padding: 4px 9px;
  background: #f7f9f5;
  color: #536052;
  font-weight: 620;
  font-size: .78rem;
}
.workspace-content {
  width: min(100%, 1360px);
  margin: 0 auto;
  min-width: 0;
  padding: 39px clamp(26px, 3.6vw, 56px) 54px;
}
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-header h1 { color: #19211c; font-size: clamp(2rem, 3.1vw, 2.9rem); line-height: 1.1; letter-spacing: -.056em; }
.page-header p { margin-top: 9px; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 15px; margin-bottom: 25px; }
.latest-notice, .summary-stats { min-height: 112px; border: 1px solid var(--border); border-radius: 12px; }
.latest-notice {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 16px 17px;
  background: #edf5de;
  border-color: #dce8c7;
}
.notice-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 41px;
  height: 41px;
  border-radius: 9px;
  background: #e0edc9;
  color: #355520;
}
.notice-copy { min-width: 0; flex: 1; }
.notice-copy p { font-size: .875rem; color: #46583d; margin-top: 3px; overflow-wrap: anywhere; }
.notice-copy strong { font-size: .925rem; line-height: 1.35; color: #293a21; }
.latest-notice .button { background: #f7fbf0; border-color: #d1dfc1; }
.latest-notice .button:hover { background: #fff; }
.summary-stats { display: grid; grid-template-columns: 1fr 1fr; align-content: center; background: #fff; padding: 15px 0; }
.summary-stat { padding: 3px 15px; min-width: 0; }
.summary-stat + .summary-stat { border-left: 1px solid var(--border); }
.summary-stat strong { display: block; color: #253024; font-size: 1.65rem; font-weight: 680; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary-stat span { display: block; color: var(--muted); font-size: .875rem; margin-top: 5px; }

.document-panel, .notice-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
}
.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
}
.panel-toolbar h2 { font-size: 1.05rem; font-weight: 680; letter-spacing: -.02em; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; }
.search-field { position: relative; }
.search-field > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #5b685f; pointer-events: none; }
.filters input, .filters select { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: .875rem; }
.search-field input { width: 210px; padding-left: 34px; }
.document-table { width: 100%; border-collapse: collapse; text-align: left; }
.document-table th, .document-table td { padding: 13px 14px; vertical-align: middle; }
.document-table th:first-child, .document-table td:first-child { padding-left: 19px; }
.document-table th:last-child, .document-table td:last-child { padding-right: 19px; }
.document-table th {
  background: #fbfcfb;
  color: #526055;
  font-size: .875rem;
  font-weight: 630;
}
.document-table td { border-top: 1px solid var(--line); font-size: .9rem; }
.document-table tbody tr:hover { background: #fafcf8; }
.document-table .table-actions { text-align: right; white-space: nowrap; }
.row-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  color: #252d26;
  background: transparent;
  text-align: left;
}
.file-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 39px;
  border-radius: 8px;
  background: #edf2e9;
  color: #496143;
}
.file-icon[data-format="pdf"] { background: #f9eeec; color: #a74338; }
.document-name { min-width: 0; overflow-wrap: anywhere; }
.document-name strong { display: block; font-weight: 690; line-height: 1.32; }
.row-button:hover strong { color: #3d6719; text-decoration: underline; text-underline-offset: 3px; }
.document-code { display: block; margin-top: 3px; color: #657268; font-size: .8rem; line-height: 1.25; }
.document-mobile-path { display: none; }
.document-table .row-discipline { color: #526055; overflow-wrap: anywhere; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 99px;
  background: #eef1ee;
  color: #535d55;
  font-size: .8rem;
  font-weight: 690;
  line-height: 1.35;
  vertical-align: middle;
}
.badge-current { background: #e5f2d4; color: #385824; }
.badge-pending { background: #fff1d5; color: #714d0f; }
.panel-footer { border-top: 1px solid var(--line); padding: 12px 19px; color: var(--muted); font-size: .875rem; }
.empty-state { text-align: center; padding: 35px 17px; color: var(--muted); }
.empty-state svg { margin: 0 auto 11px; }
.empty-state strong { display: block; color: #37413a; }
.empty-state p { margin-top: 5px; }
.empty-state .button { margin-top: 12px; }
.notice-entry { display: flex; align-items: center; gap: 13px; padding: 16px 19px; }
.notice-entry + .notice-entry { border-top: 1px solid var(--line); }
.notice-entry .notice-copy strong { color: #27362b; }
.notice-entry .notice-copy p { color: var(--muted); }
.load-alert { margin-bottom: 16px; padding: 12px; background: #fff1eb; border: 1px solid #f0d4c8; border-radius: 9px; color: #813820; }
.load-alert button { margin-left: 8px; }

dialog { padding: 0; border: 0; background: #fff; color: var(--ink); }
dialog::backdrop { background: #10191073; }
body:has(dialog[open]) { overflow: hidden; }
.detail-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(100%, 590px);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100%;
  box-shadow: -12px 0 34px #1220162a;
}
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 24px 25px 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { overflow-wrap: anywhere; font-size: 1.55rem; letter-spacing: -.035em; line-height: 1.15; }
.dialog-header p { margin-top: 6px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.detail-body { padding: 20px 25px 28px; }
.detail-message { margin-bottom: 12px; padding: 9px 11px; border-radius: 8px; color: #3d552d; background: #edf5e2; font-size: .875rem; }
.current-revision {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 24px;
  padding: 12px;
  background: #eef6e4;
  border: 1px solid #dcebcf;
  border-radius: 9px;
}
.current-revision p { color: #465640; font-size: .875rem; margin-top: 3px; }
.history-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.history-header h3 { font-size: 1.04rem; }
.revision-list { list-style: none; margin: 0; padding: 0; }
.revision { padding: 15px 0; border-top: 1px solid var(--line); }
.revision-heading, .revision-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.revision-heading strong { color: #2b382d; font-variant-numeric: tabular-nums; }
.revision-meta { margin-top: 5px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.revision-notes { margin-top: 5px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .925rem; }
.revision-buttons { margin-top: 10px; }
.revision-file { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; margin-top: 5px; }
.action-dialog {
  max-width: 540px;
  width: calc(100% - 26px);
  max-height: calc(100% - 28px);
  border-radius: 13px;
  box-shadow: 0 20px 70px #0f211749;
}
.action-body { padding: 18px 25px 23px; display: grid; gap: 15px; }
.action-body > p { color: #49534b; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-help { color: var(--muted); font-size: .8rem; }
.file-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  color: #3d542e;
  background: #f7faf4;
  border: 1px dashed #a7bb9c;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.file-field:hover { background: #eef5e7; }
.file-field:focus-within { outline: 2px solid #467900; outline-offset: 3px; }
.file-field input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-field .field-help { display: block; margin-top: 2px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast {
  position: fixed;
  z-index: 10;
  bottom: 18px;
  right: 18px;
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 13px 16px;
  border-radius: 9px;
  color: #fff;
  background: #223122;
  box-shadow: 0 8px 24px #10241530;
  font-size: .9rem;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 222px minmax(0, 1fr); }
  .summary-grid { grid-template-columns: 1.35fr 1fr; }
  .latest-notice { gap: 9px; padding-left: 12px; padding-right: 12px; }
  .summary-stat { padding-inline: 11px; }
  .search-field input { width: 180px; }
}
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-stats { min-height: 79px; }
  .latest-notice { min-height: 85px; }
  .workspace-content { padding-top: 29px; }
  .document-table th, .document-table td { padding-inline: 8px; }
  .document-table th:last-child, .document-table td:last-child { padding-right: 10px; }
}
@media (max-width: 700px) {
  .login-shell, .app-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 210px; padding: 19px 25px 23px; background-position: 54% 44%; }
  .hero-logo { width: min(228px, 100%); }
  .hero-content { padding-top: 24px; }
  .hero-content p { margin-top: 10px; font-size: 2rem; letter-spacing: -.055em; }
  .hero-project { font-size: .8rem; padding: 5px 8px; }
  .login-content { width: min(100% - 42px, 400px); padding: 32px 0 24px; }
  .login-mark { display: none; }
  #login-form { margin-top: 23px; }
  .login-footer { padding-top: 12px; padding-bottom: 17px; }
  .sidebar { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; height: auto; padding: 9px 14px 6px; }
  .sidebar-brand { align-self: center; margin: 0; }
  .sidebar-brand img { width: min(158px, 100%); }
  .sidebar-workspace { display: none; }
  .sidebar-nav { grid-area: 2 / 1 / 3 / 3; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 5px; margin: 0; overflow: visible; }
  .section-links { display: flex; flex-wrap: wrap; }
  .mobile-folder-toggle { display: flex; }
  .mobile-folder-toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
  .folder-tree { grid-column: 1 / -1; max-height: min(43dvh, 310px); padding: 8px 3px 4px; overflow-y: auto; border-top: 1px solid #313631; }
  .folder-tree[data-mobile-open="false"] { display: none; }
  .nav-button { min-height: 38px; width: auto; }
  .sidebar-account { border: 0; padding: 0; margin: 0; max-width: 190px; }
  .sidebar-account .avatar { display: none; }
  .sidebar-account { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar { min-height: 47px; padding: 8px 15px; }
  .workspace-content { padding: 22px 15px 35px; }
  .page-header { align-items: start; }
  .page-header h1 { font-size: 1.85rem; }
  .page-header p { margin-top: 6px; font-size: .925rem; }
  .summary-grid { gap: 8px; margin-bottom: 17px; }
  .panel-toolbar { padding: 13px 10px; }
  .search-field input { width: 176px; }
  .document-table th:first-child, .document-table td:first-child { padding-left: 10px; }
}
@media (max-width: 490px) {
  .page-header { flex-wrap: wrap; margin-bottom: 17px; }
  .page-header .button { min-height: 39px; }
  .latest-notice { flex-wrap: wrap; }
  .latest-notice .notice-copy { flex-basis: calc(100% - 50px); }
  .latest-notice .button { margin-left: 50px; }
  .filters { width: 100%; }
  .search-field { flex: 1 1 135px; min-width: 0; }
  .search-field input { width: 100%; }
  .document-mobile-path { display: block; }
  .document-table .row-discipline { display: none; }
  .document-table td, .document-table th { font-size: .8rem; }
  .document-table td:first-child { width: 58%; }
  .row-button { gap: 6px; }
  .file-icon { width: 27px; height: 32px; }
  .file-icon svg { width: 16px; height: 16px; }
  .table-actions .icon-button { width: 30px; height: 33px; }
  .dialog-header { padding: 18px 16px 14px; }
  .detail-body, .action-body { padding-inline: 16px; }
  .notice-entry { flex-wrap: wrap; padding-inline: 11px; }
  .notice-entry .notice-copy { flex-basis: calc(100% - 58px); }
  .notice-entry .button { margin-left: 54px; }
}
