:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #eef1f4;
  --text: #171a1f;
  --muted: #69717d;
  --border: #d9dee5;
  --input: #ffffff;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --danger: #c2410c;
  --ok: #047857;
  --shadow: 0 10px 24px rgba(23, 26, 31, 0.08);
}

[data-theme="dark"] {
  --bg: #111312;
  --panel: #191c1b;
  --panel-soft: #222625;
  --text: #f5f7f6;
  --muted: #a3aca8;
  --border: #333a37;
  --input: #111312;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --danger: #fb923c;
  --ok: #34d399;
  --shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, Segoe UI, Arial, system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  letter-spacing: 0;
}

.muted,
small {
  color: var(--muted);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(4, 120, 87, 0.12), transparent 38%),
    var(--bg);
}

.auth-card {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card.wide {
  width: min(720px, 100%);
}

.auth-card > p {
  color: var(--muted);
}

.auth-logo {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-logo.small {
  width: 58px;
  height: 58px;
}

.auth-logo img,
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.auth-form,
.account-form,
.access-form,
.company-form {
  display: grid;
  gap: 12px;
}

.auth-form.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-span {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--input);
  color: var(--text);
}

.input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.input[readonly],
.input:disabled,
select:disabled {
  background: var(--panel-soft);
  color: var(--muted);
}

.number-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.light {
  border-color: var(--border);
  background: var(--panel);
}

.btn.dark {
  background: var(--text);
  color: var(--panel);
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.btn.full,
.full {
  width: 100%;
}

.discord-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.error,
.notice {
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
}

.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.notice {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--muted);
}

.notice.strong {
  color: var(--text);
}

.code-input {
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--panel-soft);
  color: var(--text);
}

.mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: var(--text);
  color: var(--panel);
  font-size: 11px;
  font-weight: 900;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.theme-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 900;
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  border-radius: 999px;
  background: var(--border);
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: white;
  transition: transform 0.16s ease;
}

.switch.on {
  background: var(--accent);
}

.switch.on span {
  transform: translateX(18px);
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.user-chip > span:last-child {
  display: grid;
  gap: 3px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 900;
}

.content {
  width: min(1480px, 100%);
  display: grid;
  gap: 18px;
  padding: 22px;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid.compact {
  margin-bottom: 0;
}

.stat-card {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--panel);
}

.stat-card span {
  color: var(--muted);
  font-weight: 900;
}

.stat-card strong {
  font-size: 25px;
}

.stat-card.green {
  border-left-color: #059669;
}

.stat-card.blue {
  border-left-color: #2563eb;
}

.stat-card.amber {
  border-left-color: #d97706;
}

.stat-card.violet {
  border-left-color: #7c3aed;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.compact-title {
  margin-bottom: 4px;
}

.role-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.role-strip div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.role-strip strong {
  font-size: 24px;
}

.role-strip span {
  color: var(--muted);
  font-weight: 900;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

.table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.ok {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #047857;
}

.pill.danger {
  border-color: #fed7aa;
  background: #ffedd5;
  color: #c2410c;
}

.pill.wait {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .pill.ok {
  border-color: #047857;
  background: #073b2a;
  color: #bbf7d0;
}

[data-theme="dark"] .pill.danger {
  border-color: #9a3412;
  background: #431407;
  color: #fed7aa;
}

[data-theme="dark"] .pill.wait {
  border-color: #92400e;
  background: #422006;
  color: #fde68a;
}

.badge {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.role-fondateur {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #6b21a8;
}

.role-gl,
.role-agl {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.role-gouverneur,
.role-secretaire-finances {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.role-patron {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #047857;
}

[data-theme="dark"] .role-fondateur {
  background: #3b2352;
  border-color: #7c3aed;
  color: #e9d5ff;
}

[data-theme="dark"] .role-gl,
[data-theme="dark"] .role-agl {
  background: #172554;
  border-color: #2563eb;
  color: #bfdbfe;
}

[data-theme="dark"] .role-gouverneur,
[data-theme="dark"] .role-secretaire-finances {
  background: #422006;
  border-color: #d97706;
  color: #fde68a;
}

[data-theme="dark"] .role-patron {
  background: #073b2a;
  border-color: #047857;
  color: #bbf7d0;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-weight: 800;
}

.toolbar,
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar .input {
  max-width: 460px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sheet-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.lines {
  margin: 4px 0 12px;
}

.lines input {
  min-width: 130px;
}

.company-form {
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  align-items: end;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-row td {
  background: var(--panel-soft);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
}

.inline-form.user-edit {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.inline-confirm {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

[data-theme="dark"] .inline-confirm {
  background: #431407;
  color: #fed7aa;
  border-color: #9a3412;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.access-form h3,
.panel h3 {
  margin-bottom: 2px;
}

.company-fields {
  display: grid;
  gap: 12px;
}

.company-fields[hidden] {
  display: none;
}

.copy-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.mini-row,
.user-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.mini-row span,
.user-row span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.access-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.account-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-form h3,
.account-form button,
#accountError {
  grid-column: 1 / -1;
}

.secret-box {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  word-break: break-all;
}

@media (max-width: 1180px) {
  .stats-grid,
  .access-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .toolbar,
  .editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .input {
    max-width: none;
  }

  .content {
    padding: 16px;
  }

  .stats-grid,
  .role-strip,
  .access-sections,
  .auth-form.two-col,
  .account-form,
  .company-form,
  .inline-form,
  .inline-form.user-edit,
  .sheet-title-row {
    grid-template-columns: 1fr;
  }

  .user-row,
  .mini-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

/* Polished interface pass */
:root {
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 48px rgba(23, 26, 31, 0.08);
}

[data-theme="dark"] {
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
}

body {
  letter-spacing: 0;
}

.auth-page {
  background:
    radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--bg);
}

.auth-card {
  width: min(460px, 100%);
  justify-items: center;
  gap: 20px;
  padding: 34px;
  border-radius: var(--radius-lg);
  text-align: center;
  animation: softIn 0.28s ease-out both;
}

.auth-logo {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1 {
  font-size: 32px;
  font-weight: 900;
}

.auth-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.discord-login {
  min-height: 48px;
  border-radius: 14px;
  background: #5865f2;
  color: white;
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.24);
}

.discord-login:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.auth-help {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.auth-help:hover {
  color: var(--accent);
}

.btn,
.input,
select,
.panel,
.table-wrap,
.empty,
.user-row,
.mini-row,
.stat-card {
  border-radius: var(--radius);
}

.btn,
.icon-btn,
.theme-toggle,
.nav-item,
.company-picker-item,
.company-card-mini {
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover,
.icon-btn:hover,
.company-card-mini:hover {
  transform: translateY(-1px);
}

.sidebar {
  padding: 22px;
}

.brand-logo {
  border-radius: 14px;
}

.nav {
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.nav-item.active {
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-ico,
.btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.nav-ico {
  width: 22px;
  height: 22px;
}

.btn-ico {
  width: 18px;
  height: 18px;
}

.nav-ico svg,
.btn-ico svg,
.icon-btn svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  overflow: visible;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.icon-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 0;
  box-shadow: none;
  overflow: visible;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.discord-action {
  color: #5865f2;
}

.discord-action svg {
  width: 30px;
  height: 30px;
  padding: 2px;
  transform: translateX(-1px);
  box-sizing: border-box;
}

.theme-toggle {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 4px;
}

.theme-toggle span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(23, 26, 31, 0.1);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.theme-toggle.is-dark {
  background: #1f2937;
  color: #bfdbfe;
}

.theme-toggle.is-light {
  background: #e0f2fe;
  color: #0369a1;
}

.logout-btn {
  gap: 9px;
}

.topbar {
  padding: 18px 28px;
}

.user-chip {
  width: 252px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  justify-content: stretch;
  gap: 12px;
  border-radius: 999px;
  padding: 9px 10px 9px 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.user-chip-text {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 5px;
  min-width: 0;
}

.user-chip-text strong {
  max-width: 164px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.user-chip .badge {
  max-width: 164px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
  display: inline-block;
}

.avatar,
.account-avatar {
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent);
  color: white;
}

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid var(--panel);
}

.account-avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
}

.image-avatar img,
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  justify-content: center;
}

.content {
  gap: 20px;
  padding: 26px;
}

.auth-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.dashboard-chart {
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
}

.chart-row span,
.chart-row strong {
  font-weight: 900;
}

.chart-row strong {
  text-align: right;
}

.chart-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
}

.chart-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.chart-row.green i {
  background: #059669;
}

.chart-row.blue i {
  background: #2563eb;
}

.chart-row.amber i {
  background: #d97706;
}

.chart-row.violet i {
  background: #7c3aed;
}

.company-overview,
.access-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.access-tools {
  grid-template-columns: minmax(320px, 1.3fr) minmax(260px, 0.7fr);
  align-items: start;
}

.linked-company-panel {
  align-content: start;
}

.company-create-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
}

.company-create-inline h3,
.company-create-inline #accessCompanyError {
  grid-column: 1 / -1;
}

.linked-company-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.linked-company-row span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.linked-company-row b {
  max-width: 220px;
  text-align: right;
}

.linked-company-row.confirming {
  grid-template-columns: 1fr;
}

.company-delete-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn.slim {
  min-height: 34px;
  padding: 7px 10px;
}

.company-card-mini {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.company-card-mini span {
  color: var(--muted);
  font-weight: 800;
}

.company-card-mini b {
  font-size: 20px;
}

.company-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.company-picker {
  position: sticky;
  top: 96px;
}

.company-picker-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 2px;
}

.company-picker-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.company-picker-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-picker-item.active,
.company-picker-item:hover {
  border-color: var(--border);
  background: var(--panel-soft);
}

.company-detail {
  display: grid;
  gap: 18px;
}

.company-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.company-hero h3 {
  margin-top: 4px;
  font-size: 24px;
}

.tax-editor {
  display: grid;
  grid-template-columns: 150px auto;
  align-items: end;
  gap: 10px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-label {
  gap: 7px;
}

.paid-toggle {
  min-width: 104px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

.paid-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-summary {
  justify-items: center;
  text-align: center;
  padding: 28px;
}

.account-summary h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.account-form {
  align-items: start;
}

@keyframes softIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .company-overview,
  .access-tools,
  .company-workspace,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .company-picker {
    position: static;
  }
}

@media (max-width: 860px) {
  .auth-card {
    padding: 26px;
  }

  .user-chip {
    width: 100%;
  }

  .chart-row,
  .linked-company-row {
    grid-template-columns: 1fr;
  }

  .chart-row strong,
  .linked-company-row b {
    text-align: left;
  }

  .company-hero,
  .company-create-inline,
  .tax-editor {
    grid-template-columns: 1fr;
  }
}
