:root {
  --bg: #f5f8fc;
  --bg-strong: #0d1728;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d9e3ef;
  --ink: #122034;
  --ink-soft: #576a83;
  --brand: #118a7d;
  --brand-dark: #0f5f8d;
  --positive: #1d8a4c;
  --negative: #b54343;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Sora", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(17, 138, 125, 0.13), transparent 25%),
    radial-gradient(circle at 90% -10%, rgba(15, 95, 141, 0.13), transparent 24%),
    var(--bg);
}

body.logged-out-view {
  background:
    linear-gradient(117deg, #eef0f4 0%, #eef0f4 48%, transparent 48%),
    linear-gradient(135deg, #2b6cff 0%, #0d53eb 55%, #0840c7 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.1rem 1rem;
  background:
    linear-gradient(165deg, rgba(17, 138, 125, 0.17), transparent 47%),
    linear-gradient(220deg, rgba(15, 95, 141, 0.2), transparent 55%),
    var(--bg-strong);
  color: #d5e7ff;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sidebar-overline {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.74rem;
  color: #7fd4cf;
}

.sidebar-brand h1 {
  margin: 0 0 0.34rem;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
}

.sidebar-brand p {
  margin: 0;
  color: #9fb7d7;
  font-size: 0.83rem;
  line-height: 1.45;
}

.sidebar-nav {
  display: grid;
  gap: 0.42rem;
}

.sidebar-nav-primary {
  margin-top: 1.1rem;
}

.sidebar-nav-secondary {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-nav .menu-link {
  text-decoration: none;
  color: #d5e7ff;
  font-size: 0.87rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.64rem 0.7rem;
  text-align: left;
  width: 100%;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.sidebar-nav .menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.sidebar-nav .menu-link.is-active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.workspace {
  padding: 1.05rem;
  display: grid;
  gap: 0.8rem;
}

.workspace-header {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.08rem 1.12rem;
  background:
    radial-gradient(circle at top right, rgba(16, 104, 154, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(249, 252, 255, 0.95)),
    linear-gradient(35deg, rgba(17, 138, 125, 0.08), rgba(15, 95, 141, 0.06));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 0.92rem;
  box-shadow: 0 14px 24px rgba(18, 32, 52, 0.07);
}

.workspace-header-main {
  display: grid;
  gap: 0.82rem;
}

.workspace-overline {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--brand-dark);
  font-weight: 700;
}

.workspace-header h2 {
  margin: 0 0 0.44rem;
  font-size: clamp(1.28rem, 2.45vw, 2rem);
  letter-spacing: -0.03em;
}

.workspace-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.workspace-header-lead {
  max-width: 760px;
  font-size: 0.95rem;
  line-height: 1.65;
}

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

.workspace-highlight {
  border: 1px solid #d6e2ef;
  border-radius: 16px;
  padding: 0.82rem 0.88rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96)),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.workspace-highlight-primary {
  border-color: #c9d8ef;
  background:
    linear-gradient(135deg, rgba(22, 73, 141, 0.08), rgba(17, 138, 125, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 250, 255, 0.96));
}

.workspace-highlight-label {
  display: inline-block;
  margin-bottom: 0.32rem;
  color: #5c6f86;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace-highlight strong {
  display: block;
  margin: 0;
  color: #0f2742;
  font-size: 1rem;
  font-weight: 800;
}

.workspace-highlight p {
  margin-top: 0.28rem;
  font-size: 0.81rem;
  line-height: 1.55;
}

.workspace-header-side {
  border: 1px solid #d8e2ef;
  border-radius: 18px;
  padding: 0.95rem 0.98rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.95)),
    #fff;
  display: grid;
  align-content: start;
  gap: 0.62rem;
}

.workspace-header-side-kicker {
  color: #6a7a8e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workspace-header-side h3 {
  margin: 0;
  color: #102844;
  font-size: 1.08rem;
  line-height: 1.3;
}

.workspace-header-side-text {
  font-size: 0.84rem;
  line-height: 1.62;
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.header-chip {
  border-radius: 999px;
  border: 1px solid #ccdae9;
  background: #fff;
  padding: 0.32rem 0.6rem;
  font-size: 0.75rem;
  color: #405777;
}

.header-chip-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.9rem;
  box-shadow: 0 12px 24px rgba(18, 32, 51, 0.05);
}

.panel h3 {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
}

.panel h4 {
  margin: 0 0 0.52rem;
  font-size: 0.88rem;
}

.auth-panel,
.account-panel {
  overflow: hidden;
}

.auth-panel-head,
.account-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.auth-panel-head .section-note,
.account-panel-head .section-note {
  margin-bottom: 0;
  max-width: 720px;
}

.auth-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfe0f0;
  border-radius: 999px;
  background: #f7fbff;
  color: #2f5678;
  padding: 0.32rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.auth-layout {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.auth-form-card,
.auth-side-card,
.account-card {
  border: 1px solid #d6e1ee;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  padding: 0.8rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.auth-form-brand {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin-bottom: 1rem;
}

.auth-form-mark {
  width: 32px;
  height: 32px;
  border: 5px solid #f05b2a;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  transform: skewX(-10deg);
}

.auth-form-brand-kicker {
  margin: 0 0 0.08rem;
  color: #5c6d87;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-form-brand strong {
  color: #1f304d;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.auth-grid-form {
  max-width: none;
}

.auth-actions button {
  min-height: 44px;
}

.auth-side-card {
  align-content: start;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.07), transparent 38%),
    linear-gradient(135deg, #1f62ff 0%, #0e56ee 55%, #0b49d4 100%);
  border-color: rgba(255, 255, 255, 0.16);
  color: #edf4ff;
  min-height: 100%;
}

.auth-side-card::before {
  content: "";
  position: absolute;
  inset: -15% auto auto -8%;
  width: 72%;
  height: 150%;
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(-28deg);
  transform-origin: top left;
}

.auth-visual-grid,
.auth-side-copy {
  position: relative;
  z-index: 1;
}

.auth-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.2rem;
  justify-items: center;
  align-items: center;
  margin-bottom: 1.35rem;
  padding: 0.6rem 0.4rem 0.15rem;
}

.auth-orbit {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  position: relative;
}

.auth-orbit::before,
.auth-orbit::after {
  content: "";
  position: absolute;
}

.auth-orbit::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  right: -6px;
  bottom: 20px;
}

.auth-orbit-chart::before {
  inset: 26px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    inset -18px 0 0 -14px rgba(255, 255, 255, 0.52),
    inset 0 -18px 0 -14px rgba(255, 255, 255, 0.52);
}

.auth-orbit-receipt::before {
  width: 38px;
  height: 48px;
  left: 40px;
  top: 34px;
  border: 4px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 -14px 0 -10px rgba(255, 255, 255, 0.3),
    inset 0 12px 0 -9px rgba(255, 255, 255, 0.3);
}

.auth-orbit-vat::before {
  width: 46px;
  height: 46px;
  left: 36px;
  top: 36px;
  border: 4px solid rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  box-shadow: inset 0 0 0 10px transparent;
}

.auth-orbit-vat::after {
  content: "€";
  width: auto;
  height: auto;
  right: 48px;
  bottom: 42px;
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  font-size: 1.6rem;
  font-weight: 800;
}

.auth-orbit-bulb::before {
  width: 38px;
  height: 50px;
  left: 41px;
  top: 28px;
  border: 4px solid rgba(255, 255, 255, 0.38);
  border-radius: 20px 20px 14px 14px;
  clip-path: polygon(0 0, 100% 0, 100% 74%, 66% 74%, 66% 100%, 34% 100%, 34% 74%, 0 74%);
}

.auth-side-copy {
  display: grid;
  gap: 0.75rem;
}

.auth-side-overline {
  margin: 0;
  color: rgba(236, 244, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-side-copy h4 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.35;
  color: #fff;
}

.auth-check-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.38rem;
  color: rgba(236, 244, 255, 0.88);
  font-size: 0.82rem;
}

.auth-side-note {
  margin: 0.65rem 0 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.26);
  padding-top: 0.6rem;
  color: rgba(236, 244, 255, 0.82);
  font-size: 0.81rem;
  line-height: 1.5;
}

.account-price-card {
  min-width: 220px;
  display: grid;
  gap: 0.12rem;
  border: 1px solid #cde0ef;
  border-radius: 14px;
  padding: 0.76rem 0.82rem;
  background:
    radial-gradient(circle at top left, rgba(17, 138, 125, 0.14), transparent 42%),
    linear-gradient(135deg, #fafdff, #f2f8ff);
}

.account-price-overline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.account-price-card strong {
  font-size: 1.38rem;
  letter-spacing: -0.03em;
  color: var(--brand-dark);
}

.account-price-card span {
  color: #4f6681;
  font-size: 0.8rem;
  line-height: 1.45;
}

.account-layout {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.account-main-stack,
.account-side-stack {
  display: grid;
  gap: 0.75rem;
}

.account-card > h4 {
  margin-bottom: 0.65rem;
}

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

.account-status-list div {
  min-height: 84px;
  display: grid;
  align-content: center;
}

.billing-card {
  background:
    radial-gradient(circle at top right, rgba(15, 95, 141, 0.08), transparent 45%),
    linear-gradient(180deg, #fcfeff, #f6fbff);
}

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

.account-actions button {
  min-height: 46px;
}

body.logged-out-view .app-shell {
  grid-template-columns: 1fr;
}

body.logged-out-view .sidebar,
body.logged-out-view .workspace-header {
  display: none;
}

body.logged-out-view .workspace {
  min-height: 100vh;
  padding: 2.2rem;
  align-content: center;
}

body.logged-out-view .auth-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body.logged-out-view .auth-panel-head {
  display: none;
}

body.logged-out-view .auth-layout {
  gap: 0;
  grid-template-columns: minmax(350px, 500px) minmax(320px, 1fr);
  min-height: min(740px, calc(100vh - 4.4rem));
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 28px 60px rgba(22, 35, 68, 0.18);
}

body.logged-out-view .auth-form-card {
  padding: 2.3rem 2.15rem 1.85rem;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.98));
  box-shadow: none;
  display: grid;
  align-content: center;
}

body.logged-out-view .auth-form-brand {
  margin-bottom: 1.4rem;
}

body.logged-out-view .auth-grid-form {
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

body.logged-out-view .auth-grid-form label {
  gap: 0.42rem;
  font-size: 0.85rem;
  color: #304761;
}

body.logged-out-view .auth-grid-form input {
  min-height: 48px;
  border-radius: 10px;
  border-color: #cbd6e4;
  background: #fff;
}

body.logged-out-view .auth-actions {
  margin-top: 0.35rem;
  justify-content: flex-start;
}

body.logged-out-view .auth-actions button {
  min-width: 170px;
  min-height: 48px;
  border-radius: 999px;
}

body.logged-out-view #login-btn {
  background: linear-gradient(135deg, #2064ff, #0d53eb);
  box-shadow: 0 14px 28px rgba(26, 91, 244, 0.25);
}

body.logged-out-view #register-btn {
  background: #fff;
  border-color: #b7c9e0;
  color: #244568;
}

body.logged-out-view #auth-message {
  margin-top: 0.85rem;
}

body.logged-out-view .auth-side-card {
  border: 0;
  border-radius: 0;
  padding: 2.2rem 2.3rem;
  min-height: 100%;
}

.hidden {
  display: none !important;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

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

.delivery-fields {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.58rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #d3dfef;
  border-radius: 10px;
  background: #f7fbff;
  padding: 0.6rem;
}

.automation-template-toolbar {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.automation-template-toolbar .form-actions {
  grid-column: auto;
  margin: 0;
}

#invoice-issuer-vat[readonly] {
  background: #f4f7fb;
  border-color: #d3dfef;
  font-weight: 700;
}

.delivery-fields .section-note {
  grid-column: 1 / -1;
  margin: 0;
}

.field-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.compact-form {
  max-width: 680px;
}

label {
  display: grid;
  gap: 0.26rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

label:has(input[required]):not(.checkbox-field),
label:has(select[required]):not(.checkbox-field),
label:has(textarea[required]):not(.checkbox-field) {
  position: relative;
  padding-left: 0.72rem;
}

label:has(input[required]):not(.checkbox-field)::before,
label:has(select[required]):not(.checkbox-field)::before,
label:has(textarea[required]):not(.checkbox-field)::before {
  content: "*";
  position: absolute;
  left: 0;
  top: 0;
  color: #b42318;
  font-weight: 800;
}

.field-note {
  color: #5d728b;
  font-size: 0.74rem;
  line-height: 1.35;
}

input[readonly] {
  background: #f5f8fc;
}

.checkbox-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border: 1px solid #ccd7e8;
  border-radius: 8px;
  padding: 0.5rem 0.56rem;
  background: #fff;
  color: var(--ink-soft);
}

.checkbox-field input[type="checkbox"] {
  width: auto;
}

input,
select,
textarea,
button {
  width: 100%;
  font: inherit;
  border-radius: 8px;
}

input,
select,
textarea {
  border: 1px solid #ccd7e8;
  background: #fff;
  color: var(--ink);
  padding: 0.5rem 0.56rem;
  font-size: 0.86rem;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

button {
  border: 0;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  max-width: 320px;
  padding: 0.58rem 0.8rem;
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.secondary-btn {
  background: #fff;
  border: 1px solid #c5d4e8;
  color: #275175;
}

.sidebar .menu-link {
  max-width: none;
  color: #d5e7ff;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.64rem 0.7rem;
}

.sidebar .menu-link:hover {
  transform: none;
  filter: none;
}

.inline-note {
  margin: 0;
  border: 1px solid #f0c980;
  background: #fff8e9;
  color: #815a1f;
  border-radius: 8px;
  padding: 0.35rem 0.52rem;
  font-size: 0.78rem;
}

.top-gap {
  margin-top: 0.7rem;
}

.profile-list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.billing-picker {
  display: grid;
  gap: 0.9rem;
}

.billing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.billing-tariff-kicker {
  margin: 0 0 0.2rem;
  color: #6e7f95;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.billing-seal {
  min-width: 148px;
  display: grid;
  gap: 0.18rem;
  border: 1px solid #d2b878;
  border-radius: 16px;
  padding: 0.7rem 0.82rem;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 40%),
    linear-gradient(180deg, #fff4d0, #f0d08d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  text-align: right;
}

.billing-seal strong {
  color: #123d73;
  font-size: 1.42rem;
  line-height: 1;
}

.billing-seal span {
  color: #6a4c1f;
  font-size: 0.75rem;
  font-weight: 700;
}

.billing-summary-card {
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(18, 61, 115, 0.08), transparent 42%),
    linear-gradient(180deg, #fffdf8, #f9f1dd);
  border: 1px solid #e1cb97;
  padding: 0.88rem 0.92rem;
}

.billing-summary-card-formal {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.billing-summary-card .section-note {
  margin: 0;
  color: #5d6575;
}

.billing-selection-summary {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 800;
  color: #123d73;
}

.billing-selection-actions {
  margin-top: 0;
}

.billing-plan-list {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.billing-plan-card {
  width: 100%;
  max-width: none;
  border: 1px solid #d6deeb;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.98)),
    #fff;
  color: #11253b;
  padding: 0.88rem 0.92rem;
  text-align: left;
  display: grid;
  gap: 0.45rem;
}

.billing-plan-card:hover {
  border-color: #9bb6d9;
  box-shadow: 0 10px 24px rgba(18, 32, 51, 0.08);
}

.billing-plan-card.is-active {
  border-color: #174f95;
  box-shadow: 0 0 0 2px rgba(23, 79, 149, 0.14);
}

.billing-plan-card.is-owned {
  border-color: #bfd9c6;
  background:
    linear-gradient(180deg, rgba(245, 252, 246, 0.98), rgba(237, 247, 240, 0.98)),
    #f2fbf4;
}

.billing-plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.billing-plan-card-title {
  margin: 0;
  color: #11253b;
  font-size: 0.86rem;
  font-weight: 800;
}

.billing-plan-card-meta {
  margin: 0.12rem 0 0;
  color: #6d7f93;
  font-size: 0.75rem;
}

.billing-plan-card-price {
  margin: 0;
  color: #123d73;
  font-size: 1rem;
  font-weight: 800;
}

.billing-plan-card-note {
  margin: 0;
  color: #4d5f75;
  font-size: 0.78rem;
  line-height: 1.45;
}

.billing-plan-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d5deea;
  background: #f7faff;
  color: #35506f;
  padding: 0.24rem 0.62rem;
  font-size: 0.71rem;
  font-weight: 800;
  white-space: nowrap;
}

.billing-plan-card.is-active .billing-plan-card-badge {
  border-color: #8eb0dc;
  background: #eaf2ff;
  color: #123d73;
}

.billing-plan-card.is-owned .billing-plan-card-badge {
  border-color: #b6d7bc;
  background: #e7f6ea;
  color: #21653c;
}

.billing-option-list {
  display: grid;
  gap: 0.55rem;
}

.billing-tariff-header,
.billing-type-card {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) 120px 120px minmax(0, 1.25fr) 120px;
  align-items: center;
  gap: 0.8rem;
}

.billing-tariff-header {
  border-radius: 14px;
  background: linear-gradient(180deg, #174f95, #0d3870);
  color: #fff;
  padding: 0.86rem 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
  font-weight: 800;
}

.billing-type-card {
  border: 1px solid #d6deeb;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.96)),
    #fff;
  padding: 0.88rem 0.92rem;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.billing-type-card:hover {
  transform: translateY(-1px);
  border-color: #9bb6d9;
  box-shadow: 0 10px 24px rgba(18, 32, 51, 0.08);
}

.billing-type-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.86;
}

.billing-type-card input[type="checkbox"] {
  width: 1.08rem;
  height: 1.08rem;
  margin: 0;
}

.billing-type-card-main {
  min-width: 0;
}

.billing-type-card-title {
  margin: 0;
  color: #11253b;
  font-size: 0.9rem;
  font-weight: 800;
}

.billing-type-card-code {
  margin: 0.12rem 0 0;
  color: #6d7f93;
  font-size: 0.76rem;
}

.billing-type-card-duration,
.billing-type-card-note {
  margin: 0;
  color: #4d5f75;
  font-size: 0.79rem;
  line-height: 1.45;
}

.billing-type-card-price {
  margin: 0;
  color: #123d73;
  font-size: 0.88rem;
  font-weight: 800;
}

.billing-type-card-control {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.billing-status-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  background: #e7f6ea;
  border: 1px solid #b6d7bc;
  color: #21653c;
  padding: 0.2rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 800;
}

.billing-type-card.is-owned {
  border-color: #bfd9c6;
  background:
    linear-gradient(180deg, rgba(245, 252, 246, 0.98), rgba(237, 247, 240, 0.98)),
    #f2fbf4;
}

.billing-type-card.is-owned .billing-type-card-price {
  color: var(--positive);
}

.billing-owned-block h4 {
  margin-bottom: 0.45rem;
}

.billing-owned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.billing-owned-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8c79e;
  border-radius: 999px;
  background: #fff7e5;
  color: #5b4b21;
  padding: 0.3rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  background: var(--surface-soft);
}

.profile-card.is-active {
  border-color: #96b8e8;
  box-shadow: 0 0 0 1px rgba(54, 111, 214, 0.14);
  background: #f7fbff;
}

.profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.profile-card-head h5 {
  margin: 0;
}

.profile-card h5 {
  margin: 0 0 0.36rem;
  font-size: 0.86rem;
}

.profile-card p {
  margin: 0.12rem 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.profile-actions {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.4rem;
}

.profile-actions button {
  max-width: none;
  padding: 0.42rem 0.55rem;
  font-size: 0.76rem;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.admin-badge,
.admin-user-role {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6c58d;
  border-radius: 999px;
  background: #fff7e3;
  color: #6c5723;
  padding: 0.3rem 0.62rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-layout {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

.pelatologio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

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

.pelatologio-list-card {
  margin-top: 0.8rem;
}

.pelatologio-entry-card .profile-actions {
  flex-wrap: wrap;
}

.admin-form-card,
.admin-list-card {
  overflow: hidden;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.check-row input[type="checkbox"] {
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 auto;
}

.admin-feature-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  border: 1px solid #d9e4f0;
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
  background: #f9fbff;
}

.admin-feature-head h5 {
  margin: 0 0 0.18rem;
  font-size: 0.84rem;
}

.admin-feature-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.admin-feature-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-feature-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  border: 1px solid #d6deeb;
  border-radius: 12px;
  padding: 0.65rem 0.7rem;
  background: #fff;
  cursor: pointer;
}

.admin-feature-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.admin-feature-card input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0.08rem 0 0;
}

.admin-feature-card strong {
  display: block;
  color: #123d73;
  font-size: 0.8rem;
}

.admin-feature-card p {
  margin: 0.14rem 0 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.45;
}

.admin-user-list {
  display: grid;
  gap: 0.6rem;
}

.customer-detail-panel {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: #fbfdff;
}

.customer-detail-head {
  margin-bottom: 0.5rem;
}

.customer-detail-head h4 {
  margin: 0 0 0.2rem;
}

.customer-detail-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-detail-toolbar button {
  max-width: none;
}

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

.status-list div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.56rem;
  background: var(--surface-soft);
}

dt {
  margin: 0 0 0.12rem;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  word-break: break-word;
}

.submission-status {
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
  display: grid;
  gap: 0.25rem;
}

.submission-status p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.credit-link-panel {
  display: grid;
  gap: 0.55rem;
  grid-column: 1 / -1;
  border: 1px dashed #c8d6e8;
  border-radius: 12px;
  padding: 0.72rem;
  background: #f8fbff;
}

.credit-link-panel .section-note {
  margin: 0;
}

.b2g-panel {
  display: grid;
  gap: 0.55rem;
  grid-column: 1 / -1;
  border: 1px dashed #c9d4c7;
  border-radius: 12px;
  padding: 0.72rem;
  background: #f8fcf7;
}

.b2g-panel .section-note {
  margin: 0;
}

.credit-link-actions {
  margin-top: 0;
}

.b2g-actions {
  margin-top: 0;
}

.table-scroll {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  background: #fff;
}

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

.sales-table th,
.sales-table td {
  padding: 0.48rem 0.52rem;
  border-bottom: 1px solid #dce6f2;
  text-align: left;
  white-space: nowrap;
}

.sales-table th {
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.76rem;
}

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

.table-actions {
  display: flex;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.table-actions button {
  max-width: none;
  padding: 0.38rem 0.54rem;
  font-size: 0.74rem;
}

.debt-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0.2rem 0.62rem;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.debt-status-chip.is-paid {
  border: 1px solid #b7e1cd;
  background: #ecfbf2;
  color: #1f6b43;
}

.debt-status-chip.is-unpaid {
  border: 1px solid #efc1c1;
  background: #fff1f1;
  color: #9d2f2f;
}

.logo-preview-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

#pdf-logo-preview {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border: 1px dashed #b9cbe3;
  border-radius: 10px;
  background: #fff;
}

#pdf-logo-preview:not([src]) {
  display: none;
}

.section-note {
  margin: 0 0 0.62rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

#invoice-classification-note {
  grid-column: 1 / -1;
  margin-top: -0.14rem;
}

.a4-sheet {
  --sheet-accent: #0f5f8d;
  width: min(100%, 210mm);
  min-height: 297mm;
  margin: 0 auto;
  padding: 11mm 12mm 9mm;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 24px rgba(18, 32, 51, 0.08);
  display: grid;
  gap: 0;
  color: #14243c;
  overflow: hidden;
}

.sheet-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-brand-row {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  max-width: 60%;
}

.sheet-logo-wrap {
  width: 76px;
  min-width: 76px;
  height: 76px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d9dfe8;
}

#pdf-company-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

#pdf-company-logo:not([src]) {
  display: none;
}

.sheet-brand-copy {
  display: grid;
  gap: 0.12rem;
}

.sheet-kicker {
  margin: 0;
  color: #5b6d86;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#pdf-company-name {
  margin: 0 0 0.26rem;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: #283b5a;
}

#pdf-company-meta,
#pdf-company-contact {
  margin: 0.12rem 0;
  font-size: 0.82rem;
  color: #4d607b;
}

.sheet-title-panel {
  display: grid;
  justify-items: end;
  text-align: right;
  align-content: start;
  gap: 0.34rem;
  min-width: 240px;
}

.sheet-main-title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 0.94;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #303949;
}

.sheet-accent-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.9rem 0 1rem;
}

.sheet-accent-row span {
  flex: 1;
  height: 14px;
  background: var(--sheet-accent);
}

.sheet-intro-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sheet-intro-card {
  min-height: 112px;
  display: grid;
  align-content: start;
  border: 1px solid #d9dfe8;
  padding: 0.78rem 0.88rem;
  background: #fff;
}

.sheet-intro-recipient h5 {
  margin: 0 0 0.28rem;
  font-size: 1.03rem;
  color: #2a3b5b;
}

.sheet-intro-recipient p {
  margin: 0.12rem 0;
  font-size: 0.8rem;
  color: #4e6078;
}

.sheet-doc-grid {
  width: 100%;
  display: grid;
  gap: 0.45rem 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-doc-item {
  display: grid;
  gap: 0.14rem;
  padding-top: 0.42rem;
  border-top: 1px solid #d7dfeb;
}

.sheet-doc-item span {
  color: #6c7b92;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheet-doc-item strong {
  color: #20334f;
  font-size: 0.84rem;
}

.sheet-doc-item-wide {
  grid-column: 1 / -1;
}

.sheet-block-label {
  margin: 0 0 0.42rem;
  color: #506584;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet-lines-wrap {
  border: 1px solid #d9dfe8;
  overflow: hidden;
  margin-bottom: 1rem;
}

.sheet-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}

.sheet-lines th,
.sheet-lines td {
  border-bottom: 1px solid #e4e8ef;
  padding: 0.58rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.sheet-lines th {
  background: #303236;
  font-size: 0.72rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sheet-lines-empty td {
  color: transparent;
  height: 50px;
}

.sheet-lines tbody tr:last-child td {
  border-bottom: 0;
}

.sheet-delivery {
  border: 1px solid #d9dfe8;
  padding: 0.7rem 0.8rem;
  background: #fff;
  display: grid;
  gap: 0.24rem;
  margin-bottom: 1rem;
}

.sheet-delivery h5 {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  color: #283e60;
}

.sheet-delivery p {
  margin: 0.08rem 0;
  font-size: 0.8rem;
}

.sheet-lower-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

.sheet-lower-left,
.sheet-lower-right {
  display: grid;
  gap: 0.7rem;
}

.sheet-info-card,
.summary-card {
  border: 1px solid #d9dfe8;
  padding: 0.74rem 0.82rem;
  background: #fff;
}

.sheet-info-card h5,
.summary-card h5 {
  margin: 0 0 0.38rem;
  font-size: 0.82rem;
  color: #2a3b5b;
}

.sheet-info-card p {
  margin: 0;
  color: #4f6078;
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sheet-side-list {
  margin: 0;
  display: grid;
  gap: 0.28rem;
}

.sheet-side-list div {
  display: grid;
  gap: 0.1rem;
}

.sheet-side-list dt,
.sheet-side-list dd {
  margin: 0;
}

.sheet-side-list dt {
  color: #667890;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sheet-side-list dd {
  color: #20334f;
  font-size: 0.8rem;
  font-weight: 700;
}

.sheet-totals {
  margin: 0;
  display: grid;
  gap: 0.34rem;
}

.sheet-totals div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px dashed #d7e2f0;
}

.sheet-totals div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.sheet-totals dt,
.sheet-totals dd {
  margin: 0;
  font-size: 0.8rem;
}

.sheet-totals dt {
  color: #4d607b;
}

.sheet-totals dd {
  text-align: right;
  font-weight: 700;
  color: #16304d;
}

.summary-card-totals {
  display: grid;
  gap: 0.7rem;
}

.summary-card-support {
  display: grid;
  justify-items: end;
  align-content: start;
  min-height: 100%;
}

.sheet-qr h5 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}

.sheet-qr img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  border: 1px dashed #b9cbe3;
  border-radius: 8px;
  background: #fff;
}

.sheet-qr img:not([src]) {
  display: none;
}

.sheet-grand-total {
  display: grid;
  gap: 0.18rem;
  justify-items: end;
  padding: 0.5rem 0.6rem;
  border-top: 3px solid var(--sheet-accent);
  background: #f8f4e3;
}

.sheet-grand-total span {
  color: #566984;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-grand-total strong {
  color: #293e63;
  font-size: 1.5rem;
  line-height: 1;
}

.sheet-bottom-bar {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 3px solid var(--sheet-accent);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-bottom-bar p {
  margin: 0;
  color: #556882;
  font-size: 0.76rem;
}

.sheet-signature-box {
  display: grid;
  justify-items: end;
  padding-top: 0;
}

.sheet-signature-box span {
  min-width: 150px;
  padding-top: 0.4rem;
  border-top: 2px solid #cfd8e6;
  color: #566984;
  font-size: 0.78rem;
  text-align: center;
}

#preview-document-note {
  margin: 0;
  color: #2a4668;
  font-weight: 600;
  white-space: pre-wrap;
}

.sheet-hidden-values {
  display: none;
}

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

.authority-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.66rem;
  background: var(--surface-soft);
}

.can-block {
  border-left: 4px solid var(--positive);
}

.cannot-block {
  border-left: 4px solid var(--negative);
}

.neutral-block {
  margin-top: 0.62rem;
  border-left: 4px solid #4f6988;
}

.qr-block {
  margin-top: 0.62rem;
  border-left: 4px solid #19668a;
}

.authority-block ul,
#authority-endpoint-family-list,
#authority-source-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.32rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.authority-meta {
  margin-top: 0.62rem;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.66rem;
  background: var(--surface-soft);
}

.mini-status-list {
  margin: 0;
  display: grid;
  gap: 0.28rem;
}

.mini-status-list div {
  padding-bottom: 0.24rem;
  border-bottom: 1px dashed #d0dced;
}

.mini-status-list div:last-child {
  border-bottom: 0;
}

.meta-note {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

#authority-source-list a {
  color: var(--brand-dark);
  text-decoration: none;
  border-bottom: 1px dashed #89a9ce;
}

#authority-source-list a:hover {
  color: var(--brand);
}

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

.reference-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.64rem;
  background: var(--surface-soft);
}

.reference-grid ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

#policy-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.34rem;
  color: var(--ink-soft);
  font-size: 0.83rem;
}

@media (max-width: 1260px) {
  .workspace-header,
  .workspace-header-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .auth-layout,
  .account-layout,
  .pelatologio-layout {
    grid-template-columns: 1fr;
  }

  .authority-meta,
  .reference-grid,
  .sheet-lower-grid {
    grid-template-columns: 1fr;
  }

  .sheet-intro-grid {
    grid-template-columns: 1fr;
  }

  body.logged-out-view .auth-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 0.86rem;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  .sidebar-nav-secondary {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .workspace {
    padding: 0.8rem;
  }

  .auth-panel-head,
  .account-panel-head,
  .admin-panel-head {
    flex-direction: column;
  }

  .workspace-header {
    padding: 0.94rem;
  }

  .auth-badge-row {
    justify-content: flex-start;
  }

  .sheet-topbar {
    flex-direction: column;
  }

  .sheet-brand-row {
    max-width: none;
  }

  .sheet-title-panel {
    width: 100%;
    justify-items: start;
    text-align: left;
  }

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

  body.logged-out-view .workspace {
    padding: 1rem;
  }

  body.logged-out-view .auth-layout {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .grid-form,
  .status-list,
  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .delivery-fields {
    grid-template-columns: 1fr;
  }

  .automation-template-toolbar {
    grid-template-columns: 1fr;
  }

  .billing-card-head {
    flex-direction: column;
  }

  .billing-seal {
    width: 100%;
    text-align: left;
  }

  .billing-tariff-header,
  .billing-type-card {
    grid-template-columns: 1fr;
  }

  .workspace-highlight,
  .workspace-header-side {
    padding: 0.76rem 0.78rem;
  }

  .workspace-header,
  .panel {
    padding: 0.72rem;
  }

  .sheet-accent-row {
    gap: 0.4rem;
  }

  .sheet-accent-row span {
    height: 10px;
  }

  .sheet-bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }

  body.logged-out-view .auth-form-card,
  body.logged-out-view .auth-side-card {
    padding: 1.3rem 1.1rem;
  }

  body.logged-out-view .auth-visual-grid {
    gap: 1rem;
  }

  body.logged-out-view .auth-orbit {
    width: 92px;
    height: 92px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    background: #fff !important;
    overflow: hidden;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .sidebar,
  .workspace-header,
  .auth-panel,
  .account-panel,
  .mydata-panel,
  .products-panel,
  .customers-panel,
  .automation-panel,
  .pdf-settings-panel,
  .pos-settings-panel,
  .reports-panel,
  .invoice-panel,
  .authority-card,
  .reference-card,
  .system-card {
    display: none !important;
  }

  .workspace {
    padding: 0;
  }

  .preview-panel > h3,
  .preview-panel > .section-note {
    display: none !important;
  }

  .print-area {
    display: block !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 210mm;
    height: 297mm;
    overflow: hidden;
  }

  .a4-sheet {
    width: 200mm;
    height: 285mm;
    min-height: 285mm;
    margin: 4mm auto 0;
    padding: 6.2mm 7.2mm 5.8mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .sheet-topbar {
    gap: 0.82rem;
  }

  .sheet-logo-wrap {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  #pdf-company-logo {
    width: 48px;
    height: 48px;
  }

  .sheet-main-title {
    font-size: 2.04rem;
  }

  .sheet-accent-row {
    margin: 0.58rem 0 0.72rem;
  }

  .sheet-accent-row span {
    height: 11px;
  }

  .sheet-intro-grid {
    gap: 0.74rem;
    margin-bottom: 0.72rem;
  }

  .sheet-intro-card,
  .sheet-info-card,
  .summary-card,
  .sheet-delivery {
    padding: 0.56rem 0.62rem;
  }

  .sheet-intro-card {
    min-height: 92px;
  }

  .sheet-doc-grid {
    gap: 0.32rem 0.66rem;
  }

  .sheet-doc-item {
    padding-top: 0.3rem;
  }

  .sheet-lines-wrap,
  .sheet-delivery {
    margin-bottom: 0.72rem;
  }

  .sheet-lines {
    font-size: 0.77rem;
  }

  .sheet-lines th,
  .sheet-lines td {
    padding: 0.4rem 0.38rem;
  }

  .sheet-lines th {
    font-size: 0.67rem;
  }

  .sheet-lines-empty td {
    height: 20px;
  }

  .sheet-lower-grid {
    grid-template-columns: 1.12fr 0.88fr;
    gap: 0.76rem;
  }

  .sheet-lower-left,
  .sheet-lower-right {
    gap: 0.5rem;
  }

  .sheet-info-card h5,
  .summary-card h5,
  .sheet-qr h5,
  .sheet-delivery h5 {
    margin-bottom: 0.24rem;
    font-size: 0.77rem;
  }

  .sheet-info-card p,
  .sheet-side-list dt,
  .sheet-side-list dd,
  .sheet-totals dt,
  .sheet-totals dd,
  .sheet-delivery p,
  .sheet-bottom-bar p {
    font-size: 0.71rem;
    line-height: 1.38;
  }

  .sheet-totals div {
    padding-bottom: 0.2rem;
  }

  .sheet-grand-total {
    padding: 0.38rem 0.46rem;
  }

  .sheet-grand-total span {
    font-size: 0.67rem;
  }

  .sheet-grand-total strong {
    font-size: 1.22rem;
  }

  .sheet-qr img {
    width: 86px;
    height: 86px;
  }

  .sheet-bottom-bar {
    margin-top: 0.72rem;
    padding-top: 0.48rem;
  }

  .sheet-signature-box span {
    min-width: 126px;
    font-size: 0.69rem;
  }
}
