:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --line: #e2e8f0;
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-soft: #eff6ff;
    --blue-line: #bfdbfe;
    --orange: #f97316;
    --orange-hover: #ea580c;
    --orange-soft: #fff7ed;
    --orange-line: #fdba74;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --success-line: #bbf7d0;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --danger-line: #fecaca;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    background:
        linear-gradient(180deg, rgba(239, 246, 255, 0.85), rgba(246, 248, 251, 0) 280px),
        var(--bg);
    color: var(--text);
}

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

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input {
    min-height: 42px;
}

select {
    min-height: 42px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 0 clamp(18px, 3vw, 34px);
    background:
        linear-gradient(90deg, rgba(255, 247, 237, 0.72), rgba(239, 246, 255, 0.82)),
        rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.brand-logo {
    display: block;
    width: 176px;
    max-height: 42px;
    object-fit: contain;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.brand-accent {
    color: var(--orange);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.nav-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 999px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 0 11px;
    color: #475569;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav a:hover {
    background: var(--blue-soft);
    color: var(--blue-hover);
}

.nav a.is-active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.nav a.nav-logout {
    color: var(--danger);
}

.nav a.nav-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.menu-toggle span + span {
    margin-top: 0;
}

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

.shell {
    width: min(90vw, 1920px);
    margin: 22px auto;
}

@media (max-width: 1240px) and (min-width: 761px) {
    .topbar {
        gap: 12px;
        padding-left: 18px;
        padding-right: 18px;
    }

    .brand-logo {
        width: 148px;
    }

    .nav {
        gap: 7px;
        font-size: 12px;
    }

    .nav a {
        padding: 0 8px;
    }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.page-title {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.2;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.page-actions form {
    margin: 0;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
    background: var(--blue-hover);
}

.button:active {
    transform: translateY(1px);
}

.button.accent {
    background: var(--orange);
}

.button.accent:hover {
    background: var(--orange-hover);
}

.button.secondary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.button.secondary:hover {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.button.danger-button {
    border: 1px solid var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

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

.button.danger-button:disabled {
    border-color: var(--line);
    background: #f8fafc;
    color: var(--muted);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.notice,
.alert {
    margin: 14px 0;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
}

.notice.success {
    border: 1px solid var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.notice.error,
.alert-error {
    border: 1px solid var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.toolbar input,
.toolbar select {
    width: auto;
    min-width: 180px;
    flex: 1 1 240px;
    font-size: 14px;
}

.toolbar .button {
    white-space: nowrap;
}

.toolbar input[type="month"] {
    flex: 0 0 155px;
    max-width: 155px;
}

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

.list-meta {
    margin: -4px 0 12px;
    color: var(--muted);
    font-size: 14px;
}

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

.table-link {
    color: var(--blue-hover);
    font-weight: 800;
}

.table-link:hover {
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 12px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

td small {
    display: block;
    max-width: 520px;
    margin-top: 4px;
    color: var(--muted);
}

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

tr.row-expired td {
    background: #fff1f2;
}

tr.row-due-10 td {
    background: #fff7ed;
}

tr.row-due-30 td {
    background: #fffbeb;
}

tr.row-due-45 td {
    background: #eff6ff;
}

.actions {
    width: 96px;
    white-space: nowrap;
}

td.actions {
    white-space: nowrap;
}

td.actions > a,
td.actions > form {
    display: inline-flex;
    margin-right: 8px;
    vertical-align: middle;
}

td.actions > *:last-child {
    margin-right: 0;
}

td.actions form {
    margin: 0;
}

.bulk-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}

.bulk-actions .button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.select-col {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
}

.select-col .row-check {
    display: inline-block;
    width: 14px;
    height: 14px;
    min-height: 14px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}

.customers-table td.actions,
.plans-table td.actions {
    white-space: nowrap;
}

.customers-table td.actions > a,
.customers-table td.actions > form,
.plans-table td.actions > a,
.plans-table td.actions > form {
    display: inline-flex;
    vertical-align: middle;
}

.link {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--blue-hover);
    cursor: pointer;
    font-weight: 700;
}

.link.danger {
    color: var(--danger);
}

.icon-action {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue-hover);
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.icon-action span,
.icon-action b {
    display: block;
    line-height: 1;
}

.icon-action:hover {
    border-color: var(--blue);
    background: #dbeafe;
}

.icon-action.danger {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.icon-action.danger:hover {
    border-color: var(--danger);
}

.icon-action.accent-icon {
    border-color: var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.icon-action.accent-icon:hover {
    border-color: var(--orange);
}

.icon-action.success-icon {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.icon-action.success-icon:hover {
    border-color: var(--success);
}

.icon-action.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.icon-action.is-disabled:hover {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.icon-action.accent-icon.is-disabled:hover {
    border-color: var(--orange-line);
    background: var(--orange-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 800;
}

.badge.info {
    border: 1px solid var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue-hover);
}

.badge.warning {
    border: 1px solid var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

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

.badge.success {
    border: 1px solid var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.badge.muted-badge {
    border: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
}

.empty {
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.stacked-action {
    grid-template-columns: 1fr auto;
    gap: 3px;
    width: 52px;
}

.stacked-action b {
    display: inline-grid;
    place-items: center;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #fff;
    font-size: 10px;
    line-height: 1;
}

.hosting-table-wrap {
    overflow-x: auto;
}

.customers-table-wrap,
.plans-table-wrap {
    overflow-x: auto;
}

.customers-table,
.plans-table {
    table-layout: fixed;
    font-size: 13px;
}

.customers-table {
    min-width: 850px;
}

.plans-table {
    min-width: 930px;
}

.customers-table th,
.customers-table td,
.plans-table th,
.plans-table td {
    padding: 10px;
}

.customers-table th:nth-child(1),
.customers-table td:nth-child(1) {
    width: 30px;
    text-align: center;
}

.customers-table th:nth-child(2),
.customers-table td:nth-child(2) {
    width: 210px;
}

.customers-table th:nth-child(3),
.customers-table td:nth-child(3) {
    width: 260px;
}

.customers-table th:nth-child(4),
.customers-table td:nth-child(4) {
    width: 150px;
}

.customers-table th:nth-child(5),
.customers-table td:nth-child(5) {
    width: 90px;
    text-align: center;
}

.customers-table th:nth-child(6),
.customers-table td:nth-child(6) {
    width: 110px;
    overflow: visible;
}

.plans-table th:nth-child(1),
.plans-table td:nth-child(1) {
    width: 30px;
    text-align: center;
}

.plans-table th:nth-child(2),
.plans-table td:nth-child(2) {
    width: 230px;
}

.plans-table th:nth-child(3),
.plans-table td:nth-child(3) {
    width: 130px;
}

.plans-table th:nth-child(4),
.plans-table td:nth-child(4),
.plans-table th:nth-child(5),
.plans-table td:nth-child(5) {
    width: 120px;
    white-space: nowrap;
}

.plans-table th:nth-child(6),
.plans-table td:nth-child(6),
.plans-table th:nth-child(7),
.plans-table td:nth-child(7) {
    width: 100px;
    text-align: center;
}

.plans-table th:nth-child(8),
.plans-table td:nth-child(8) {
    width: 100px;
    overflow: visible;
}

.customers-table .badge,
.plans-table .badge {
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
}

.customers-table td small,
.plans-table td small {
    font-size: 11px;
}

.public-project-thumb {
    width: 96px;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    object-fit: contain;
}

.hosting-table {
    min-width: 1570px;
    table-layout: fixed;
    font-size: 13px;
}

.hosting-table th,
.hosting-table td {
    padding: 10px;
}

.hosting-table thead tr:first-child th {
    border-bottom: 1px solid var(--line);
}

.hosting-table .action-group-head {
    background: #f8fafc;
    color: var(--muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hosting-table th:nth-child(1),
.hosting-table td:nth-child(1) {
    text-align: center;
}

.hosting-table td:nth-child(2) {
    white-space: nowrap;
}

.hosting-table th:nth-child(3),
.hosting-table td:nth-child(3) {
    text-align: center;
}

.hosting-table th:nth-child(8),
.hosting-table td:nth-child(8) {
    text-align: center;
}

.hosting-table td:nth-child(10) {
    text-align: center;
    overflow: visible;
}

.hosting-table td:nth-child(11) {
    text-align: center;
    overflow: visible;
}

.hosting-table td:nth-child(12) {
    text-align: center;
    overflow: visible;
}

.hosting-table td:nth-child(13) {
    text-align: center;
    overflow: visible;
}

.hosting-table td:nth-child(14) {
    text-align: center;
    overflow: visible;
}

.hosting-table td:nth-child(15) {
    text-align: center;
    overflow: visible;
}

.hosting-table .col-select {
    width: 30px;
}

.hosting-table .col-expires {
    width: 116px;
}

.hosting-table .col-days {
    width: 58px;
}

.hosting-table .col-domain,
.hosting-table .col-customer {
    width: 190px;
}

.hosting-table .col-phone {
    width: 112px;
}

.hosting-table .col-plan {
    width: 150px;
}

.hosting-table .col-domain-included {
    width: 64px;
}

.hosting-table .col-status {
    width: 112px;
}

.hosting-table .col-action-alert {
    width: 92px;
}

.hosting-table .col-action-small {
    width: 72px;
}

.hosting-table .col-action-email {
    width: 106px;
}

.hosting-table .badge {
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
}

.hosting-table td small {
    font-size: 11px;
}

.hosting-table .action-cell,
.billing-table .billing-actions {
    text-align: center;
    vertical-align: middle;
}

.hosting-table .action-cell > form,
.billing-table .billing-actions form {
    display: inline-grid;
    place-items: center;
    margin: 0;
    vertical-align: middle;
}

.billing-table .action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    white-space: nowrap;
}

.billing-table .action-row > a,
.billing-table .action-row > form {
    flex: 0 0 auto;
}

.hosting-table .hosting-actions {
    padding-left: 14px;
    padding-right: 14px;
}

.hosting-table .hosting-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 56px;
    white-space: nowrap;
}

.hosting-table .hosting-action-row > a,
.hosting-table .hosting-action-row > form {
    flex: 0 0 auto;
}

.hosting-table .action-cell > form {
    min-width: 0;
}

.hosting-table .alert-action {
    width: 64px;
}

.hosting-table .stacked-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.hosting-table .stacked-action b {
    min-width: 14px;
    font-size: 11px;
}

.hosting-table .action-cell small {
    display: block;
    margin-top: 5px;
    color: #1e3a5f;
    white-space: nowrap;
}

.plan-price-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cost-alert {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--orange-line);
    border-radius: 999px;
    background: var(--orange-soft);
    color: var(--orange-hover);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.profit-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 132px;
    color: #166534;
}

.profit-line span {
    color: var(--muted);
    font-weight: 700;
}

.profit-line strong {
    color: #166534;
    font-size: 11px;
}

.profit-line.is-negative strong {
    color: var(--danger);
}

.action-cell {
    text-align: center;
}

.action-cell form {
    display: grid;
    justify-items: center;
    gap: 4px;
    margin: 0;
}

.action-cell small {
    max-width: none;
    margin: 0;
    white-space: nowrap;
}

.form-panel {
    max-width: 820px;
}

.import-review-panel {
    max-width: 1180px;
}

.wide-form {
    max-width: 980px;
}

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

.form-preview {
    display: grid;
    gap: 10px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.form-preview img {
    width: min(100%, 220px);
    height: 150px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    object-fit: contain;
}

.settings-group {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.settings-group h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.settings-group p {
    margin: 0;
}

.passkey-panel {
    margin-top: 18px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.passkey-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
    min-width: 230px;
}

.passkey-actions small,
.passkey-login-status {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.passkey-list {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
}

.passkey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.passkey-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

.passkey-item-main label {
    display: grid;
    gap: 5px;
    margin: 0;
}

.passkey-item-main label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.passkey-item-main input {
    min-height: 38px;
    padding: 8px 10px;
    font-weight: 800;
}

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

.passkey-item-actions .button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
}

.passkey-item strong,
.passkey-item small {
    display: block;
}

.passkey-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

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

.form-grid label span {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 800;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin-top: 24px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.check-row span {
    margin: 0;
}

.income-link-select option.income-option-available {
    background: var(--success-soft);
    color: #166534;
}

.income-link-select option.income-option-full {
    background: var(--danger-soft);
    color: #991b1b;
}

.income-link-select option:disabled {
    color: #991b1b;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.sms-card {
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}

.sms-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sms-card-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.sms-card-head p {
    margin: 0;
}

.sms-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue-hover);
    position: relative;
    flex: 0 0 auto;
}

.sms-icon.accent-icon {
    border-color: var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.sms-icon.phone-icon::before {
    content: "";
    width: 15px;
    height: 24px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.sms-icon.phone-icon::after {
    content: "";
    position: absolute;
    bottom: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.sms-icon.key-icon::before {
    content: "";
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translateX(-5px);
}

.sms-icon.key-icon::after {
    content: "";
    position: absolute;
    width: 17px;
    height: 2px;
    background: currentColor;
    transform: translate(7px, 1px);
    box-shadow: 7px 5px 0 -1px currentColor;
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

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

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.pagination li {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
}

.pagination .active a,
.pagination .active span {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.step {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    background: #fff;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.step.active {
    border-color: var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.step.done {
    border-color: var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue-hover);
}

.import-actions {
    margin-top: 18px;
}

.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.38);
}

.confirm-backdrop[hidden] {
    display: none;
}

.confirm-dialog {
    width: min(100%, 420px);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

.tracking-dialog {
    width: min(100%, 560px);
}

.confirm-dialog h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.confirm-dialog p {
    margin: 0;
    color: var(--muted);
}

.confirm-preview {
    max-height: 180px;
    overflow: auto;
    margin: 14px 0 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
    color: var(--text);
    white-space: pre-wrap;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.45;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

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

.metric {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--orange);
}

.metric strong {
    display: block;
    font-size: 32px;
    margin-bottom: 4px;
}

.metric span {
    color: var(--muted);
    font-size: 14px;
}

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

.dashboard-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}

.dashboard-card-wide {
    grid-column: 1 / -1;
}

.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-card-head h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

.dashboard-card-head p {
    margin: 0;
}

.dashboard-card-head .button {
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
}

.dashboard-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 11px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.privacy-toggle:hover,
.privacy-toggle.is-visible {
    border-color: var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue);
}

.privacy-toggle:active {
    transform: translateY(1px);
}

.privacy-eye {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.privacy-eye::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.privacy-eye::after {
    content: "";
    position: absolute;
    top: -4px;
    left: 7px;
    width: 2px;
    height: 19px;
    border-radius: 99px;
    background: currentColor;
    transform: rotate(43deg);
}

.privacy-toggle.is-visible .privacy-eye::after {
    opacity: 0;
}

[data-private-money].is-private-hidden {
    letter-spacing: .04em;
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    min-width: 820px;
    table-layout: fixed;
    font-size: 13px;
}

.dashboard-table th,
.dashboard-table td {
    padding: 10px;
}

.dashboard-hosting-table th:nth-child(1),
.dashboard-hosting-table td:nth-child(1) {
    width: 112px;
    white-space: nowrap;
}

.dashboard-hosting-table th:nth-child(2),
.dashboard-hosting-table td:nth-child(2) {
    width: 78px;
    text-align: center;
}

.dashboard-hosting-table th:nth-child(3),
.dashboard-hosting-table td:nth-child(3) {
    width: 240px;
}

.dashboard-hosting-table th:nth-child(4),
.dashboard-hosting-table td:nth-child(4) {
    width: 210px;
}

.dashboard-hosting-table th:nth-child(5),
.dashboard-hosting-table td:nth-child(5) {
    width: 190px;
}

.dashboard-table .badge {
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
}

.dashboard-list {
    display: grid;
    gap: 10px;
}

.dashboard-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
    color: var(--text);
    text-decoration: none;
}

.dashboard-list-item:hover {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.dashboard-list-item strong,
.dashboard-list-item small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-list-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.dashboard-list-item b {
    color: var(--orange-hover);
    overflow-wrap: normal;
    white-space: nowrap;
}

.dashboard-list-item em {
    display: grid;
    justify-items: end;
    color: var(--blue-hover);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.agenda-note {
    align-items: flex-start;
}

.agenda-note small {
    max-height: 38px;
    overflow: hidden;
}

.dashboard-finance-mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-finance-mini div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.dashboard-finance-mini span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-finance-mini strong {
    display: block;
    margin-top: 6px;
    font-size: 17px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.dashboard-finance-mini .income {
    border-color: var(--success-line);
    background: var(--success-soft);
}

.dashboard-finance-mini .expense {
    border-color: var(--danger-line);
    background: var(--danger-soft);
}

.dashboard-finance-mini .profit {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.dashboard-finance-mini .profit.is-negative {
    border-color: var(--danger-line);
    background: var(--danger-soft);
}

.dashboard-mini-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-mini-note strong {
    color: var(--text);
}

.dashboard-list-item em .badge {
    margin-bottom: 5px;
}

.dashboard-list-item em b {
    display: block;
    color: var(--orange-hover);
}

.dashboard-empty {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 18px;
}

.finance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 18px;
}

.finance-summary-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.finance-summary span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.finance-summary strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
}

.finance-summary-card.income {
    border-color: var(--success-line);
    background: var(--success-soft);
}

.finance-summary-card.expense {
    border-color: var(--danger-line);
    background: var(--danger-soft);
}

.finance-summary-card.profit {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.finance-summary-card.profit.is-negative {
    border-color: var(--danger-line);
    background: var(--danger-soft);
}

.finance-summary-card.pending {
    border-color: var(--orange-line);
    background: var(--orange-soft);
}

.finance-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 16px;
    margin: 18px 0;
}

.finance-chart-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}

.finance-report-toolbar {
    align-items: end;
}

.finance-report-toolbar label {
    display: grid;
    gap: 6px;
    min-width: 160px;
}

.finance-report-toolbar label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.finance-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.finance-report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 16px;
    margin-top: 18px;
}

.finance-insight-card,
.finance-donut-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.finance-insight-card {
    display: grid;
    gap: 12px;
    align-content: start;
}

.finance-insight-card h2 {
    margin: 0;
    font-size: 24px;
}

.finance-insight-card p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.finance-meter {
    display: grid;
    gap: 7px;
}

.finance-meter div {
    overflow: hidden;
    height: 14px;
    border-radius: 999px;
    background: var(--success-soft);
}

.finance-meter span {
    display: block;
    height: 100%;
    min-width: 8px;
    border-radius: inherit;
    background: var(--danger);
}

.finance-meter small {
    color: var(--muted);
    font-weight: 800;
}

.finance-donut-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.finance-donut {
    position: relative;
    display: grid;
    place-items: center;
    width: 160px;
    height: 160px;
    border-radius: 999px;
}

.finance-donut::after {
    content: "";
    position: absolute;
    inset: 26px;
    border-radius: inherit;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.finance-donut strong,
.finance-donut span {
    position: relative;
    z-index: 1;
}

.finance-donut strong {
    align-self: end;
    font-size: 17px;
}

.finance-donut span {
    align-self: start;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.finance-donut-legend {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.finance-donut-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.finance-donut-legend i {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #cbd5e1;
}

.finance-chart-wide {
    grid-column: 1 / -1;
}

.finance-bar-list {
    display: grid;
    gap: 14px;
}

.finance-bar-row {
    display: grid;
    gap: 7px;
}

.finance-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    font-size: 13px;
}

.finance-bar-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.finance-bar-meta b {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--muted);
    font-size: 11px;
}

.finance-bar-track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
}

.finance-bar-track span {
    display: block;
    min-width: 8px;
    height: 100%;
    border-radius: inherit;
}

.finance-bar-row small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.finance-balance {
    display: grid;
    gap: 14px;
    align-content: start;
    color: var(--muted);
    line-height: 1.45;
}

.finance-trend-list {
    display: grid;
    gap: 14px;
}

.finance-trend-row {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.finance-trend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.finance-trend-head strong {
    font-size: 13px;
}

.finance-trend-head b {
    color: #166534;
    font-size: 13px;
}

.finance-trend-head b.is-negative {
    color: var(--danger);
}

.finance-trend-bars {
    display: grid;
    gap: 6px;
}

.finance-trend-bars span {
    display: flex;
    align-items: center;
    min-width: 9px;
    height: 22px;
    border-radius: 999px;
}

.finance-trend-bars i {
    overflow: hidden;
    padding: 0 9px;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-trend-bars .income {
    background: var(--success);
}

.finance-trend-bars .expense {
    background: var(--danger);
}

.finance-toolbar select[name="type"],
.finance-toolbar select[name="status"] {
    flex: 0 0 155px;
    max-width: 155px;
}

.finance-toolbar select[name="category_id"] {
    flex: 1 1 220px;
}

.finance-table-wrap {
    margin-top: 10px;
}

.finance-table {
    min-width: 1020px;
    table-layout: fixed;
    font-size: 13px;
}

.finance-table th:nth-child(1),
.finance-table td:nth-child(1) {
    width: 108px;
    white-space: nowrap;
}

.finance-table th:nth-child(2),
.finance-table td:nth-child(2) {
    width: 110px;
}

.finance-table th:nth-child(3),
.finance-table td:nth-child(3) {
    width: 180px;
}

.finance-table th:nth-child(5),
.finance-table td:nth-child(5) {
    width: 122px;
}

.finance-table th:nth-child(6),
.finance-table td:nth-child(6) {
    width: 130px;
    text-align: right;
}

.finance-table th:nth-child(7),
.finance-table td:nth-child(7) {
    width: 100px;
}

.finance-table td.actions {
    overflow: visible;
}

.finance-category-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 7px;
    border-radius: 999px;
    vertical-align: middle;
}

.finance-trace-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.finance-trace-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.finance-trace-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.finance-trace-card strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.finance-trace-card.income {
    border-color: var(--success-line);
    background: var(--success-soft);
}

.finance-trace-card.expense {
    border-color: var(--danger-line);
    background: var(--danger-soft);
}

.finance-trace-card.profit {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.finance-trace-card.profit.is-negative {
    border-color: var(--danger-line);
    background: var(--danger-soft);
}

.finance-income-context {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.finance-income-context p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.finance-category-create {
    display: grid;
    grid-template-columns: 150px minmax(220px, 1fr) 90px 110px auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.finance-category-create label span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 800;
}

.finance-category-create input[type="color"],
.finance-category-table input[type="color"] {
    min-height: 42px;
    padding: 4px;
}

.finance-category-active {
    align-self: center;
    margin: 0;
}

.finance-category-table {
    min-width: 900px;
    table-layout: fixed;
    font-size: 13px;
}

.finance-category-table th:nth-child(1),
.finance-category-table td:nth-child(1) {
    width: 190px;
}

.finance-category-table th:nth-child(3),
.finance-category-table td:nth-child(3) {
    width: 100px;
}

.finance-category-table th:nth-child(4),
.finance-category-table td:nth-child(4) {
    width: 130px;
}

.finance-category-table th:nth-child(5),
.finance-category-table td:nth-child(5) {
    width: 110px;
}

.finance-category-table td {
    vertical-align: middle;
}

.finance-category-table select {
    margin-bottom: 6px;
}

.finance-category-table tr.is-deleted td {
    background: #f8fafc;
    color: var(--muted);
}

.finance-category-actions {
    white-space: nowrap;
}

.finance-category-actions form,
.finance-category-actions button {
    display: inline-grid;
    vertical-align: middle;
}

.finance-category-actions form {
    margin: 0 0 0 8px;
}

.finance-recurring-create {
    display: grid;
    grid-template-columns: 130px minmax(190px, 1fr) minmax(180px, 1fr) 120px 130px 150px 94px auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.finance-recurring-table {
    min-width: 1280px;
    table-layout: fixed;
    font-size: 13px;
}

.finance-recurring-table th:nth-child(1),
.finance-recurring-table td:nth-child(1) {
    width: 145px;
}

.finance-recurring-table th:nth-child(2),
.finance-recurring-table td:nth-child(2) {
    width: 210px;
}

.finance-recurring-table th:nth-child(3),
.finance-recurring-table td:nth-child(3) {
    width: 230px;
}

.finance-recurring-table th:nth-child(4),
.finance-recurring-table td:nth-child(4) {
    width: 120px;
}

.finance-recurring-table th:nth-child(5),
.finance-recurring-table td:nth-child(5) {
    width: 140px;
}

.finance-recurring-table th:nth-child(6),
.finance-recurring-table td:nth-child(6) {
    width: 150px;
}

.finance-recurring-table th:nth-child(7),
.finance-recurring-table td:nth-child(7) {
    width: 110px;
}

.finance-recurring-table th:nth-child(8),
.finance-recurring-table td:nth-child(8) {
    width: 140px;
}

.finance-recurring-table tr.is-due td {
    background: var(--orange-soft);
}

.finance-recurring-table input,
.finance-recurring-table select {
    margin-bottom: 6px;
    font-size: 13px;
}

.finance-recurring-table input:last-child,
.finance-recurring-table select:last-child {
    margin-bottom: 0;
}

.finance-recurring-actions {
    white-space: nowrap;
}

.finance-recurring-actions form,
.finance-recurring-actions button {
    display: inline-grid;
    vertical-align: middle;
}

.finance-recurring-actions form {
    margin: 0 0 0 8px;
}

.due-text {
    color: var(--orange-hover);
    font-weight: 900;
}

.compact-check {
    margin: 0;
}

.summary-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.template-help {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.template-help code {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 7px;
    background: #f8fafc;
    color: var(--text);
}

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

.template-preview > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.template-preview h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.template-preview pre {
    min-height: 110px;
    margin: 0;
    white-space: pre-wrap;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

.email-preview-wrap {
    background: #f8fafc;
}

.email-preview {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.email-top {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--blue), #0f172a);
    color: #fff;
}

.email-top span {
    display: block;
    font-size: 13px;
    opacity: 0.85;
}

.email-top strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
}

.email-subject {
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    color: var(--text);
    font-weight: 800;
}

.email-body {
    padding: 18px 20px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}

.email-body p {
    margin: 0 0 14px;
}

.email-body p:last-child {
    margin-bottom: 0;
}

.email-footer {
    display: grid;
    gap: 3px;
    border-top: 1px solid var(--line);
    padding: 14px 20px;
    background: var(--orange-soft);
    color: var(--orange-hover);
    font-size: 13px;
}

.email-suggestions {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    box-shadow: var(--shadow);
}

.email-suggestions[hidden] {
    display: none;
}

.email-suggestion-item {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 9px 10px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.email-suggestion-item:hover,
.email-suggestion-item:focus {
    background: #eff6ff;
    outline: none;
}

.email-suggestion-item strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.email-suggestion-item span {
    color: var(--muted);
    font-size: 12px;
}

.email-tracking-panel {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.email-tracking-mini {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.email-tracking-mini span {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 7px 9px;
}

.email-tracking-mini b {
    color: var(--text);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.email-tracking-mini em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.tracking-icon {
    grid-template-columns: 1fr auto;
    gap: 4px;
    width: 52px;
    font-size: 17px;
}

.tracking-icon b {
    display: inline-grid;
    place-items: center;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #fff;
    font-size: 10px;
    line-height: 1;
}

.tracking-modal-list {
    display: grid;
    gap: 10px;
    max-height: min(62vh, 520px);
    overflow: auto;
    margin-top: 16px;
}

.tracking-modal-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.tracking-modal-item strong,
.tracking-modal-item em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracking-modal-item strong {
    color: var(--text);
    font-size: 14px;
}

.tracking-modal-item em {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.tracking-modal-item .badge {
    justify-self: end;
}

.tracking-modal-dates {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tracking-modal-dates span {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.tracking-modal-dates b {
    color: var(--text);
    font-size: 12px;
}

.billing-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 280px) 170px 160px auto auto;
}

.billing-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

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

.import-summary div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.import-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.import-summary strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}

.import-table-wrap {
    overflow-x: auto;
}

.import-table {
    min-width: 1680px;
    table-layout: fixed;
    font-size: 13px;
}

.import-table th,
.import-table td {
    padding: 10px;
    vertical-align: top;
}

.import-table th:nth-child(1),
.import-table td:nth-child(1) {
    width: 94px;
    text-align: center;
}

.import-table th:nth-child(2),
.import-table td:nth-child(2) {
    width: 260px;
}

.import-table th:nth-child(3),
.import-table td:nth-child(3) {
    width: 70px;
    text-align: center;
}

.import-table th:nth-child(4),
.import-table td:nth-child(4) {
    width: 120px;
    text-align: center;
}

.import-table th:nth-child(5),
.import-table td:nth-child(5) {
    width: 150px;
}

.import-table th:nth-child(6),
.import-table td:nth-child(6) {
    width: 240px;
}

.import-table th:nth-child(7),
.import-table td:nth-child(7) {
    width: 110px;
    text-align: right;
}

.import-table th:nth-child(8),
.import-table td:nth-child(8) {
    width: 240px;
}

.import-table th:nth-child(9),
.import-table td:nth-child(9) {
    width: 260px;
}

.import-table th:nth-child(10),
.import-table td:nth-child(10) {
    width: 130px;
}

.import-table th:nth-child(11),
.import-table td:nth-child(11) {
    width: 110px;
    text-align: center;
}

.import-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.import-alert {
    margin-bottom: 5px;
    border: 1px solid var(--orange-line);
    border-radius: 8px;
    padding: 6px 8px;
    background: var(--orange-soft);
    color: var(--orange-hover);
    font-size: 12px;
    font-weight: 700;
}

.import-suggestion {
    margin-bottom: 5px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    padding: 6px 8px;
    background: var(--blue-soft);
    color: var(--blue-hover);
    font-size: 12px;
    font-weight: 700;
}

.import-approval-box {
    display: grid;
    gap: 8px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--blue-soft);
    color: var(--blue-hover);
}

.import-approval-box h2 {
    margin: 0;
    font-size: 16px;
}

.import-approval-box p {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.small-button {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
}

.text-snippet {
    max-width: 520px;
    max-height: 260px;
    overflow: auto;
    margin: 8px 0 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
    color: var(--text);
    white-space: pre-wrap;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.4;
}

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

.import-source-panel {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.import-source-panel span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.import-source-panel strong {
    display: block;
    overflow-wrap: anywhere;
}

.import-source-panel .text-snippet {
    max-width: none;
    max-height: 520px;
}

.billing-table-wrap {
    overflow-x: auto;
}

.billing-table {
    min-width: 1120px;
    table-layout: fixed;
    font-size: 13px;
}

.billing-table th,
.billing-table td {
    padding: 10px;
}

.billing-table .col-billing-number {
    width: 74px;
}

.billing-table .col-billing-date {
    width: 112px;
}

.billing-table .col-billing-client {
    width: 310px;
}

.billing-table .col-billing-total {
    width: 126px;
}

.billing-table .col-billing-status {
    width: 126px;
}

.billing-table .col-billing-options {
    width: 190px;
}

.billing-table .col-billing-actions {
    width: 282px;
}

.billing-table td:first-child,
.billing-table td:nth-child(2),
.billing-table td:nth-child(4) {
    white-space: nowrap;
}

.billing-table td:nth-child(4) {
    font-weight: 800;
}

.billing-table td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.inline-status-form {
    margin: 0;
}

.status-select {
    width: 108px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 22px 0 9px;
    background: #fff;
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    outline: none;
    text-overflow: ellipsis;
}

.status-select.muted-badge {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.status-select.info {
    border-color: var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue-hover);
}

.status-select.success {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.status-select.warning {
    border-color: var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.status-select.danger {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.status-select:focus {
    box-shadow: 0 0 0 3px rgba(47, 107, 178, 0.14);
}

.billing-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mini-flag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid var(--blue-line);
    border-radius: 999px;
    padding: 0 8px;
    background: var(--blue-soft);
    color: var(--blue-hover);
    font-size: 11px;
    font-weight: 800;
}

.mini-flag.paid {
    border-color: var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.mini-flag.scheduled {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.schedule-meta {
    display: block;
    max-width: 190px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduled-table-wrap {
    overflow-x: auto;
}

.scheduled-table {
    min-width: 1120px;
}

.scheduled-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.task-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.task-summary a {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.task-summary a.active {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.task-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.task-summary strong {
    font-size: 24px;
}

.assistant-panel {
    display: grid;
    gap: 18px;
    max-width: 980px;
    margin-inline: auto;
    min-height: calc(100vh - 170px);
    grid-template-rows: auto auto auto minmax(300px, 1fr) auto;
}

.assistant-notice {
    border: 1px solid var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.assistant-question-box {
    position: sticky;
    bottom: 12px;
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.05);
    z-index: 5;
}

.assistant-question-box label span {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.assistant-question-box textarea {
    min-height: 86px;
    line-height: 1.5;
    resize: vertical;
}

.assistant-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.assistant-actions small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.assistant-examples {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.assistant-examples button {
    flex: 0 0 auto;
    border: 1px solid var(--blue-line);
    border-radius: 999px;
    padding: 8px 11px;
    background: var(--blue-soft);
    color: var(--blue-hover);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.assistant-examples button:hover {
    border-color: var(--blue);
    background: #dbeafe;
}

.assistant-thread {
    display: grid;
    align-content: start;
    gap: 14px;
    min-height: 320px;
    max-height: calc(100vh - 380px);
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-right: 4px;
}

.assistant-empty {
    display: grid;
    gap: 5px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 22px;
    background: #fff;
    color: var(--muted);
    text-align: center;
}

.assistant-empty strong {
    color: var(--text);
    font-size: 18px;
}

.assistant-empty p {
    margin: 0;
}

.assistant-message {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.assistant-message.is-pending {
    border-color: var(--blue-line);
    background: #f8fbff;
}

.assistant-message header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.assistant-message header small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.assistant-question,
.assistant-answer,
.assistant-error-detail {
    display: grid;
    gap: 6px;
}

.assistant-question strong,
.assistant-answer strong,
.assistant-error-detail strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.assistant-question p,
.assistant-answer p,
.assistant-error-detail p {
    margin: 0;
    line-height: 1.55;
}

.assistant-question p {
    justify-self: end;
    max-width: min(720px, 100%);
    border: 1px solid var(--blue-line);
    border-radius: 8px 8px 2px 8px;
    padding: 10px 12px;
    background: var(--blue-soft);
    color: var(--text);
    font-weight: 800;
}

.assistant-answer > div {
    justify-self: start;
    max-width: min(760px, 100%);
    border-radius: 8px 8px 8px 2px;
    padding: 10px 12px;
    background: #f8fafc;
    color: var(--text);
}

.assistant-markdown h3,
.assistant-markdown h4,
.assistant-markdown h5,
.ai-widget-bubble-assistant h3,
.ai-widget-bubble-assistant h4,
.ai-widget-bubble-assistant h5 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
}

.assistant-markdown p,
.ai-widget-bubble-assistant p {
    margin: 0 0 8px;
}

.assistant-markdown p:last-child,
.ai-widget-bubble-assistant p:last-child {
    margin-bottom: 0;
}

.assistant-markdown ul,
.assistant-markdown ol,
.ai-widget-bubble-assistant ul,
.ai-widget-bubble-assistant ol {
    margin: 4px 0 9px;
    padding-left: 18px;
}

.assistant-markdown li,
.ai-widget-bubble-assistant li {
    margin: 4px 0;
}

.assistant-markdown code,
.ai-widget-bubble-assistant code {
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
    background: #fff;
    color: #334155;
    font-size: 0.92em;
    overflow-wrap: anywhere;
}

.assistant-thinking {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.assistant-thinking i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    animation: assistantPulse 1s infinite ease-in-out;
}

.assistant-thinking i:nth-child(2) {
    animation-delay: 0.15s;
}

.assistant-thinking i:nth-child(3) {
    animation-delay: 0.3s;
}

.assistant-error-detail {
    border: 1px solid var(--orange-line);
    border-radius: 8px;
    padding: 10px;
    background: var(--orange-soft);
}

.assistant-error-detail p {
    color: var(--orange-hover);
    font-size: 13px;
}

.assistant-message footer {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

@keyframes assistantPulse {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@media (max-width: 640px) {
    .assistant-panel {
        max-width: none;
        min-height: auto;
        grid-template-rows: auto;
    }

    .assistant-question-box {
        bottom: 8px;
        padding: 13px;
    }

    .assistant-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .assistant-actions small {
        min-height: 16px;
        text-align: left;
    }

    .assistant-actions .button {
        justify-content: center;
        width: 100%;
    }

    .assistant-thread {
        min-height: 360px;
        max-height: 58vh;
        padding-right: 0;
    }

    .assistant-message {
        padding: 13px;
    }
}

.quick-notes-widget {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 58;
    display: grid;
    justify-items: start;
    gap: 12px;
    pointer-events: none;
}

.quick-notes-toggle,
.quick-notes-panel {
    pointer-events: auto;
}

.quick-notes-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-notes-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.26);
}

.quick-notes-toggle span {
    position: relative;
    width: 28px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.15);
}

.quick-notes-toggle span::before,
.quick-notes-toggle span::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 6px;
    height: 2px;
    border-radius: 99px;
    background: #fff;
}

.quick-notes-toggle span::before {
    top: 10px;
    box-shadow: 0 7px 0 #fff;
}

.quick-notes-toggle span::after {
    top: 24px;
}

.quick-notes-toggle b {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.quick-notes-toggle b[hidden] {
    display: none;
}

.quick-notes-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(260px, 1fr);
    width: min(390px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 112px));
    overflow: hidden;
    border: 1px solid rgba(253, 186, 116, 0.78);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

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

.quick-notes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 13px 14px;
    background: linear-gradient(180deg, #fff7ed, #fff);
}

.quick-notes-head strong,
.quick-notes-head small {
    display: block;
}

.quick-notes-head strong {
    color: var(--text);
    font-size: 15px;
}

.quick-notes-head small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.quick-notes-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.quick-notes-create-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 11px;
    background: #fff;
}

.quick-notes-create-list input,
.quick-notes-add-item input {
    min-width: 0;
}

.quick-notes-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    padding: 10px 11px;
    background: #f8fafc;
}

.quick-notes-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 190px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

.quick-notes-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-notes-tab b {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text);
    font-size: 11px;
}

.quick-notes-tab.is-active {
    border-color: var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue);
}

.quick-notes-tab.color-green.is-active {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

.quick-notes-tab.color-orange.is-active {
    border-color: var(--orange-line);
    background: var(--orange-soft);
    color: var(--orange-hover);
}

.quick-notes-tab.color-pink.is-active {
    border-color: #fbcfe8;
    background: #fdf2f8;
    color: #be185d;
}

.quick-notes-tab.color-slate.is-active {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #334155;
}

.quick-notes-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    min-height: 0;
    padding: 12px;
}

.quick-notes-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    padding: 10px;
    background: var(--blue-soft);
}

.quick-notes-list-head.color-green {
    border-color: var(--success-line);
    background: var(--success-soft);
}

.quick-notes-list-head.color-orange {
    border-color: var(--orange-line);
    background: var(--orange-soft);
}

.quick-notes-list-head.color-pink {
    border-color: #fbcfe8;
    background: #fdf2f8;
}

.quick-notes-list-head.color-slate {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.quick-notes-list-head strong,
.quick-notes-list-head small {
    display: block;
}

.quick-notes-list-head strong {
    font-size: 14px;
}

.quick-notes-list-head small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.quick-notes-list-head button,
.quick-notes-delete-list,
.quick-notes-items button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.quick-notes-list-head button {
    min-height: 30px;
    padding: 0 10px;
}

.quick-notes-items {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.quick-notes-items li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px;
    background: #fff;
}

.quick-notes-items label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    cursor: pointer;
}

.quick-notes-items input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.quick-notes-items label span {
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.quick-notes-items li.is-done label span {
    color: var(--muted);
    text-decoration: line-through;
}

.quick-notes-items button {
    width: 30px;
    height: 30px;
    color: var(--danger);
}

.quick-notes-empty,
.quick-notes-empty-row {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 16px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.quick-notes-add-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
}

.quick-notes-add-item .button {
    min-height: 38px;
    padding: 0;
    font-size: 20px;
}

.quick-notes-delete-list {
    min-height: 34px;
    width: 100%;
    color: var(--danger);
}

.ai-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
    display: grid;
    justify-items: end;
    gap: 12px;
    pointer-events: none;
}

.ai-widget-toggle,
.ai-widget-panel {
    pointer-events: auto;
}

.ai-widget-toggle {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(191, 219, 254, 0.9);
    border-radius: 18px;
    background:
        linear-gradient(135deg, var(--blue), #0f766e 58%, var(--orange));
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ai-widget-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.28);
}

.ai-widget-toggle span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
}

.ai-widget-panel {
    display: grid;
    grid-template-rows: auto auto minmax(260px, 1fr) auto;
    width: min(420px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 112px));
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

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

.ai-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 14px 14px 12px;
    background:
        linear-gradient(90deg, rgba(239, 246, 255, 0.95), rgba(255, 247, 237, 0.78)),
        #fff;
}

.ai-widget-head div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.ai-widget-head strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
}

.ai-widget-head small,
.ai-widget-actions small,
.ai-widget-meta small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ai-widget-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.ai-widget-close:hover {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.ai-widget-examples {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    background: #f8fafc;
    scrollbar-width: thin;
}

.ai-widget-examples button {
    flex: 0 0 auto;
    border: 1px solid var(--blue-line);
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    color: var(--blue-hover);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.ai-widget-thread {
    display: grid;
    align-content: start;
    gap: 12px;
    overflow-y: auto;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ai-widget-empty {
    display: grid;
    gap: 5px;
    align-self: center;
    margin: 38px 8px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 22px 16px;
    color: var(--muted);
    text-align: center;
}

.ai-widget-empty strong {
    color: var(--text);
    font-size: 18px;
}

.ai-widget-empty p {
    margin: 0;
    line-height: 1.45;
}

.ai-widget-message {
    display: grid;
    gap: 8px;
}

.ai-widget-message.is-pending .ai-widget-bubble-assistant {
    border-color: var(--blue-line);
    background: var(--blue-soft);
}

.ai-widget-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-widget-bubble {
    max-width: 92%;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.5;
}

.ai-widget-bubble-user {
    justify-self: end;
    border: 1px solid var(--blue-line);
    border-bottom-right-radius: 2px;
    background: var(--blue-soft);
    color: var(--text);
    font-weight: 800;
}

.ai-widget-bubble-assistant {
    justify-self: start;
    border: 1px solid var(--line);
    border-bottom-left-radius: 2px;
    background: #fff;
    color: var(--text);
}

.ai-widget-error {
    border: 1px solid var(--orange-line);
    border-radius: 8px;
    padding: 9px 10px;
    background: var(--orange-soft);
}

.ai-widget-error strong {
    display: block;
    margin-bottom: 4px;
    color: var(--orange-hover);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ai-widget-error p {
    margin: 0;
    color: var(--orange-hover);
    font-size: 12px;
    line-height: 1.45;
}

.ai-widget-action-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.ai-widget-action-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    align-items: center;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    padding: 9px;
    background: var(--blue-soft);
}

.ai-widget-action-card strong,
.ai-widget-action-card small {
    display: block;
}

.ai-widget-action-card strong {
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
}

.ai-widget-action-card small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
}

.ai-widget-action-card > small {
    grid-column: 1 / -1;
    min-height: 14px;
    color: var(--blue);
    font-weight: 800;
}

.ai-widget-action-card .button {
    min-height: 30px;
    padding: 0 10px;
    white-space: nowrap;
}

.ai-widget-message footer {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.ai-widget-form {
    display: grid;
    gap: 9px;
    border-top: 1px solid var(--line);
    padding: 12px;
    background: #fff;
}

.ai-widget-form textarea {
    min-height: 58px;
    max-height: 140px;
    resize: vertical;
}

.ai-widget-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-widget-actions .button {
    min-height: 36px;
    padding: 0 14px;
}

@media (max-width: 640px) {
    .quick-notes-widget {
        left: 12px;
        bottom: 12px;
    }

    .quick-notes-toggle {
        width: 56px;
        height: 56px;
        border-radius: 17px;
    }

    .quick-notes-panel {
        position: fixed;
        left: 10px;
        bottom: 0;
        width: calc(100vw - 20px);
        height: min(86vh, 720px);
        grid-template-rows: auto auto auto minmax(0, 1fr);
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }

    .quick-notes-open .quick-notes-toggle {
        display: none;
    }

    .quick-notes-open .ai-widget-toggle {
        display: none;
    }

    .quick-notes-head {
        padding: 9px 11px;
    }

    .quick-notes-head small {
        display: none;
    }

    .quick-notes-close {
        width: 30px;
        height: 30px;
    }

    .quick-notes-create-list {
        grid-template-columns: minmax(0, 1fr) 76px;
        gap: 7px;
        padding: 8px 10px;
    }

    .quick-notes-create-list .button {
        justify-content: center;
        width: 100%;
        min-height: 34px;
        padding: 0 10px;
    }

    .quick-notes-tabs {
        gap: 6px;
        padding: 7px 10px;
    }

    .quick-notes-tab {
        max-width: 150px;
        padding: 6px 8px;
        font-size: 11px;
    }

    .quick-notes-tab b {
        min-width: 18px;
        height: 18px;
    }

    .quick-notes-body {
        gap: 8px;
        padding: 9px 10px 10px;
    }

    .quick-notes-list-head {
        padding: 8px;
    }

    .quick-notes-list-head strong {
        font-size: 13px;
    }

    .quick-notes-list-head small {
        font-size: 10px;
    }

    .quick-notes-list-head button {
        min-height: 28px;
        padding: 0 8px;
        font-size: 11px;
    }

    .quick-notes-items {
        gap: 7px;
    }

    .quick-notes-items li {
        padding: 8px;
    }

    .quick-notes-add-item {
        grid-template-columns: minmax(0, 1fr) 38px;
    }

    .quick-notes-add-item .button {
        min-height: 36px;
    }

    .quick-notes-delete-list {
        min-height: 30px;
        font-size: 11px;
    }

    .ai-widget {
        right: 12px;
        bottom: 12px;
    }

    .ai-widget-toggle {
        width: 56px;
        height: 56px;
        border-radius: 17px;
    }

    .ai-widget-panel {
        position: fixed;
        right: 10px;
        bottom: 0;
        width: calc(100vw - 20px);
        height: min(84vh, 720px);
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }

    .ai-widget-open .ai-widget-toggle {
        display: none;
    }

    .ai-widget-thread {
        padding: 12px;
    }

    .ai-widget-bubble {
        max-width: 96%;
        font-size: 13px;
    }

    .ai-widget-action-card {
        grid-template-columns: 1fr;
    }

    .ai-widget-action-card .button {
        justify-content: center;
        width: 100%;
    }

    .ai-widget-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ai-widget-actions .button {
        justify-content: center;
        width: 100%;
    }
}

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

.task-list {
    display: grid;
    gap: 10px;
}

.task-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.task-row.is-overdue {
    border-left-color: var(--danger);
    background: #fff5f5;
}

.task-row.is-today {
    border-left-color: var(--orange);
    background: var(--orange-soft);
}

.task-row.is-upcoming {
    border-left-color: var(--blue);
}

.task-row.is-completed {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.task-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.task-title-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.task-title-line strong {
    overflow-wrap: anywhere;
    font-size: 16px;
}

.task-main p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

.task-main small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

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

.task-actions form {
    margin: 0;
}

.priority-high {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.priority-normal {
    border-color: var(--blue-line);
    background: var(--blue-soft);
    color: var(--blue-hover);
}

.priority-low {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.task-empty {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

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

.project-card,
.project-overview,
.project-update-box,
.project-update {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.project-card {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.project-card-head {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.project-card h2,
.project-update h2,
.project-update h3 {
    margin: 0;
    font-size: 18px;
}

.project-card p,
.project-overview p,
.project-update p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.project-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.project-progress span {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
}

.project-progress b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--orange));
}

.project-progress strong {
    color: var(--blue-hover);
    font-size: 13px;
}

.project-progress.big span {
    height: 16px;
}

.project-card small {
    color: var(--muted);
    font-weight: 800;
}

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

.project-card-actions form {
    margin: 0;
}

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

.project-overview,
.project-update-box {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.project-public-link span,
.project-update-box h2 {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 900;
}

.project-update-form {
    display: grid;
    gap: 10px;
}

.project-file-input {
    display: grid;
    gap: 5px;
}

.project-date-input {
    display: grid;
    gap: 5px;
}

.project-date-input span,
.project-file-input span {
    color: var(--text);
    font-weight: 900;
}

.project-file-input small {
    color: var(--muted);
}

.project-timeline,
.project-public-timeline {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.project-update {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 16px;
    border-left-width: 5px;
}

.project-update.update-info {
    border-left-color: var(--blue);
}

.project-update.update-progress {
    border-left-color: var(--orange);
}

.project-update.update-client {
    border-left-color: #9333ea;
}

.project-update.update-done {
    border-left-color: var(--success);
}

.project-update > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.project-update small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.project-update form {
    margin: 0;
}

.project-update-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

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

.project-file {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.project-file.image-file {
    display: grid;
    gap: 8px;
    padding: 8px;
}

.project-file.image-file a {
    display: block;
}

.project-file img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
}

.project-file.document-file a,
a.project-file.document-file {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    padding: 12px;
    color: var(--text);
    text-decoration: none;
}

.file-icon {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #334155;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.file-icon-pdf {
    background: #fee2e2;
    color: #b91c1c;
}

.file-icon-doc,
.file-icon-docx {
    background: #dbeafe;
    color: #1d4ed8;
}

.file-icon-xls,
.file-icon-xlsx {
    background: #dcfce7;
    color: #15803d;
}

.project-file.document-file strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.project-file.document-file span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.project-file form {
    margin: 0 8px 8px;
}

.project-edit-files {
    display: grid;
    gap: 10px;
}

.project-edit-files .project-files {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
}

.project-edit-files .project-file.document-file {
    grid-column: 1 / -1;
}

.project-edit-files .project-file.document-file a {
    grid-template-columns: 46px minmax(0, 1fr);
}

.project-edit-files .project-file.document-file strong {
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.project-edit-files .project-file img {
    aspect-ratio: 16 / 10;
}

.project-edit-files h3 {
    margin: 0;
    font-size: 15px;
}

.project-edit-files small {
    color: var(--muted);
}

.public-files .project-file.image-file {
    padding: 0;
}

.public-files .project-file img {
    border-radius: 8px;
}

.project-email-log {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

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

.project-email-preview {
    background: #f8fafc;
}

.project-email-top {
    background: linear-gradient(135deg, #0f172a, var(--blue));
}

.project-email-top strong {
    margin-top: 0;
}

.project-email-update-card {
    display: grid;
    gap: 10px;
    margin: 0 20px 20px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #eff6ff;
    padding: 14px;
}

.project-email-update-card small {
    color: var(--blue-hover);
    font-weight: 900;
}

.project-email-update-card h2 {
    margin: 0;
    font-size: 18px;
}

.project-email-update-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.project-email-files {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
}

.project-email-files strong {
    color: var(--text);
    font-size: 13px;
}

.project-email-files span {
    color: var(--muted);
    font-size: 12px;
}

.upload-loading,
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
}

.upload-loading[hidden],
.image-modal[hidden] {
    display: none;
}

.upload-loading > div {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: min(100%, 360px);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    background: #fff;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.upload-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #dbeafe;
    border-top-color: var(--orange);
    border-radius: 999px;
    animation: spin 0.85s linear infinite;
}

.upload-loading strong {
    color: var(--text);
    font-size: 18px;
}

.upload-loading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.image-modal figure {
    display: grid;
    gap: 10px;
    max-width: min(100%, 1040px);
    max-height: 90vh;
    margin: 0;
}

.image-modal img {
    max-width: 100%;
    max-height: calc(90vh - 48px);
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    box-shadow: var(--shadow);
}

.image-modal figcaption {
    justify-self: center;
    max-width: min(100%, 760px);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    overflow-wrap: anywhere;
}

.image-modal-close {
    position: fixed;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-open {
    overflow: hidden;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.project-empty {
    grid-column: 1 / -1;
}

.project-public-page {
    background:
        linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(255, 247, 237, 0.45) 420px),
        #f8fafc;
}

.project-public-shell {
    width: min(100% - 28px, 980px);
    margin: 0 auto;
    padding: 34px 0;
}

.project-public-hero {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(22px, 5vw, 44px);
    background: #fff;
    box-shadow: var(--shadow);
}

.project-public-hero img {
    width: 180px;
    max-width: 72%;
}

.project-public-hero h1 {
    margin: 0;
    font-size: clamp(30px, 7vw, 52px);
    line-height: 1.05;
}

.project-public-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}

.public-progress {
    margin-top: 8px;
}

.project-public-timeline h2 {
    margin: 10px 0 2px;
    font-size: 24px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0;
}

.calendar-toolbar strong {
    color: var(--text);
    font-size: 20px;
}

.task-calendar {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.calendar-weekdays,
.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.calendar-weekdays span {
    padding: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 126px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px;
    background: #fff;
}

.calendar-week .calendar-day:last-child {
    border-right: 0;
}

.calendar-week:last-child .calendar-day {
    border-bottom: 0;
}

.calendar-day.is-muted {
    background: #f8fafc;
    color: var(--muted);
}

.calendar-day.is-today {
    background: var(--orange-soft);
}

.calendar-day-number {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.calendar-day.is-today .calendar-day-number {
    background: var(--orange);
    color: #fff;
}

.calendar-task {
    display: grid;
    gap: 2px;
    margin-top: 7px;
    border: 1px solid var(--blue-line);
    border-radius: 8px;
    padding: 6px 7px;
    background: var(--blue-soft);
    color: var(--blue-hover);
    font-size: 12px;
    font-weight: 800;
}

.calendar-task.priority-high {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.calendar-task.priority-low {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: #166534;
}

.calendar-task span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-task small {
    color: inherit;
    font-size: 10px;
    opacity: 0.78;
}

.billing-editor {
    display: grid;
    gap: 18px;
}

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

.schedule-email-box {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.scheduled-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.scheduled-notice form {
    margin: 0;
}

.form-section {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.form-section h2 {
    margin: 0;
    font-size: 18px;
}

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

.wide-field {
    grid-column: span 2;
}

.billing-items {
    display: grid;
    gap: 12px;
}

.billing-item-row {
    display: grid;
    grid-template-columns: 110px minmax(260px, 1fr) 170px 42px;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.billing-item-row label span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 800;
}

.description-field textarea {
    min-height: 78px;
}

.remove-item {
    width: 42px;
    height: 42px;
}

.billing-total-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.billing-total-box span {
    color: var(--muted);
    font-weight: 800;
}

.billing-total-box strong {
    color: var(--blue-hover);
    font-size: 24px;
}

.document-stage {
    overflow: auto;
    border-radius: 8px;
    padding: 24px;
    background: #e5e7eb;
}

.payment-document {
    position: relative;
    width: min(100%, 816px);
    min-height: 1056px;
    margin: 0 auto;
    padding: 54px;
    background: #fff;
    color: #111827;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.14);
}

.document-header {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: flex-start;
    gap: 32px;
    border-bottom: 3px solid var(--blue);
    padding: 8px 10px 32px;
}

.document-title-block {
    display: grid;
    gap: 18px;
}

.doc-kicker {
    display: block;
    color: var(--orange-hover);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.document-header h2 {
    margin: 5px 0 0;
    color: #020617;
    font-size: 32px;
    line-height: 1.05;
}

.doc-date {
    width: 150px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 12px;
    text-align: right;
}

.doc-date span,
.client-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 18px;
    background: #f8fafc;
}

.client-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

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

.client-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

.document-items {
    width: 100%;
    margin-top: 28px;
    border-collapse: collapse;
}

.document-items th,
.document-items td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.document-items th {
    background: var(--blue-soft);
    color: var(--blue-hover);
    font-size: 13px;
    text-transform: uppercase;
}

.document-items th:first-child,
.document-items td:first-child {
    width: 70px;
    text-align: center;
}

.document-items th:last-child,
.document-items td:last-child {
    width: 160px;
    text-align: right;
}

.document-items tfoot td {
    border-bottom: 0;
    background: var(--orange-soft);
    color: var(--orange-hover);
    font-size: 16px;
    font-weight: 900;
}

.amount-words {
    margin: 18px 0 0;
    color: var(--text);
    font-weight: 800;
}

.payment-info {
    margin-top: 24px;
    border-left: 4px solid var(--blue);
    padding: 12px 14px;
    background: #f8fafc;
    color: var(--text);
    line-height: 1.45;
}

.document-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px;
    margin-top: 76px;
}

.document-signatures div {
    display: grid;
    gap: 4px;
    min-height: 98px;
    align-content: end;
}

.document-signatures span {
    display: block;
    border-top: 1px solid #111827;
}

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

.signature-image {
    max-width: 190px;
    max-height: 70px;
    object-fit: contain;
}

.paid-stamp {
    position: absolute;
    top: 180px;
    right: 56px;
    z-index: 1;
    transform: rotate(-12deg);
    border: 4px solid rgba(249, 115, 22, 0.72);
    border-radius: 8px;
    padding: 10px 18px;
    color: rgba(234, 88, 12, 0.72);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 2px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 24px;
}

.login {
    width: min(100%, 430px);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.login h1 {
    margin: 0 0 6px;
    font-size: 30px;
}

.login-logo {
    display: block;
    width: 190px;
    max-height: 50px;
    object-fit: contain;
    margin: 0 0 18px;
}

.login p {
    margin: 0 0 24px;
    color: var(--muted);
}

.login label {
    display: block;
    margin: 16px 0 6px;
    font-size: 14px;
    font-weight: 800;
}

.login .button {
    width: 100%;
    min-height: 46px;
    margin-top: 22px;
}

.login .passkey-login-button {
    margin-top: 10px;
}

.passkey-login-status {
    min-height: 18px;
    margin-top: 8px;
    text-align: center;
}

@media (max-width: 760px) {
    .topbar {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .brand-logo {
        width: 152px;
        max-height: 38px;
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding-top: 10px;
        border-top: 1px solid var(--line);
        overflow: visible;
    }

    .nav-group {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        min-height: 0;
        border: 0;
        border-radius: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-open .nav {
        display: flex;
    }

    .nav a {
        justify-content: flex-start;
        min-height: 42px;
        padding: 12px;
        border-radius: 8px;
        background: #fff;
    }

    .nav a.is-active {
        background: var(--blue);
        color: #fff;
    }

    .shell {
        width: min(100% - 16px, 1560px);
        margin-top: 18px;
    }

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

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

    .finance-dashboard-grid,
    .finance-report-hero,
    .finance-report-grid,
    .finance-trace-summary {
        grid-template-columns: 1fr;
    }

    .finance-donut-card {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .finance-donut-legend {
        width: 100%;
    }

    .finance-category-create {
        grid-template-columns: 1fr;
    }

    .finance-recurring-create {
        grid-template-columns: 1fr;
    }

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

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

    .panel {
        padding: 18px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-head,
    .toolbar,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-actions,
    .page-actions,
    .dashboard-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-card-actions,
    .privacy-toggle {
        width: 100%;
    }

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

    .dashboard-card {
        padding: 14px;
    }

    .dashboard-table {
        min-width: 680px;
        font-size: 12px;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 9px 8px;
    }

    .dashboard-hosting-table th:nth-child(1),
    .dashboard-hosting-table td:nth-child(1) {
        width: 96px;
    }

    .dashboard-hosting-table th:nth-child(2),
    .dashboard-hosting-table td:nth-child(2) {
        width: 64px;
    }

    .dashboard-hosting-table th:nth-child(3),
    .dashboard-hosting-table td:nth-child(3),
    .dashboard-hosting-table th:nth-child(4),
    .dashboard-hosting-table td:nth-child(4) {
        width: 180px;
    }

    .dashboard-hosting-table th:nth-child(5),
    .dashboard-hosting-table td:nth-child(5) {
        width: 160px;
    }

    .dashboard-list-item {
        grid-template-columns: 1fr;
    }

    .dashboard-list-item em {
        justify-items: start;
        text-align: left;
    }

    .dashboard-finance-mini {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .dashboard-finance-mini div {
        padding: 10px 8px;
    }

    .dashboard-finance-mini span {
        font-size: 10px;
    }

    .dashboard-finance-mini strong {
        font-size: clamp(12px, 3.25vw, 15px);
    }

    .toolbar input,
    .toolbar select,
    .toolbar input[type="month"],
    .finance-toolbar select[name="type"],
    .finance-toolbar select[name="status"],
    .toolbar .button {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
    }

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

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

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

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

    .task-row {
        grid-template-columns: 1fr;
    }

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

    .project-grid,
    .project-detail-grid,
    .project-email-grid {
        grid-template-columns: 1fr;
    }

    .project-card-actions,
    .project-card-actions .button,
    .project-card-actions form,
    .project-card-actions form .button {
        width: 100%;
    }

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

    .tracking-modal-dates {
        grid-template-columns: 1fr;
    }

    .project-public-shell {
        width: min(100% - 16px, 980px);
        padding: 18px 0;
    }

    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .task-calendar {
        overflow-x: auto;
    }

    .calendar-weekdays,
    .calendar-week {
        min-width: 760px;
    }

    .wide-field {
        grid-column: auto;
    }

    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .billing-item-row {
        grid-template-columns: 1fr;
    }

    .billing-email-grid {
        grid-template-columns: 1fr;
    }

    .scheduled-notice {
        align-items: stretch;
        flex-direction: column;
    }

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

    .remove-item {
        width: 100%;
    }

    .document-stage {
        overflow: visible;
        padding: 0;
        background: transparent;
    }

    .payment-document {
        width: 100%;
        min-height: auto;
        padding: 22px;
        box-shadow: none;
    }

    .document-header,
    .document-signatures {
        grid-template-columns: 1fr;
        flex-direction: column;
        gap: 16px;
    }

    .document-header h2 {
        font-size: 26px;
    }

    .doc-date {
        min-width: 0;
        width: 100%;
        text-align: left;
    }

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

    .paid-stamp {
        top: 130px;
        right: 24px;
        font-size: 24px;
    }

    .preview-panel .quick-actions {
        width: 100%;
    }

    .preview-panel .quick-actions .button {
        width: 100%;
    }

    .preview-panel .document-items,
    .preview-panel .document-items thead,
    .preview-panel .document-items tbody,
    .preview-panel .document-items tfoot,
    .preview-panel .document-items tr,
    .preview-panel .document-items th,
    .preview-panel .document-items td {
        display: block;
        width: 100%;
    }

    .preview-panel .document-items {
        margin-top: 20px;
        border: 1px solid var(--line);
        border-radius: 8px;
        overflow: hidden;
    }

    .preview-panel .document-items thead {
        display: none;
    }

    .preview-panel .document-items tbody tr {
        border-bottom: 1px solid var(--line);
        padding: 12px;
    }

    .preview-panel .document-items tbody tr:last-child {
        border-bottom: 0;
    }

    .preview-panel .document-items td {
        border: 0;
        padding: 4px 0;
        text-align: left;
    }

    .preview-panel .document-items td:first-child,
    .preview-panel .document-items td:last-child {
        text-align: left;
    }

    .preview-panel .document-items td:first-child::before {
        content: "Cant. ";
        color: var(--muted);
        font-weight: 900;
        text-transform: uppercase;
    }

    .preview-panel .document-items td:last-child::before {
        content: "Total ";
        color: var(--muted);
        font-weight: 900;
        text-transform: uppercase;
    }

    .preview-panel .document-items td:last-child {
        color: var(--blue-hover);
        font-weight: 900;
    }

    .preview-panel .document-items tfoot tr {
        display: grid;
        grid-template-columns: 1fr;
        background: var(--orange-soft);
        padding: 12px;
    }

    .preview-panel .document-items tfoot td {
        border: 0;
        padding: 2px 0;
    }

    .preview-panel .document-items tfoot td:first-child {
        display: none;
    }

    .preview-panel .amount-words,
    .preview-panel .payment-info {
        font-size: 13px;
        line-height: 1.5;
    }

    .preview-panel .document-signatures {
        margin-top: 42px;
    }

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

    .passkey-panel {
        grid-template-columns: 1fr;
    }

    .passkey-actions {
        justify-items: stretch;
        min-width: 0;
    }

    .passkey-item {
        align-items: stretch;
        flex-direction: column;
    }

    .passkey-item-actions {
        justify-content: flex-end;
    }

    td.actions {
        min-width: 140px;
    }
}

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

    .finance-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-finance-mini {
        grid-template-columns: 1fr;
    }

    .dashboard-finance-mini strong {
        font-size: 17px;
    }

    .domain-cost-grid {
        grid-template-columns: 1fr;
    }

    .import-summary {
        grid-template-columns: 1fr;
    }

    .task-summary {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        padding: 12px;
    }

    .payment-document {
        padding: 16px;
    }

    .document-header h2 {
        font-size: 22px;
    }

    .client-box {
        padding: 14px;
    }

    .paid-stamp {
        top: 112px;
        right: 18px;
        padding: 7px 12px;
        font-size: 20px;
    }

    .login {
        padding: 24px;
    }
}

.blog-form-grid textarea[name="content"] {
    min-height: 360px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    line-height: 1.65;
}

.blog-table-wrap table td:nth-child(2) {
    min-width: 280px;
}
