/* ==========================================================================
   InvoiceMail — application stylesheet
   ========================================================================== */

:root {
    --bg: #f1f7fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --ink: #0f172a;
    --ink-2: #1e293b;
    --body: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e6e9f2;
    --line-2: #eef1f7;
    --brand: #0b7fbf;
    --brand-600: #0a6da6;
    --brand-700: #085a89;
    --brand-soft: #e9f4fb;
    --brand-ring: rgba(11, 127, 191, 0.16);
    --violet: #2aa9dd;
    --success: #059669;
    --success-soft: #ecfdf5;
    --success-line: #a7f3d0;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #0284c7;
    --info-soft: #f0f9ff;
    --sidebar: #03202d;
    --radius: 16px;
    --radius-sm: 11px;
    --radius-xs: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px -22px rgba(15, 23, 42, 0.22);
    --shadow-lg: 0 24px 60px -22px rgba(15, 23, 42, 0.32);
    --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 420px at 100% -8%, rgba(11, 127, 191, 0.07), transparent 62%),
        radial-gradient(720px 360px at -8% 108%, rgba(56, 189, 248, 0.055), transparent 62%);
}

h1, h2, h3, h4, p {
    margin-top: 0;
}

h1, h2, h3, h4 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

h1 {
    font-size: clamp(22px, 2.2vw, 30px);
    margin-bottom: 0;
}

h2 {
    font-size: 16px;
    margin-bottom: 0;
}

h3 {
    font-size: 15px;
}

p {
    margin-bottom: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

button {
    cursor: pointer;
}

ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

::selection {
    background: rgba(11, 127, 191, 0.22);
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

[hidden],
.hidden,
.is-hidden {
    display: none !important;
}

.nav-open {
    overflow: hidden;
}

.visually-hidden-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --------------------------------------------------------------------------
   Icons & helpers
   -------------------------------------------------------------------------- */

.icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.pre-line {
    white-space: pre-line;
}

.center {
    text-align: center;
}

.tiny {
    font-size: 11px;
}

.text-success {
    color: var(--success);
    font-weight: 600;
}

.text-danger {
    color: var(--danger);
    font-weight: 600;
}

.mt-32 {
    margin-top: 32px;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand-600);
    font-size: 13px;
    font-weight: 600;
}

.link:hover {
    color: var(--brand-700);
}

.link .icon {
    width: 14px;
    height: 14px;
    transition: transform 0.18s ease;
}

.link:hover .icon {
    transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-2);
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn:active {
    transform: translateY(0) scale(0.99);
}

.btn-primary {
    background: linear-gradient(135deg, #0b7fbf 0%, #0a6da6 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px -12px rgba(11, 127, 191, 0.9);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 28px -14px rgba(11, 127, 191, 0.95);
    color: #ffffff;
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink-2);
}

.btn-ghost:hover {
    background: #fbfcff;
    border-color: #d6dbe8;
    color: var(--ink);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 10px 22px -14px rgba(5, 150, 105, 0.9);
}

.btn-success:hover {
    background: #047857;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 10px 22px -14px rgba(220, 38, 38, 0.9);
}

.btn-danger:hover {
    background: #b91c1c;
    color: #ffffff;
}

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

.btn-danger-soft:hover {
    background: #fee2e2;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-compact {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    background: var(--brand-soft);
    color: var(--brand-600);
}

.icon-btn .icon {
    width: 16px;
    height: 16px;
}

.icon-btn-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* --------------------------------------------------------------------------
   Badges & alerts
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.45;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-paid {
    background: var(--success-soft);
    color: var(--success);
}

.badge-sent {
    background: var(--brand-soft);
    color: var(--brand-700);
}

.badge-overdue {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-draft {
    background: #f1f5f9;
    color: var(--muted);
}

.badge-brand {
    background: var(--brand-soft);
    color: var(--brand-700);
}

.badge-soft {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
}

.badge-soft::before {
    display: none;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.alert .icon {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.alert-success {
    background: var(--success-soft);
    border-color: var(--success-line);
    color: #065f46;
}

.alert-error {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-soft);
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: var(--info-soft);
    border-color: #bae6fd;
    color: #075985;
}

.alert code {
    background: rgba(255, 255, 255, 0.55);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

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

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line-2);
}

.card-head h2 {
    font-size: 15.5px;
}

.card-head p {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 3px;
}

.card-body {
    padding: 22px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field {
    margin-bottom: 16px;
    min-width: 0;
}

.field:last-child {
    margin-bottom: 0;
}

.field label,
.field-label-row > label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 600;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.field-label-row > label {
    margin-bottom: 0;
}

.optional {
    color: var(--muted-2);
    font-weight: 500;
    font-size: 11px;
}

.hint {
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 11.5px;
    line-height: 1.6;
}

.hint code,
.info-strip code {
    background: rgba(11, 127, 191, 0.08);
    color: var(--brand-700);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

.input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    appearance: none;
}

.input:hover {
    border-color: #d7dce9;
}

.input:focus {
    outline: none;
    border-color: #7fd0f0;
    box-shadow: 0 0 0 4px var(--brand-ring);
}

.input::placeholder {
    color: #a6b0c4;
}

.input:disabled {
    background: #f8fafc;
    color: var(--muted);
}

textarea.input {
    height: auto;
    min-height: 92px;
    padding: 12px 13px;
    line-height: 1.6;
    resize: vertical;
}

select.input {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

input[type="date"].input {
    padding-right: 10px;
}

.input-group {
    position: relative;
}

.input-group > .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted-2);
    pointer-events: none;
}

.input-group .input {
    padding-left: 38px;
}

.input-prefix {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}

.input-group .input:has(+ .input-prefix) {
    padding-left: 13px;
}

.input-action {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-2);
}

.input-action:hover {
    background: var(--surface-2);
    color: var(--brand-600);
}

.input-action .icon {
    width: 16px;
    height: 16px;
}

.field-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 11.5px;
    font-weight: 500;
}

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

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

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line-2);
    flex-wrap: wrap;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.checkbox-row input {
    accent-color: var(--brand);
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 16px 16px;
    overflow: hidden;
    color: #cbd5e1;
    background:
        radial-gradient(480px 300px at 0% 0%, rgba(11, 127, 191, 0.2), transparent 62%),
        radial-gradient(380px 260px at 100% 100%, rgba(56, 189, 248, 0.08), transparent 60%),
        linear-gradient(180deg, #03202d 0%, #02141d 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 60;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #0b7fbf, #38bdf8);
    color: #ffffff;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: -0.02em;
    box-shadow: 0 10px 22px -10px rgba(11, 127, 191, 0.95);
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text {
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-text small {
    display: block;
    margin-top: 1px;
    color: #64748b;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav {
    flex: 1;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.nav::-webkit-scrollbar {
    width: 4px;
}

.nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99px;
}

.nav-label {
    margin: 16px 12px 7px;
    color: #475569;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav-link .icon {
    width: 17px;
    height: 17px;
    opacity: 0.9;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.055);
    color: #e2e8f0;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(11, 127, 191, 0.98), rgba(56, 189, 248, 0.92));
    color: #ffffff;
    box-shadow: 0 12px 26px -14px rgba(11, 127, 191, 0.95);
}

.sidebar-foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.sidebar-note-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.sidebar-note-icon .icon {
    width: 15px;
    height: 15px;
}

.sidebar-note strong {
    display: block;
    color: #e2e8f0;
    font-size: 11.5px;
    font-weight: 600;
}

.sidebar-note span {
    display: block;
    color: #64748b;
    font-size: 10px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 4px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0b7fbf, #2aa9dd);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 11px;
}

.user-meta {
    min-width: 0;
    flex: 1;
}

.user-meta strong {
    display: block;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta span {
    display: block;
    color: #64748b;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card .icon-btn {
    color: #64748b;
}

.user-card .icon-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f87171;
}

.main-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 72px;
    padding: 0 30px;
    background: rgba(244, 246, 251, 0.78);
    border-bottom: 1px solid rgba(230, 233, 242, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.menu-toggle {
    display: none;
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 320px;
    max-width: 34vw;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.topbar-search:focus-within {
    border-color: #7fd0f0;
    box-shadow: 0 0 0 4px var(--brand-ring);
}

.topbar-search .icon {
    width: 16px;
    height: 16px;
    color: var(--muted-2);
}

.topbar-search input {
    width: 100%;
    height: 100%;
    padding: 0 8px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--ink);
}

.topbar-search input::placeholder {
    color: #a6b0c4;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.dropdown {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 3px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-menu-btn:hover {
    background: var(--surface);
    border-color: var(--line);
}

.user-menu-btn .chevron {
    width: 13px;
    height: 13px;
    margin-right: 2px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 236px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    z-index: 80;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-head {
    padding: 10px 11px 9px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line-2);
}

.dropdown-head strong {
    display: block;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-head span {
    display: block;
    color: var(--muted-2);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--body);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    transition: background 0.14s ease, color 0.14s ease;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.dropdown-menu .icon {
    width: 15px;
    height: 15px;
    color: var(--muted-2);
}

.dropdown-menu form {
    margin: 0;
}

.content {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 30px 70px;
    flex: 1;
    animation: contentIn 0.35s ease both;
}

@keyframes contentIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.sidebar-backdrop {
    display: none;
}

/* --------------------------------------------------------------------------
   Page headers
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-head > div:first-child {
    min-width: 0;
}

.eyebrow {
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.page-sub {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.title-with-badge h1 {
    letter-spacing: -0.035em;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: var(--brand-600);
}

.back-link .icon {
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

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

.stat-card {
    position: relative;
    padding: 20px;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    top: -70px;
    right: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(11, 127, 191, 0.08), transparent 70%);
    pointer-events: none;
}

.stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.stat-icon .icon {
    width: 19px;
    height: 19px;
}

.stat-brand {
    background: var(--brand-soft);
    color: var(--brand-600);
}

.stat-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.stat-success {
    background: var(--success-soft);
    color: var(--success);
}

.stat-info {
    background: var(--info-soft);
    color: var(--info);
}

.stat-value {
    margin-top: 16px;
    color: var(--ink);
    font-size: clamp(21px, 1.8vw, 27px);
    font-weight: 750;
    letter-spacing: -0.04em;
    line-height: 1.15;
    word-break: break-word;
}

.stat-label {
    margin-top: 3px;
    color: var(--body);
    font-size: 12.5px;
    font-weight: 600;
}

.stat-meta {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 11.5px;
}

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
    gap: 18px;
    margin-bottom: 20px;
    align-items: start;
}

.chart-card .card-head {
    align-items: center;
}

.chart-body {
    padding: 18px 22px 20px;
}

.chart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-height: 196px;
}

.chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    height: 100%;
    justify-content: flex-end;
    gap: 7px;
}

.chart-value {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.chart-col:hover .chart-value {
    opacity: 1;
}

.chart-bar-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 150px;
    border-bottom: 1px solid var(--line-2);
    background: repeating-linear-gradient(to top, transparent 0, transparent 29px, rgba(230, 233, 242, 0.55) 30px);
}

.chart-bar {
    width: 100%;
    max-width: 34px;
    min-height: 3px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, #7fd0f0 0%, #0b7fbf 55%, #0a6da6 100%);
    box-shadow: 0 8px 18px -10px rgba(11, 127, 191, 0.85);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.chart-col:hover .chart-bar {
    filter: brightness(1.07);
    transform: scaleY(1.015);
    transform-origin: bottom;
}

.chart-label {
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.quick-card .card-head {
    align-items: center;
}

.quick-card .badge {
    gap: 4px;
}

.quick-card .badge .icon {
    width: 12px;
    height: 12px;
}

.quick-form {
    padding: 18px 22px 22px;
}

.quick-form .field {
    margin-bottom: 13px;
}

.quick-form .input {
    height: 40px;
    font-size: 13px;
}

.quick-form .btn {
    margin-top: 4px;
}

.tiny-note {
    margin-top: 10px;
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.65;
}

.tiny-note a {
    color: var(--brand-600);
    font-weight: 600;
}

.tiny-note .icon {
    width: 12px;
    height: 12px;
    vertical-align: -2px;
    color: var(--success);
}

.table-card {
    margin-bottom: 20px;
}

.table-card .card-head {
    align-items: center;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

.data-table th {
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-2);
    color: var(--body);
    font-size: 13px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.14s ease;
}

.data-table tbody tr:hover {
    background: #fafbff;
}

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

.data-table .align-right {
    text-align: right;
}

.table-primary {
    display: block;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

a.table-primary:hover {
    color: var(--brand-600);
}

.table-secondary {
    display: block;
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 11.5px;
    line-height: 1.4;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 52px 24px 56px;
    text-align: center;
}

.empty-art {
    position: relative;
    width: 112px;
    height: 92px;
    margin-bottom: 20px;
}

.empty-sheet {
    position: absolute;
    left: 22px;
    top: 10px;
    width: 64px;
    height: 76px;
    border: 1px solid #dfe4f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.25);
    transform: rotate(-7deg);
}

.empty-sheet.sheet-2 {
    left: 44px;
    top: 6px;
    transform: rotate(5deg);
    background: linear-gradient(180deg, #ffffff, #eef2ff);
    border-color: #d8ddfb;
}

.empty-plus {
    position: absolute;
    right: 10px;
    bottom: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 10px 20px -10px rgba(11, 127, 191, 0.9);
    transform: rotate(7deg);
}

.empty-plus .icon {
    width: 17px;
    height: 17px;
}

.empty-state h3 {
    margin-bottom: 5px;
    font-size: 16px;
}

.empty-state p {
    max-width: 380px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Invoices list
   -------------------------------------------------------------------------- */

.list-card {
    overflow: hidden;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-2);
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease;
}

.tab span {
    padding: 1px 6px;
    border-radius: 99px;
    background: #eef1f7;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 650;
}

.tab:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.tab.active {
    background: var(--brand-soft);
    color: var(--brand-700);
}

.tab.active span {
    background: rgba(11, 127, 191, 0.16);
    color: var(--brand-700);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 270px;
    max-width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
    border-color: #7fd0f0;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.search-box > .icon {
    width: 15px;
    height: 15px;
    color: var(--muted-2);
}

.search-box input {
    width: 100%;
    height: 100%;
    padding: 0 7px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 12.5px;
}

.search-box input::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: var(--muted-2);
}

.search-clear:hover {
    background: var(--surface-2);
    color: var(--danger);
}

.search-clear .icon {
    width: 13px;
    height: 13px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border-top: 1px solid var(--line-2);
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--muted-2);
    font-size: 11.5px;
}

.pagination-info strong {
    color: var(--body);
    font-weight: 600;
}

.page-btns {
    display: flex;
    align-items: center;
    gap: 3px;
}

.page-btn {
    display: grid;
    place-items: center;
    min-width: 31px;
    height: 31px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.page-btn:hover:not(.disabled) {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
}

.page-btn.active {
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 6px 14px -8px rgba(11, 127, 191, 0.9);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: default;
}

.page-btn .icon {
    width: 14px;
    height: 14px;
}

.page-ellipsis {
    padding: 0 4px;
    color: var(--muted-2);
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Invoice editor
   -------------------------------------------------------------------------- */

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
    gap: 20px;
    align-items: start;
}

.editor-main,
.editor-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.form-card .card-head {
    align-items: center;
}

.items-editor {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.items-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 112px 112px 30px;
    gap: 9px;
    padding: 9px 12px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--line-2);
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.items-head span:nth-child(2),
.items-head span:nth-child(3),
.items-head span:nth-child(4) {
    text-align: right;
}

.item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 112px 112px 30px;
    gap: 9px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line-2);
    transition: background 0.14s ease;
}

.item-row:last-child {
    border-bottom: 0;
}

.item-row:hover {
    background: #fcfdff;
}

.item-field {
    min-width: 0;
}

.item-row .input {
    height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 8px;
}

.item-row .input[type="number"] {
    text-align: right;
}

.item-amount-input {
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 600;
}

.item-remove {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-2);
    transition: background 0.14s ease, color 0.14s ease;
}

.item-remove:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.item-remove .icon {
    width: 14px;
    height: 14px;
}

.summary-card {
    position: sticky;
    top: 92px;
    overflow: hidden;
}

.summary-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #03202d, #07374f);
    color: #ffffff;
}

.summary-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    background: var(--brand);
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
}

.summary-brand > div {
    min-width: 0;
    flex: 1;
}

.summary-brand strong {
    display: block;
    font-size: 12.5px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-brand span:not(.summary-mark):not(.badge) {
    display: block;
    color: #94a3b8;
    font-size: 10px;
}

.summary-brand .badge {
    font-size: 10px;
    padding: 3px 8px;
}

.summary-client {
    padding: 16px 20px 4px;
}

.summary-client span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.summary-client strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
}

.summary-client small {
    display: block;
    color: var(--muted-2);
    font-size: 11px;
}

.summary-lines {
    padding: 14px 20px 18px;
}

.summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}

.summary-line strong {
    color: var(--body);
    font-size: 12px;
    font-weight: 600;
}

.summary-total {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}

.summary-total span {
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
}

.summary-total strong {
    color: var(--ink);
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.summary-card .btn {
    margin: 0 20px;
    width: calc(100% - 40px);
}

.summary-card .tiny-note {
    margin: 10px 20px 16px;
}

.side-note {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(180deg, #fbfcff, #f5f7ff);
}

.side-note-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand-600);
}

.side-note-icon .icon {
    width: 15px;
    height: 15px;
}

.side-note p {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.65;
}

.side-note strong {
    color: var(--ink-2);
    font-weight: 650;
}

/* --------------------------------------------------------------------------
   Invoice detail
   -------------------------------------------------------------------------- */

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.78fr);
    gap: 20px;
    align-items: start;
}

.detail-main,
.detail-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.detail-card .card-head {
    align-items: center;
}

.detail-amount {
    color: var(--ink);
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.detail-columns {
    display: grid;
    grid-template-columns: 1.25fr 1fr 0.9fr;
    gap: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-2);
}

.detail-block {
    min-width: 0;
}

.detail-block p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.detail-label {
    margin-bottom: 6px;
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.detail-name {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.detail-strong {
    color: var(--ink);
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--muted);
    vertical-align: 1px;
}

.status-dot.paid {
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-soft);
}

.status-dot.sent {
    background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.status-dot.overdue {
    background: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-soft);
}

.status-dot.draft {
    background: var(--muted);
    box-shadow: 0 0 0 3px #f1f5f9;
}

.items-table-mini {
    margin-top: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.items-table-head,
.items-table-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px 105px 110px;
    gap: 10px;
    align-items: center;
    padding: 9px 13px;
}

.items-table-head {
    background: #fbfcfe;
    border-bottom: 1px solid var(--line-2);
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.items-table-head span:not(:first-child),
.items-table-row > span:not(.mini-desc) {
    text-align: right;
}

.items-table-row {
    border-bottom: 1px solid var(--line-2);
    color: var(--body);
    font-size: 12px;
}

.items-table-row:last-child {
    border-bottom: 0;
}

.mini-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-amount {
    color: var(--ink);
    font-weight: 650;
}

.detail-totals {
    max-width: 320px;
    margin: 16px 0 0 auto;
}

.detail-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 5px 0;
    color: var(--muted);
    font-size: 12px;
}

.detail-total-row span:last-child {
    color: var(--body);
    font-weight: 550;
}

.detail-total-grand {
    margin-top: 7px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
}

.detail-total-grand span:last-child {
    color: var(--ink);
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.notes-block {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: var(--surface-2);
}

.notes-block p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.notes-block .detail-label {
    margin-bottom: 4px;
}

.activity-card .card-head {
    align-items: center;
}

.timeline {
    padding: 2px 0;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 13px;
    padding-bottom: 18px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 13px;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: relative;
    z-index: 1;
    width: 9px;
    height: 9px;
    flex: none;
    margin-top: 4px;
    border: 2px solid var(--brand);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.timeline-dot-success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px var(--success-soft);
}

.timeline-dot-warning {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px var(--warning-soft);
}

.timeline-item strong {
    display: block;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
}

.timeline-item p {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 11.5px;
}

.preview-card {
    overflow: hidden;
}

.preview-card .card-head {
    align-items: center;
}

.preview-frame {
    height: 640px;
    background: #eef2f8;
    overflow: hidden;
}

.preview-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.link-card .card-head {
    align-items: center;
}

.copy-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.copy-row .input {
    height: 40px;
    font-size: 11.5px;
    color: var(--muted);
}

.copy-row .btn {
    height: 40px;
    flex: none;
}

.link-card .tiny-note {
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-nav {
    position: sticky;
    top: 84px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -6px 0 20px;
    padding: 9px 0;
    background: rgba(244, 246, 251, 0.9);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    scrollbar-width: none;
}

.settings-nav::-webkit-scrollbar {
    display: none;
}

.settings-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.settings-nav-link .icon {
    width: 14px;
    height: 14px;
}

.settings-nav-link:hover {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-card {
    scroll-margin-top: 140px;
    overflow: hidden;
}

.settings-card .card-head {
    align-items: center;
}

.settings-card .card-body {
    padding: 22px;
}

.logo-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.logo-preview {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    color: var(--brand-600);
    font-size: 18px;
    font-weight: 750;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.logo-fields {
    flex: 1;
    min-width: 0;
}

.upload-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px dashed #cfd6e5;
    border-radius: 11px;
    background: #fbfcff;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-box:hover {
    border-color: #7fd0f0;
    background: var(--brand-soft);
}

.upload-box .icon {
    width: 18px;
    height: 18px;
    color: var(--brand-600);
}

.upload-box strong {
    display: block;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
}

.upload-box small {
    display: block;
    color: var(--muted-2);
    font-size: 10.5px;
}

.upload-box-sm {
    padding: 10px 14px;
}

.info-strip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 11px;
    background: #f5faff;
    color: #1e40af;
}

.info-strip .icon {
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.info-strip p {
    font-size: 11.5px;
    line-height: 1.65;
}

.info-strip strong {
    font-weight: 650;
}

.placeholder-hint {
    color: var(--muted-2);
    font-size: 10.5px;
}

.placeholder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.placeholder-chip {
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--brand-700);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    transition: background 0.14s ease, border-color 0.14s ease;
}

.placeholder-chip:hover {
    background: var(--brand-soft);
    border-color: #c7d2fe;
}

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

.system-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: var(--surface-2);
    font-size: 11.5px;
}

.system-item span {
    color: var(--muted);
}

.system-item strong {
    color: var(--ink-2);
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.error-card {
    max-width: 520px;
    margin: 30px auto;
    padding: 40px 32px;
    text-align: center;
}

.error-code {
    margin-bottom: 12px;
    color: var(--brand);
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
}

.error-card h2 {
    margin-bottom: 6px;
    font-size: 19px;
}

.error-card p {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 130;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 44px -20px rgba(15, 23, 42, 0.35);
    font-size: 12.5px;
    line-height: 1.55;
    pointer-events: auto;
    animation: toastIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.toast.leaving {
    animation: toastOut 0.2s ease both;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 8px;
}

.toast-icon .icon {
    width: 15px;
    height: 15px;
}

.toast-success .toast-icon {
    background: var(--success-soft);
    color: var(--success);
}

.toast-error .toast-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.toast-warning .toast-icon {
    background: var(--warning-soft);
    color: var(--warning);
}

.toast-info .toast-icon {
    background: var(--info-soft);
    color: var(--info);
}

.toast-body {
    flex: 1;
    padding-top: 4px;
    color: var(--ink-2);
    overflow-wrap: anywhere;
}

.toast-close {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    margin-top: 1px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-2);
}

.toast-close:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.toast-close .icon {
    width: 13px;
    height: 13px;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 14, 26, 0.55);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 26px 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 40px 90px -30px rgba(8, 14, 26, 0.65);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-backdrop.open .modal-card {
    transform: none;
}

.modal-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 15px;
    background: var(--danger-soft);
    color: var(--danger);
}

.modal-icon .icon {
    width: 23px;
    height: 23px;
}

.modal-icon.brand {
    background: var(--brand-soft);
    color: var(--brand-600);
}

.modal-icon.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.modal-card h3 {
    margin-bottom: 6px;
    font-size: 17px;
}

.modal-card p {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.65;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.modal-actions .btn {
    min-width: 110px;
}

/* --------------------------------------------------------------------------
   Auth / login
   -------------------------------------------------------------------------- */

.auth-body {
    background: #03202d;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 100vh;
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 38px 46px 28px;
    overflow: hidden;
    background:
        radial-gradient(700px 500px at 10% -10%, rgba(11, 127, 191, 0.35), transparent 60%),
        radial-gradient(600px 500px at 100% 110%, rgba(168, 85, 247, 0.22), transparent 60%),
        linear-gradient(145deg, #03202d 0%, #063a52 55%, #084a68 100%);
    color: #ffffff;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 75%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 75%);
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
}

.auth-blob-1 {
    width: 420px;
    height: 420px;
    top: -150px;
    right: -120px;
    background: radial-gradient(circle, rgba(11, 127, 191, 0.55), transparent 65%);
}

.auth-blob-2 {
    width: 520px;
    height: 520px;
    bottom: -220px;
    left: -160px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3), transparent 65%);
}

.brand-light {
    position: relative;
    z-index: 2;
    padding-bottom: 0;
}

.brand-light .brand-text {
    color: #ffffff;
}

.brand-light .brand-text small {
    color: #94a3b8;
}

.auth-copy {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.pill-light {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #c7d2fe;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.pill-light .icon {
    width: 13px;
    height: 13px;
}

.auth-copy h1 {
    margin: 16px 0 14px;
    color: #ffffff;
    font-size: clamp(30px, 3.6vw, 44px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

.auth-copy h1 span {
    background: linear-gradient(90deg, #7fd0f0, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-copy > p {
    max-width: 420px;
    color: #94a3b8;
    font-size: 13.5px;
    line-height: 1.7;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #cbd5e1;
    font-size: 12.5px;
}

.feature-check {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.feature-check .icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.4;
}

.auth-invoice-card {
    position: relative;
    z-index: 2;
    width: min(360px, 100%);
    margin-top: 6px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
    color: var(--ink);
    transform: rotate(-1.5deg);
}

.aic-head {
    display: flex;
    align-items: center;
    gap: 9px;
}

.aic-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--brand);
    color: #ffffff;
    font-size: 11px;
    font-weight: 750;
}

.aic-head > div {
    min-width: 0;
    flex: 1;
}

.aic-head strong {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
}

.aic-head span {
    display: block;
    color: var(--muted-2);
    font-size: 9.5px;
}

.aic-status {
    padding: 3px 7px;
    border-radius: 99px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 8.5px;
    font-weight: 700;
}

.aic-lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 16px 0;
}

.aic-lines span {
    display: block;
    height: 7px;
    border-radius: 99px;
    background: #eef1f7;
}

.aic-lines span:nth-child(1) {
    width: 84%;
}

.aic-lines span:nth-child(2) {
    width: 62%;
}

.aic-lines span:nth-child(3) {
    width: 72%;
}

.aic-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--line-2);
}

.aic-total span {
    color: var(--muted);
    font-size: 10px;
}

.aic-total strong {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.auth-footer {
    position: relative;
    z-index: 2;
    color: #64748b;
    font-size: 10.5px;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 410px;
    animation: cardIn 0.4s ease both;
}

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

.brand-mobile {
    display: none;
    padding: 0 0 24px;
}

.brand-mobile .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
}

.brand-mobile .brand-text {
    color: var(--ink);
    font-size: 14px;
}

.auth-title {
    margin-bottom: 6px;
    font-size: clamp(24px, 2.4vw, 30px);
    letter-spacing: -0.04em;
}

.auth-sub {
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form .btn {
    margin-top: 4px;
    height: 46px;
}

.auth-help {
    margin-top: 20px;
    color: var(--muted-2);
    font-size: 11.5px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Setup
   -------------------------------------------------------------------------- */

.setup-body {
    background: var(--bg);
}

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

.setup-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    padding: 34px 32px 24px;
    overflow: hidden;
    background:
        radial-gradient(600px 420px at 0% -10%, rgba(11, 127, 191, 0.38), transparent 60%),
        radial-gradient(500px 420px at 110% 110%, rgba(168, 85, 247, 0.25), transparent 60%),
        linear-gradient(160deg, #03202d 0%, #063a52 55%, #084a68 100%);
    color: #ffffff;
}

.setup-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 78%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 78%);
}

.setup-visual .brand {
    position: relative;
    z-index: 2;
    padding: 0;
}

.setup-copy {
    position: relative;
    z-index: 2;
}

.setup-copy h1 {
    margin: 14px 0 12px;
    color: #ffffff;
    font-size: clamp(27px, 3vw, 36px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.15;
}

.setup-copy h1 span {
    background: linear-gradient(90deg, #7fd0f0, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.setup-copy > p {
    max-width: 330px;
    color: #94a3b8;
    font-size: 12.5px;
    line-height: 1.7;
}

.setup-points {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.setup-point {
    display: flex;
    gap: 11px;
    align-items: flex-start;
}

.setup-point > span {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #c7d2fe;
    font-size: 9.5px;
    font-weight: 700;
}

.setup-point strong {
    display: block;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}

.setup-point p {
    margin-top: 1px;
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.55;
}

.setup-main {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 34px 24px 60px;
    background: var(--bg);
}

.setup-card {
    width: 100%;
    max-width: 800px;
    padding: 30px 32px 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: cardIn 0.4s ease both;
}

.setup-head h2 {
    font-size: 25px;
    letter-spacing: -0.035em;
}

.setup-head .auth-sub {
    margin-bottom: 0;
}

.setup-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 12px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.step-num {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #eef1f7;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.step-item.active {
    color: var(--ink);
}

.step-item.active .step-num {
    background: var(--brand);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--brand-ring);
}

.step-item.done .step-num {
    background: var(--success);
    color: #ffffff;
}

.step-line {
    flex: 1;
    height: 1px;
    min-width: 12px;
    background: var(--line);
}

.setup-progress {
    height: 4px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 99px;
    background: #eef1f7;
}

.setup-progress span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #0b7fbf, #2aa9dd);
    transition: width 0.28s ease;
}

.setup-step {
    display: none;
}

.setup-step.active {
    display: block;
    animation: stepIn 0.26s ease both;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.step-title {
    margin-bottom: 3px;
    font-size: 15px;
}

.step-sub {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 11.5px;
}

.env-card {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-2);
}

.env-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.env-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 650;
}

.env-title .icon {
    width: 14px;
    height: 14px;
    color: var(--brand-600);
}

.env-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 11px;
}

.env-icon {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    flex: none;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 750;
}

.env-row.is-ok .env-icon {
    background: var(--success-soft);
    color: var(--success);
}

.env-row.is-bad .env-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.env-label {
    color: var(--body);
    font-weight: 550;
}

.env-detail {
    margin-left: auto;
    color: var(--muted-2);
    text-align: right;
    font-size: 10px;
}

.setup-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line-2);
}

.setup-nav [data-step-back] {
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   Public invoice page
   -------------------------------------------------------------------------- */

.public-body {
    background:
        radial-gradient(800px 400px at 100% -10%, rgba(11, 127, 191, 0.09), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(56, 189, 248, 0.07), transparent 60%),
        #eef2f8;
}

.public-page {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 26px 20px 56px;
}

.public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

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

.public-brand .brand-mark {
    width: 38px;
    height: 38px;
}

.public-brand-text strong {
    display: block;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.public-brand-text small {
    display: block;
    color: var(--muted-2);
    font-size: 10.5px;
}

.public-invoice {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 40px 100px -40px rgba(15, 23, 42, 0.4);
}

.public-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 34px 38px 32px;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(500px 260px at 100% 0%, rgba(11, 127, 191, 0.4), transparent 65%),
        radial-gradient(400px 260px at 0% 100%, rgba(56, 189, 248, 0.2), transparent 65%),
        linear-gradient(135deg, #03202d, #063a52 60%, #084a68);
}

.public-hero::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    right: -100px;
    top: -160px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(255, 255, 255, 0.025), 0 0 0 90px rgba(255, 255, 255, 0.02);
}

.public-hero-main {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.public-kicker {
    margin-bottom: 4px;
    color: #7fd0f0;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.public-hero h1 {
    margin-bottom: 4px;
    color: #ffffff;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.public-amount {
    margin-top: 2px;
    color: #ffffff;
    font-size: clamp(30px, 4.5vw, 46px);
    font-weight: 750;
    letter-spacing: -0.05em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.public-due {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 12.5px;
}

.public-overdue {
    color: #fca5a5;
    font-weight: 600;
}

.public-hero-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 170px;
    padding-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.public-hero-meta div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 11px;
}

.public-hero-meta span {
    color: #94a3b8;
}

.public-hero-meta strong {
    color: #e2e8f0;
    font-weight: 600;
}

.public-body-section {
    padding: 0;
}

.public-invoice > .public-invoice-body {
    padding: 30px 38px 26px;
}

.public-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line-2);
}

.public-party {
    min-width: 0;
}

.public-label {
    margin-bottom: 5px;
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.public-party strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.public-party p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.public-link {
    color: var(--brand-600);
    font-weight: 550;
}

.public-items {
    padding: 18px 0 6px;
}

.public-items-head,
.public-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px 120px 130px;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
}

.public-items-head {
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.public-items-head span:not(:first-child),
.public-item-row > span:not(.public-item-desc) {
    text-align: right;
}

.public-item-row {
    border-top: 1px solid var(--line-2);
    color: var(--body);
    font-size: 12.5px;
}

.public-item-desc {
    min-width: 0;
}

.public-item-rate {
    color: var(--muted);
}

.public-item-amount {
    color: var(--ink);
    font-weight: 650;
}

.public-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
    gap: 30px;
    align-items: start;
    padding-top: 10px;
}

.public-notes p {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.public-notes .public-label {
    margin-top: 4px;
}

.public-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 5px 0;
    color: var(--muted);
    font-size: 12px;
}

.public-totals > div > span:last-child {
    color: var(--body);
    font-weight: 550;
}

.public-total {
    margin-top: 8px;
    padding-top: 12px !important;
    border-top: 1px solid var(--line);
    color: var(--ink) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
}

.public-total > span:last-child {
    color: var(--ink) !important;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.03em;
}

.public-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding: 0 38px 26px;
}

.public-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 38px;
    border-top: 1px solid var(--line-2);
    background: var(--surface-2);
    color: var(--muted-2);
    font-size: 10.5px;
    flex-wrap: wrap;
}

.public-footer strong {
    color: var(--muted);
    font-weight: 600;
}

.public-footer div span {
    margin-left: 8px;
}

.public-footer p {
    color: var(--muted-2);
}

.public-secure {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
    font-weight: 600;
}

.public-secure .icon {
    width: 13px;
    height: 13px;
}

.public-powered {
    margin-top: 16px;
    color: var(--muted-2);
    font-size: 10.5px;
    text-align: center;
}

.public-powered a {
    color: var(--brand-600);
    font-weight: 600;
}

.public-page .error-card {
    margin-top: 40px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1280px) {
    .app-shell {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .topbar {
        padding: 0 24px;
    }

    .content {
        padding: 24px 24px 64px;
    }

    .editor-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.75fr);
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
    }
}

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

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

    .quick-card {
        order: 2;
    }

    .editor-grid,
    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .summary-card {
        position: static;
    }

    .editor-side {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        align-items: start;
    }

    .detail-side {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
        align-items: start;
    }

    .preview-frame {
        height: 560px;
    }

    .setup-shell {
        grid-template-columns: 340px minmax(0, 1fr);
    }

    .setup-visual {
        padding: 30px 26px 22px;
    }
}

@media (max-width: 1024px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-102%);
        transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(8, 14, 26, 0.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }

    .sidebar-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

    .menu-toggle {
        display: inline-grid;
    }

    .content {
        padding-top: 22px;
    }

    .setup-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .setup-visual {
        display: none;
    }

    .setup-main {
        padding: 26px 18px 50px;
    }

    .setup-card {
        max-width: 760px;
    }
}

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

    .auth-visual {
        display: none;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 28px 20px;
    }

    .brand-mobile {
        display: flex;
    }
}

@media (max-width: 760px) {
    .topbar {
        height: 64px;
        padding: 0 16px;
        gap: 10px;
    }

    .topbar-search {
        display: none;
    }

    .content {
        padding: 18px 16px 56px;
    }

    .page-head {
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .page-actions .inline-form {
        flex: 1;
    }

    .page-actions .inline-form .btn {
        width: 100%;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .stat-value {
        margin-top: 12px;
        font-size: 20px;
    }

    .chart {
        gap: 4px;
    }

    .chart-label {
        font-size: 9px;
    }

    .chart-value {
        display: none;
    }

    .card-head {
        padding: 16px;
        flex-wrap: wrap;
    }

    .card-body {
        padding: 16px;
    }

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

    .list-toolbar {
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px 14px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--line-2);
    }

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

    .data-table td {
        padding: 0;
        border: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        min-width: 0;
    }

    .data-table td .table-secondary {
        overflow-wrap: anywhere;
    }

    .data-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 1px;
        color: var(--muted-2);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .data-table td.table-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        margin-top: 2px;
        padding-top: 9px;
        border-top: 1px solid var(--line-2);
    }

    .data-table td.table-actions::before {
        display: none;
    }

    .items-head {
        display: none;
    }

    .item-row {
        position: relative;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        padding: 14px 12px 12px;
        gap: 10px;
    }

    .item-desc {
        grid-column: 1 / -1;
        padding-right: 34px;
    }

    .item-field::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--muted-2);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .item-row .input {
        height: 40px;
    }

    .item-remove {
        position: absolute;
        right: 10px;
        top: 10px;
    }

    .editor-side,
    .detail-side {
        display: flex;
    }

    .preview-frame {
        height: 480px;
    }

    .detail-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .detail-totals {
        max-width: none;
    }

    .items-table-head {
        display: none;
    }

    .items-table-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        column-gap: 12px;
        row-gap: 2px;
        padding: 11px 12px;
        font-size: 12px;
    }

    .items-table-row .mini-desc {
        grid-column: 1;
        grid-row: 1;
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
    }

    .items-table-row .mini-amount {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
    }

    .items-table-row .mini-qty,
    .items-table-row .mini-rate {
        grid-row: 2;
        color: var(--muted);
        font-size: 10.5px;
        text-align: left;
    }

    .items-table-row .mini-qty {
        grid-column: 1;
    }

    .items-table-row .mini-rate {
        grid-column: 2;
        text-align: right;
    }

    .items-table-row .mini-qty::before {
        content: 'Qty ';
        color: var(--muted-2);
    }

    .items-table-row .mini-rate::before {
        content: 'Rate ';
        color: var(--muted-2);
    }

    .settings-card .card-body {
        padding: 16px;
    }

    .settings-nav {
        top: 76px;
        margin-top: -4px;
    }

    .logo-row {
        flex-direction: column;
    }

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

    .setup-card {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .setup-head h2 {
        font-size: 21px;
    }

    .setup-steps {
        gap: 4px;
    }

    .step-name {
        display: none;
    }

    .step-line {
        min-width: 8px;
    }

    .env-detail {
        display: none;
    }

    .env-row {
        justify-content: space-between;
    }

    .public-page {
        padding: 14px 10px 40px;
    }

    .public-invoice {
        border-radius: 18px;
    }

    .public-hero {
        padding: 24px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .public-hero-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 18px;
        width: 100%;
        padding-left: 0;
        padding-top: 14px;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .public-hero-meta div {
        gap: 6px;
        font-size: 10px;
    }

    .public-invoice > .public-invoice-body {
        padding: 22px 20px 18px;
    }

    .public-parties {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .public-items-head {
        display: none;
    }

    .public-item-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 3px 12px;
        padding: 10px 0;
    }

    .public-item-desc {
        grid-column: 1 / -1;
        font-weight: 550;
    }

    .public-item-qty,
    .public-item-rate,
    .public-item-amount {
        text-align: left !important;
        font-size: 11px;
    }

    .public-item-amount {
        grid-column: 2;
        grid-row: 2;
        text-align: right !important;
    }

    .public-item-qty::before {
        content: "Qty ";
        color: var(--muted-2);
    }

    .public-item-rate::before {
        content: "Rate ";
        color: var(--muted-2);
    }

    .public-bottom {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .public-totals {
        padding-top: 12px;
        border-top: 1px solid var(--line-2);
    }

    .public-actions {
        padding: 0 20px 20px;
    }

    .public-actions .btn {
        flex: 1;
        min-width: 130px;
    }

    .public-footer {
        padding: 14px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .public-topbar {
        padding: 0 2px;
    }

    .toast-stack {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-actions .btn {
        flex: 1 1 100%;
    }

    .topbar-actions .btn-compact span {
        display: none;
    }

    .topbar-actions .btn-compact {
        width: 38px;
        padding: 0;
    }

    .summary-card .btn {
        width: calc(100% - 32px);
        margin: 0 16px;
    }

    .summary-card .tiny-note {
        margin-left: 16px;
        margin-right: 16px;
    }

    .pagination {
        justify-content: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
    }

    .copy-row {
        flex-direction: column;
    }

    .copy-row .btn {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .setup-nav {
        flex-wrap: wrap;
    }

    .setup-nav .btn {
        flex: 1;
    }

    .setup-nav [data-step-back] {
        margin-right: 0;
        flex: 0 0 auto;
    }

    .public-amount {
        font-size: 30px;
    }

    .public-hero h1 {
        font-size: 28px;
    }

    .auth-card {
        max-width: 100%;
    }

    .auth-panel {
        padding: 22px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ----------------------------------------------------------------------- */
/* Simple send form (email + amount)                                        */
/* ----------------------------------------------------------------------- */

.send-card {
    padding: 20px 22px 22px;
    margin-bottom: 18px;
}

.send-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.send-field {
    margin: 0;
}

.send-field .input {
    height: 44px;
}

.send-btn {
    height: 44px;
    padding: 0 22px;
    white-space: nowrap;
}

.send-form .field-error {
    margin-top: 6px;
}

@media (max-width: 900px) {
    .send-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .send-btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .send-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .send-card {
        padding: 16px;
    }
}


/* Email delivery help */
.email-help {
    margin-top: 18px;
    flex-direction: column;
    gap: 6px;
}

.email-help strong {
    font-size: 13.5px;
}

.email-help p {
    margin: 0;
}

.email-help ol {
    margin: 4px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
}

.hint-warn {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(217, 119, 6, 0.28);
    background: rgba(217, 119, 6, 0.08);
    color: #8a4b0f;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.hint-warn code {
    color: inherit;
    background: rgba(217, 119, 6, 0.14);
}

@media (prefers-color-scheme: dark) {
    .hint-warn {
        border-color: rgba(245, 158, 11, 0.35);
        background: rgba(245, 158, 11, 0.1);
        color: #fbbf24;
    }
}

/* ==========================================================================
   Sign in — minimal, Apple-inspired
   ========================================================================== */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    background:
        radial-gradient(900px 520px at 50% -12%, #dceef9 0%, rgba(220, 238, 249, 0) 68%),
        linear-gradient(180deg, #f8fbfd 0%, #eef5f9 100%);
}

.login-card {
    width: 100%;
    max-width: 384px;
    padding: 40px 34px 26px;
    text-align: center;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow:
        0 1px 2px rgba(3, 32, 45, 0.04),
        0 32px 70px -42px rgba(3, 32, 45, 0.38);
    animation: login-in 480ms cubic-bezier(0.22, 0.8, 0.28, 1);
}

@keyframes login-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-bottom: 30px;
}

.login-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(140deg, #0b7fbf, #063a52);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px -10px rgba(11, 127, 191, 0.85);
}

.login-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-brand-name {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.login-title {
    margin: 0 0 6px;
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -0.022em;
    color: var(--ink);
}

.login-sub {
    margin: 0 0 26px;
    font-size: 13.5px;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 12px;
    text-align: left;
}

.login-field {
    display: grid;
    gap: 6px;
}

.login-input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #f6f9fb;
    border: 1px solid #e3edf3;
    border-radius: 13px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-input::placeholder {
    color: #94a9b6;
}

.login-input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(11, 127, 191, 0.14);
}

.login-submit {
    height: 50px;
    margin-top: 6px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(180deg, #1291d4 0%, #0b7fbf 100%);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 10px 22px -12px rgba(11, 127, 191, 0.9);
    transition: transform 140ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-submit:hover {
    filter: brightness(1.04);
    box-shadow: 0 14px 26px -12px rgba(11, 127, 191, 0.95);
}

.login-submit:active {
    transform: scale(0.988);
}

.login-foot {
    margin: 26px 0 0;
    font-size: 11.5px;
    color: var(--muted-2);
}

@media (max-width: 420px) {
    .login-card {
        padding: 32px 22px 22px;
        border-radius: 20px;
    }
}

/* ==========================================================================
   Settings — simplified (branding + currency + advanced email)
   ========================================================================== */
.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.advanced-panel {
    margin: 18px 0 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
}

.advanced-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 160ms ease;
}

.advanced-panel > summary::-webkit-details-marker {
    display: none;
}

.advanced-panel > summary:hover {
    background: rgba(11, 127, 191, 0.05);
}

.advanced-summary-text {
    display: grid;
    gap: 1px;
}

.advanced-summary-text strong {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.advanced-summary-text small {
    font-size: 11.5px;
    color: var(--muted);
}

.advanced-chevron {
    width: 16px;
    height: 16px;
    color: var(--muted-2);
    transition: transform 180ms ease;
}

.advanced-panel[open] .advanced-chevron {
    transform: rotate(180deg);
}

.advanced-body {
    display: grid;
    gap: 14px;
    padding: 2px 16px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

@media (max-width: 720px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Setup — single centred card (matches the sign-in screen)
   ========================================================================== */
.setup-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 30px 18px;
    background:
        radial-gradient(900px 520px at 50% -12%, #dceef9 0%, rgba(220, 238, 249, 0) 68%),
        linear-gradient(180deg, #f8fbfd 0%, #eef5f9 100%);
}

.setup-card {
    width: 100%;
    max-width: 560px;
    padding: 34px 34px 28px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow:
        0 1px 2px rgba(3, 32, 45, 0.04),
        0 32px 70px -42px rgba(3, 32, 45, 0.38);
    animation: login-in 480ms cubic-bezier(0.22, 0.8, 0.28, 1);
}

.setup-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.setup-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(140deg, #0b7fbf, #063a52);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 16px -10px rgba(11, 127, 191, 0.85);
}

.setup-brand-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.setup-head h1 {
    margin: 0 0 6px;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.setup-head p {
    margin: 0 0 22px;
    font-size: 13.5px;
    color: var(--muted);
}

.setup-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

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

.step-num {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    background: #eef3f7;
    border: 1px solid var(--line);
    transition: all 180ms ease;
}

.step-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}

.step-item.active .step-num {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 6px 14px -8px rgba(11, 127, 191, 0.9);
}

.step-item.active .step-name {
    color: var(--ink);
    font-weight: 600;
}

.step-item.done .step-num {
    color: var(--brand-600);
    background: var(--brand-soft);
    border-color: transparent;
}

.step-line {
    flex: 1;
    height: 1px;
    background: var(--line);
}

.setup-progress {
    height: 3px;
    margin-bottom: 22px;
    border-radius: 99px;
    background: #eaf1f6;
    overflow: hidden;
}

.setup-progress > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #0b7fbf, #38bdf8);
    transition: width 260ms ease;
}

.setup-step .step-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.setup-step .step-sub {
    margin: 0 0 18px;
    font-size: 12.5px;
    color: var(--muted);
}

.setup-req-list {
    margin: 8px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
    font-size: 12.5px;
}

.setup-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 560px) {
    .setup-card {
        padding: 26px 20px 22px;
        border-radius: 20px;
    }
}
