:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f5f2ec;
  --surface: #faf8f4;
  --surface-soft: #ede8df;
  --surface-muted: #e8e3d8;
  --text: #1a1109;
  --muted: #7a6e5e;
  --muted-2: #a09280;
  --line: rgba(2, 38, 35, 0.12);
  --line-soft: rgba(2, 38, 35, 0.07);
  --nav: #002623;
  --nav-2: #054239;
  --nav-text: #d6cfc2;
  --nav-text-strong: #f5f2ec;
  --nav-border: rgba(185, 167, 121, 0.12);
  --accent: #b9a779;
  --accent-strong: #a49367;
  --accent-text: #002623;
  --danger: #c0392b;
  --danger-soft: #fff1ed;
  --danger-border: #f3c4ba;
  --success: #059669;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 8px;
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  --modal-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  justify-items: stretch;
  padding: 1.25rem;
  background: var(--bg);
}

.login-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 38, 35, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(2, 38, 35, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%);
}

.login-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(1040px, 100%);
  min-height: min(620px, calc(100dvh - 7rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--modal-shadow);
  overflow: hidden;
}

.login-brand-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem;
  color: var(--nav-text-strong);
  background:
    radial-gradient(circle at 80% 12%, rgba(185, 167, 121, 0.22), transparent 26%),
    linear-gradient(135deg, var(--nav), var(--nav-2));
}

.login-brand-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.7), transparent 76%);
}

.login-logo-row,
.login-copy,
.login-signal-list {
  position: relative;
  z-index: 1;
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.login-logo {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
}

.login-logo-title {
  color: var(--nav-text-strong);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.1;
}

.login-logo-subtitle {
  margin-top: 0.1rem;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 500;
}

.login-mobile-brand {
  display: none;
}

.login-copy {
  max-width: 24rem;
}

.login-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 0;
  color: var(--nav-text-strong);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.08;
}

.login-copy p:not(.login-eyebrow) {
  margin: 1rem 0 0;
  color: var(--nav-text);
  font-size: 0.92rem;
  line-height: 1.6;
}

.login-signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.login-signal-list span {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.35rem 0.55rem;
  color: var(--nav-text-strong);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
}

.login-card {
  position: relative;
  z-index: 1;
  align-self: center;
  width: 100%;
  padding: 2rem;
  background: var(--surface);
}

.login-form-header {
  margin-bottom: 1.25rem;
}

.login-card .brand {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.login-card .subtitle {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.public-footer {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  min-height: 46px;
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 256px;
  flex: 0 0 256px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--nav);
  border-right: 1px solid var(--nav-border);
}

.brand {
  min-height: 4.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--nav-border);
}

.brand img {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--nav-text-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.brand span {
  margin-top: 0.1rem;
  color: var(--nav-text);
  font-size: 0.72rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.nav {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: 0.65rem 0.5rem;
  overflow-y: auto;
}

.nav a {
  min-height: 2.1rem;
  display: flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  color: var(--nav-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
}

.nav a:hover,
.nav a:focus {
  color: var(--nav-text-strong);
  background: rgba(255, 255, 255, 0.06);
}

.nav a.active {
  color: var(--accent-text);
  background: var(--accent);
}

.admin-user-panel {
  padding: 0.75rem;
  border-top: 1px solid var(--nav-border);
}

.admin-user-panel .signed-in-label,
.admin-user-panel strong,
.admin-user-panel small {
  display: block;
}

.admin-user-panel .signed-in-label {
  color: var(--nav-text);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-user-panel strong {
  margin-top: 0.25rem;
  color: var(--nav-text-strong);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.admin-user-panel small {
  margin-top: 0.15rem;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.topbar p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 108px;
  padding: 1rem;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

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

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.settings-form h3,
.template-form h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.panel-body {
  padding: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table th,
.table td {
  padding: 0.65rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.25rem 0.5rem;
  color: var(--success);
  background: #edf2ee;
  border: 1px solid rgba(185, 167, 121, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
}

.button {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.85rem;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.button:focus {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button.secondary {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--line-soft);
}

.button.secondary:hover,
.button.secondary:focus {
  color: var(--nav-text-strong);
  background: var(--nav-2);
  border-color: var(--nav-2);
}

.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-border);
}

.button.danger:hover,
.button.danger:focus {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.login-main-action {
  width: 100%;
  min-height: 2.8rem;
}

.form-stack,
.list,
.template-list {
  display: grid;
  gap: 0.85rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.45rem;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 0.65rem;
  outline: none;
}

textarea {
  min-height: 7rem;
  padding-top: 0.65rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 167, 121, 0.16);
}

.alert {
  margin-bottom: 1rem;
  padding: 0.75rem;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
}

.download,
.settings-form,
.template-form {
  padding: 0.9rem;
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.download strong,
.download span,
.empty {
  display: block;
}

.download span,
.empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-tab-layout {
  display: block;
}

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

.page-command-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.check-row input {
  width: 1rem;
  min-height: 1rem;
}

.actions-cell,
.inline-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.actions-cell form,
.inline-edit {
  margin: 0;
}

.inline-edit input {
  min-width: 220px;
}

.action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu summary {
  list-style: none;
  cursor: pointer;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary::after {
  content: "v";
  margin-left: 0.45rem;
  font-size: 0.7rem;
}

.action-menu-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  min-width: 190px;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.action-menu-list form {
  margin: 0;
}

.menu-item {
  width: 100%;
  min-height: 2.15rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0 0.65rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus {
  background: var(--surface-muted);
}

.menu-item.danger {
  color: var(--danger);
}

.menu-form {
  display: grid;
  gap: 0.35rem;
}

.menu-form input {
  min-width: 180px;
}

.table input,
.table select {
  min-width: 130px;
  min-height: 2.1rem;
  padding: 0 0.5rem;
  font-size: 0.78rem;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tabs a {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.tabs a:hover,
.tabs a:focus,
.tabs a.active {
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

.app-footer {
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.app-footer a,
.public-footer a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.legal-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.legal-page {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.legal-header {
  min-height: 4rem;
  display: flex;
  align-items: center;
}

.legal-document {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal-document h1 {
  margin: 0 0 1rem;
  color: var(--nav);
  font-size: 1.6rem;
}

.legal-content {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.7;
}

.legal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.legal-icon-link {
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: var(--nav);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.not-found-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.not-found-page {
  width: min(820px, calc(100% - 2rem));
}

.not-found-panel {
  min-height: min(520px, calc(100svh - 8rem));
  display: grid;
  align-content: center;
  justify-items: start;
  margin-top: 1.1rem;
  padding: clamp(1.4rem, 5vw, 3rem);
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(185, 167, 121, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--modal-shadow);
}

.not-found-code {
  color: var(--accent);
  font-size: clamp(3rem, 14vw, 7rem);
  font-weight: 850;
  line-height: 0.95;
}

.not-found-panel h1 {
  margin: 0.85rem 0 0;
  color: var(--nav);
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.05;
}

.not-found-panel p {
  max-width: 34rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

.not-found-primary,
.not-found-secondary {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.not-found-primary {
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.not-found-secondary {
  color: var(--nav-2);
  background: var(--surface);
  border: 1px solid var(--line);
}

.not-found-primary:hover,
.not-found-primary:focus,
.not-found-secondary:hover,
.not-found-secondary:focus,
.legal-icon-link:hover,
.legal-icon-link:focus {
  color: var(--nav-text-strong);
  background: var(--nav);
  border-color: var(--nav);
}

.modal {
  width: min(720px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 0;
}

.modal::backdrop {
  background: rgba(0, 38, 35, 0.45);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.modal-header h3 {
  margin: 0;
  color: var(--nav);
  font-size: 1rem;
}

.modal-close {
  min-height: 2.1rem;
}

.modal-body {
  max-height: min(72vh, 720px);
  overflow: auto;
  padding: 1rem;
}

.modal-footer {
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

.modal-form {
  width: 100%;
}

.bundle-editor {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem;
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.tenant-form-section {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem;
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.tenant-form-section h4 {
  margin: 0;
  color: var(--nav);
  font-size: 0.9rem;
}

.cell-sub {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.password-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
}

.password-tool .button {
  min-height: 2.45rem;
  padding-inline: 0.65rem;
}

.bundle-editor h4 {
  margin: 0 0 0.35rem;
  color: var(--nav);
  font-size: 0.88rem;
}

.bundle-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px minmax(120px, 0.75fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.bundle-line span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
}

.bundle-line input[type="checkbox"] {
  width: 1rem;
  min-height: 1rem;
}

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

.status-pill {
  min-height: 1.65rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--nav);
  background: rgba(185, 167, 121, 0.18);
  border: 1px solid rgba(185, 167, 121, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 800;
}

.table-link {
  color: var(--nav);
  font-weight: 800;
  text-decoration: none;
}

.invoice-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.invoice-page {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.invoice-header,
.invoice-top,
.invoice-meta,
.invoice-total,
.invoice-transfer {
  display: flex;
  gap: 1rem;
}

.invoice-header,
.invoice-top,
.invoice-total {
  align-items: center;
  justify-content: space-between;
}

.invoice-document {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.invoice-top h1 {
  margin: 0;
  color: var(--nav);
}

.invoice-company,
.invoice-meta > div,
.invoice-transfer {
  flex-direction: column;
}

.invoice-company {
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.82rem;
}

.invoice-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.25rem 0;
  padding: 0.85rem;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
}

.invoice-meta span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--nav);
}

.invoice-transfer {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.blocked-ip-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.blocked-ip-toolbar h3 {
  margin: 0 0 0.25rem;
  color: var(--nav);
  font-size: 1rem;
}

.blocked-ip-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.blocked-ip-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px auto;
  align-items: end;
  gap: 0.65rem;
}

.scanner-status-panel {
  margin-bottom: 1rem;
  padding: 0.75rem;
  color: var(--nav);
  background: rgba(185, 167, 121, 0.16);
  border: 1px solid rgba(185, 167, 121, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 992px) {
  .login-shell {
    padding: 0;
  }

  .login-panel {
    width: 100%;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .login-brand-pane {
    display: none;
  }

  .public-footer {
    width: 100%;
    min-height: 3rem;
    margin: 0;
    padding: 0.75rem 1rem;
  }

  .login-card {
    min-height: calc(100dvh - 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem;
  }

  .login-mobile-brand {
    display: flex;
    margin-bottom: 1.25rem;
  }

  .app {
    display: grid;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-basis: auto;
  }

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

  .admin-user-panel {
    display: none;
  }

  .metrics,
  .grid,
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem;
  }

  .main {
    padding: 1rem;
  }

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

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

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .download {
    align-items: flex-start;
    flex-direction: column;
  }

  .bundle-line,
  .invoice-meta {
    grid-template-columns: 1fr;
  }

  .invoice-header,
  .invoice-top,
  .invoice-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .invoice-company {
    align-items: flex-start;
  }

  .blocked-ip-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .blocked-ip-filter {
    grid-template-columns: 1fr;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 0 1rem 1rem;
  }

  .legal-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .legal-header-actions,
  .not-found-actions,
  .not-found-primary,
  .not-found-secondary {
    width: 100%;
  }
}
