:root {
  --navy: #16324f;
  --sage: #7a9b76;
  --sand: #e8e2d7;
  --off: #f7f5f2;
  --ink: #333333;
  --muted: #667085;
  --line: #e6e8ec;
  --white: #ffffff;
  --orange: #f59e0b;
  --red: #dc2626;
  --green: #16a34a;
  --blue: #2563eb;
  --shadow: 0 18px 50px rgba(22, 50, 79, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--off);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 8px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(420px, 1fr);
  gap: 32px;
  padding: 48px;
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(122,155,118,.24), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, var(--off) 60%, #edf2ee 100%);
}
.login-panel, .login-insight {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(230,232,236,.8);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.login-panel { padding: 42px; }
.login-panel h1 { margin: 12px 0; color: var(--navy); font-size: 52px; line-height: 1; }
.login-panel label { display: grid; gap: 8px; margin: 0; font-weight: 700; }
.login-form { display: grid; gap: 16px; margin-top: 30px; }
.login-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, .18);
  background: rgba(220, 38, 38, .08);
  color: var(--red);
  font-weight: 700;
  line-height: 1.4;
}
.login-message.ok {
  border-color: rgba(22, 163, 74, .2);
  background: rgba(22, 163, 74, .08);
  color: var(--green);
}
.login-panel input, .login-panel select, .topbar input, .filterbar input, .filterbar select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}
.login-insight {
  min-height: 520px;
  padding: 40px;
  display: grid;
  align-content: end;
  gap: 16px;
  background:
    linear-gradient(160deg, rgba(22,50,79,.95), rgba(22,50,79,.78)),
    linear-gradient(90deg, var(--sand), #fff);
}
.login-insight div {
  display: grid;
  grid-template-columns: 16px 90px 1fr;
  align-items: center;
  gap: 14px;
  color: #fff;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.16);
}
.login-insight strong { font-size: 34px; }
.login-insight small { color: rgba(255,255,255,.74); font-weight: 600; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-radius: 12px;
  font-weight: 800;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.sidebar-brand strong { display: block; color: var(--navy); }
.sidebar-brand span { color: var(--muted); font-size: 12px; font-weight: 700; }
nav { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #475467;
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: left;
  font-weight: 700;
}
.nav-item.active, .nav-item:hover { background: #f1f4f2; color: var(--navy); }
.nav-icon { width: 24px; text-align: center; color: var(--sage); }
.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 12px;
}
.sidebar-settings {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  text-align: center;
}
.sidebar-settings:hover { background: #f1f4f2; }
.role-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--off);
  border: 1px solid var(--line);
}
.role-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.role-card strong { display: block; color: var(--navy); margin: 5px 0 14px; }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 92px;
  padding: 22px 32px;
  background: rgba(247,245,242,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(230,232,236,.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.topbar h2 { margin: 0; color: var(--navy); font-size: 30px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar input { width: min(420px, 38vw); }
.content { padding: 32px; }

.primary, .ghost, .icon-button, .secondary, .danger {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
}
.primary { background: var(--navy); color: #fff; box-shadow: 0 10px 22px rgba(22,50,79,.18); }
.primary:hover { transform: translateY(-1px); }
.small { padding: 10px 14px; }
.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.danger { background: #fff; color: #991b1b; border-color: #fecaca; }
.danger:hover:not(:disabled) { background: #fef2f2; }
.danger:disabled {
  color: #98a2b3;
  border-color: var(--line);
  cursor: not-allowed;
}
.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 18px; }
.metric-card, .panel, .company-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(22,50,79,.07);
}
.metric-card {
  padding: 22px;
  min-height: 148px;
  display: grid;
  align-content: space-between;
  transition: .18s ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-weight: 700; }
.metric-card strong { color: var(--navy); font-size: 38px; line-height: 1; }
.metric-card small { color: var(--muted); }
.metric-card.red { border-color: rgba(220,38,38,.25); }
.metric-card.orange { border-color: rgba(245,158,11,.3); }
.metric-card.green { border-color: rgba(22,163,74,.25); }

.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.panel { padding: 22px; }
.panel h3 { margin: 0 0 16px; color: var(--navy); }
.stack { display: grid; gap: 12px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row strong { color: var(--navy); }
.row small { color: var(--muted); display: block; margin-top: 4px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge::before, .status-dot {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
}
.badge.red { color: #991b1b; background: #fef2f2; }
.badge.red::before, .status-dot.red { background: var(--red); }
.badge.orange { color: #92400e; background: #fffbeb; }
.badge.orange::before, .status-dot.orange { background: var(--orange); }
.badge.green { color: #166534; background: #f0fdf4; }
.badge.green::before, .status-dot.green { background: var(--green); }
.badge.gray { color: #475467; background: #f2f4f7; }
.badge.gray::before { background: #98a2b3; }
.badge.blue { color: #1d4ed8; background: #eff6ff; }
.badge.blue::before { background: var(--blue); }

.filterbar {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(140px, .7fr));
  gap: 10px;
  margin-bottom: 18px;
}
.accounting-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.accounting-toolbar h3 { margin: 0; color: var(--navy); font-size: 24px; }
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.view-toggle button {
  border: 0;
  border-radius: 9px;
  padding: 9px 13px;
  background: transparent;
  color: #475467;
  font-weight: 800;
}
.view-toggle button.active {
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 18px rgba(22,50,79,.16);
}
.accounting-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
}
.accounting-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(22,50,79,.07);
}
.accounting-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.accounting-card h3 { margin: 0 0 6px; color: var(--navy); font-size: 18px; line-height: 1.25; }
.accounting-card p { margin: 0; }
.accounting-card-focus {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: var(--off);
  border: 1px solid var(--line);
}
.accounting-card-focus span {
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.accounting-card-focus strong { color: var(--navy); font-size: 24px; }
.accounting-card-focus small { color: var(--muted); font-weight: 700; }
.card-status-select, .period-status-select {
  display: grid;
  gap: 7px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.period-status-select { width: min(360px, 58%); }
.card-status-select select, .period-status-select select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  outline: none;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.card-status-select select:focus, .period-status-select select:focus {
  border-color: rgba(22,50,79,.38);
  box-shadow: 0 0 0 3px rgba(22,50,79,.08);
}
.card-status-select select:disabled, .period-status-select select:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}
.period-stack { display: grid; gap: 8px; }
.period-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.period-pill.red {
  border-color: #fecaca;
  background: #fff7f7;
}
.period-pill.orange {
  border-color: #fde68a;
  background: #fffcf0;
}
.period-pill.green {
  border-color: #bbf7d0;
  background: #f4fbf6;
}
.period-label { display: grid; gap: 2px; }
.period-label span { color: var(--ink); font-weight: 800; }
.period-label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.period-pill.red .period-label small { color: #991b1b; }
.period-pill.orange .period-label small { color: #92400e; }
.period-pill.green .period-label small { color: #166534; }
.done-periods { display: grid; gap: 8px; }
.done-toggle {
  width: 100%;
  min-height: 38px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}
.done-toggle:hover { background: #f8fafc; }
.period-empty {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  background: #fff;
}
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 18px; }
.company-card { padding: 20px; display: grid; gap: 18px; text-align: left; }
.company-card h3 { margin: 0; color: var(--navy); }
.company-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.company-meta span { color: var(--muted); font-size: 12px; }
.company-meta strong { display: block; margin-top: 3px; color: var(--ink); }
.company-actions, .detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.company-actions { justify-content: space-between; }
.detail-actions { justify-content: flex-end; }

.tabs { display: flex; gap: 8px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 13px; border-radius: 10px; color: #475467; font-weight: 800; white-space: nowrap; }
.tab.active { background: var(--navy); color: #fff; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
td { color: var(--ink); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.tracking-status, .tracking-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  padding: 8px 10px;
  font-weight: 700;
  outline: none;
}
.period-input { min-width: 120px; }
.date-input { min-width: 150px; }
.remark-input {
  min-width: 220px;
  color: var(--ink);
  font-weight: 600;
}
.tracking-status:focus, .tracking-input:focus {
  border-color: rgba(22,50,79,.38);
  box-shadow: 0 0 0 3px rgba(22,50,79,.08);
}

.checklist { display: grid; gap: 10px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.check-item input { width: 18px; height: 18px; accent-color: var(--sage); }
.split-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.split-header h3 { margin: 0 0 6px; color: var(--navy); }
.empty {
  padding: 36px;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255,255,255,.6);
}
.empty.compact { padding: 18px; border-radius: 12px; }
.folder-tree {
  display: grid;
  gap: 14px;
}
.folder-company {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.folder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.folder-head strong { color: var(--navy); }
.folder-head small {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.folder-year {
  display: grid;
  gap: 10px;
  padding-left: 14px;
  border-left: 3px solid #d7dfd7;
}
.folder-year > span {
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
}
.folder-type {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--off);
}
.folder-type > strong {
  color: var(--navy);
  font-size: 14px;
}
.document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.document-row strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.document-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.company-compliance { margin-top: 20px; }
.company-compliance h4 {
  margin: 0 0 10px;
  color: var(--navy);
}
.compliance-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.storage-preview {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px dashed #b8c7b6;
  border-radius: 12px;
  background: #f4fbf6;
}
.storage-preview span {
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.storage-preview code {
  color: var(--navy);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.export-preview {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--off);
}
.export-preview > span {
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.export-preview > strong {
  color: var(--navy);
  font-size: 22px;
}
.export-preview-list {
  display: grid;
  gap: 6px;
}
.export-preview-list small {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.document-company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 16px;
}
.document-company-card {
  display: grid;
  gap: 18px;
  width: 100%;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 26px rgba(22,50,79,.06);
}
.document-company-card:hover {
  border-color: #b8c7b6;
  box-shadow: 0 14px 34px rgba(22,50,79,.1);
  transform: translateY(-1px);
}
.document-company-card h4 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 17px;
  line-height: 1.3;
}
.document-company-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.document-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.document-card-metrics span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--off);
}
.document-card-metrics strong {
  color: var(--navy);
  font-size: 22px;
}
.document-card-metrics small {
  color: var(--muted);
  font-weight: 800;
}
.document-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.document-detail-list {
  display: grid;
  gap: 18px;
}
.document-year-section {
  display: grid;
  gap: 12px;
}
.document-year-section h4 {
  margin: 0;
  color: var(--sage);
  font-size: 14px;
}
.document-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.document-type-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--off);
}
.document-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.document-type-head strong { color: var(--navy); }
.document-type-head span {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--sage);
  font-weight: 800;
}
.document-list {
  display: grid;
  gap: 8px;
}
.month-picker {
  display: grid;
  gap: 8px;
}
.month-button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.month-button {
  min-height: 42px;
  padding: 9px 10px;
  text-align: center;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--navy);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
}
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 50, 79, .34);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.confirm-panel { width: min(520px, 100%); }
.modal-panel h3 { margin: 0 0 8px; color: var(--navy); font-size: 24px; }
.user-panel { width: min(860px, 100%); }
.invite-panel { width: min(620px, 100%); }
.mail-panel { width: min(720px, 100%); }
.mail-compose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.mail-compose label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 800;
}
.mail-compose input, .mail-compose textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}
.mail-compose textarea {
  line-height: 1.5;
  resize: vertical;
}
.settings-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--off);
}
.settings-tabs button {
  border: 0;
  border-radius: 9px;
  padding: 9px 13px;
  background: transparent;
  color: #475467;
  font-weight: 800;
}
.settings-tabs button.active {
  color: #fff;
  background: var(--navy);
}
.settings-tabs button:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}
.settings-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-header-row h4 { margin: 0 0 4px; color: var(--navy); font-size: 18px; }
.settings-header-row p { margin: 0; }
.user-list { display: grid; gap: 10px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.user-row strong { color: var(--navy); display: block; margin-bottom: 4px; }
.user-row small { color: var(--muted); font-weight: 700; }
.user-row-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.invite-link {
  display: block;
  margin-top: 4px;
  color: var(--sage) !important;
}
.mini {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
}
.invite-clean-form {
  display: grid;
  gap: 16px;
}
.invite-clean-form label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 800;
}
.invite-clean-form input[type="text"], .invite-clean-form input[type="email"], .invite-clean-form input:not([type]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--navy);
  font-weight: 800;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.access-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.choice-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  padding: 12px;
  font-weight: 800;
  text-align: left;
}
.choice-button.active {
  border-color: var(--navy);
  background: #f1f4f2;
  box-shadow: inset 0 0 0 1px var(--navy);
}
.company-access-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  padding: 2px;
}
.company-access-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  padding: 12px;
  text-align: left;
}
.company-access-option strong { font-size: 14px; }
.company-access-option small { color: var(--muted); font-weight: 700; }
.company-access-option.active {
  border-color: var(--sage);
  background: #f4fbf6;
  box-shadow: inset 0 0 0 1px var(--sage);
}
.invite-result {
  margin-top: 16px;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  background: #f0fdf4;
}
.invite-result code {
  overflow-wrap: anywhere;
  color: var(--navy);
  font-weight: 800;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-weight: 800;
}
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}
.form-full, .modal-actions { grid-column: 1 / -1; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .metric-grid, .company-grid, .accounting-card-grid, .document-company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filterbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .login-screen, .app-shell { grid-template-columns: 1fr; }
  .login-screen { padding: 22px; }
  .login-insight { min-height: auto; }
  .sidebar { position: static; height: auto; }
  .topbar { align-items: stretch; flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
  .topbar input { width: 100%; }
  .content { padding: 20px; }
  .metric-grid, .company-grid, .accounting-card-grid, .document-company-grid, .document-type-grid, .filterbar { grid-template-columns: 1fr; }
  .accounting-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: stretch; }
  .view-toggle { width: 100%; }
  .view-toggle button { flex: 1; }
  .period-pill { align-items: stretch; flex-direction: column; }
  .period-status-select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-header-row, .user-row { align-items: stretch; flex-direction: column; }
  .folder-head, .document-row { align-items: stretch; flex-direction: column; }
  .compliance-columns { grid-template-columns: 1fr; }
  .user-row-meta { justify-content: flex-start; }
  .choice-grid { grid-template-columns: 1fr; }
  .access-mode { grid-template-columns: 1fr; }
  .month-button-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}
