@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/tajawal-arabic-400.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/tajawal-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/tajawal-arabic-700.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/tajawal-latin-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/tajawal-arabic-800.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/tajawal-latin-800.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/assets/fonts/tajawal-arabic-900.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/assets/fonts/tajawal-latin-900.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
    color-scheme: light;
    --background: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --text: #15233d;
    --muted: #68758c;
    --border: #dce3ee;
    --primary: #1e4fa3;
    --primary-dark: #173f8f;
    --primary-soft: #e9f0ff;
    --success: #147454;
    --success-soft: #e9f8f2;
    --warning: #9a5b00;
    --warning-soft: #fff5df;
    --danger: #a4263c;
    --danger-soft: #fff0f3;
    --shadow-sm: 0 .25rem 1rem rgb(29 52 84 / 6%);
    --shadow-md: 0 .75rem 2.5rem rgb(29 52 84 / 10%);
    --radius-sm: .7rem;
    --radius-md: 1rem;
    --radius-lg: 1.35rem;
    font-family: 'Tajawal', Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 20rem;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
}

.container {
    width: min(100% - 2rem, 58rem);
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    inset-block-start: .5rem;
    inset-inline-start: .5rem;
    z-index: 100;
    padding: .6rem .9rem;
    border-radius: .5rem;
    color: #fff;
    background: #101828;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgb(255 255 255 / 14%);
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 .25rem 1.25rem rgb(18 50 105 / 16%);
}

.header-inner {
    display: flex;
    min-height: 4.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    gap: .7rem;
    color: inherit;
    text-decoration: none;
}

.brand-logo-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: .3rem .55rem;
    border-radius: .7rem;
    background: #fff;
    box-shadow: 0 .1rem .4rem rgb(0 0 0 / 12%);
}

.brand-logo {
    display: block;
    height: 1.9rem;
    width: auto;
}

.brand-copy {
    display: grid;
    line-height: 1.3;
}

.brand-copy small {
    color: rgb(255 255 255 / 72%);
    font-size: .72rem;
}

.user-chip {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: .45rem;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: opacity .15s ease;
}

.user-chip:hover,
.user-chip:focus-visible {
    opacity: .85;
}

.user-chip:focus-visible {
    outline: 3px solid rgb(255 255 255 / 45%);
    outline-offset: 2px;
}

.user-avatar {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 auto;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 50%;
    color: var(--primary-dark);
    background: #fff;
    font-weight: 800;
    place-items: center;
}

.user-avatar--photo {
    object-fit: cover;
}

.avatar-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.avatar-settings-preview {
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
}

.avatar-upload-form {
    display: grid;
    flex: 1 1 14rem;
    gap: .55rem;
}

.user-chip__name {
    display: none;
    font-size: .875rem;
    font-weight: 700;
}

.page-content {
    padding-block: 1.75rem calc(6.5rem + env(safe-area-inset-bottom));
}

.auth-page .page-content {
    padding-block-end: 2rem;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.eyebrow,
.card__eyebrow {
    margin: 0 0 .25rem;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
}

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

h1 {
    margin-bottom: .35rem;
    font-size: clamp(1.65rem, 7vw, 2.5rem);
    line-height: 1.25;
}

h2 {
    font-size: 1.05rem;
    line-height: 1.4;
}

.lead,
.muted-text {
    margin-bottom: 0;
    color: var(--muted);
}

.card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card--spaced {
    margin-top: 1rem;
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.card__header h2,
.card__body p {
    margin-bottom: 0;
}

.card__body {
    padding: 1.1rem 1.15rem;
}

.status-badge {
    display: inline-flex;
    min-height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    gap: .4rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
}

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

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

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

.status-badge--muted {
    color: var(--muted);
    background: var(--surface-soft, #f2f4f8);
}

/* شارة تعمل كزر: تعرض الحالة ويبدّلها الضغط عليها. */
.status-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.status-toggle__dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: currentColor;
}

.status-toggle--on {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 35%, transparent);
    background: var(--success-soft);
}

.status-toggle--off {
    color: var(--muted);
    border-color: var(--border);
    background: var(--surface-soft, #f2f4f8);
}

.status-toggle:hover,
.status-toggle:focus-visible {
    border-color: currentColor;
}

.status-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: currentColor;
}

.empty-state {
    display: grid;
    justify-items: center;
    padding: 2.25rem 1.25rem;
    text-align: center;
}

.empty-state__icon {
    display: grid;
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    border-radius: 1.15rem;
    color: var(--primary);
    background: var(--primary-soft);
    place-items: center;
}

.empty-state h2 {
    margin-bottom: .35rem;
}

.empty-state p {
    max-width: 27rem;
    margin-bottom: 0;
    color: var(--muted);
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 9rem);
    place-items: center;
}

.auth-card {
    width: min(100%, 28rem);
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.auth-logo {
    display: block;
    max-width: 15rem;
    width: 100%;
    height: auto;
    margin: 0 auto 1.4rem;
}

/* بلا شريط علوي: نمنح الصفحة تنفّساً من الأعلى بدل ارتفاع الشريط المحذوف. */
.auth-page .page-content {
    padding-top: 2rem;
}

.auth-page .auth-shell {
    min-height: calc(100vh - 6rem);
}

.auth-heading {
    margin-bottom: 1.4rem;
}

.auth-footnote {
    margin-top: 1.1rem;
    text-align: center;
    font-size: .85rem;
    color: var(--muted);
}

.auth-footnote__sep {
    margin: 0 .45rem;
    opacity: .5;
}

/* ---- هيدر منطقة المالك: خلفية داكنة تميّزه عن هيدر المشتركين الأزرق ---- */

.site-header--owner {
    background: linear-gradient(135deg, #1b2740, #2b3a55);
    border-bottom: 1px solid rgb(184 121 26 / 45%);
}

.owner-nav {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.owner-nav__link {
    padding: .42rem .7rem;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 999px;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    background: rgb(255 255 255 / 8%);
}

.owner-nav__link:hover,
.owner-nav__link:focus-visible {
    background: rgb(255 255 255 / 18%);
    border-color: rgb(255 255 255 / 40%);
}

@media (max-width: 30rem) {
    .owner-nav {
        gap: .35rem;
    }

    .owner-nav__link {
        padding: .35rem .55rem;
        font-size: .72rem;
    }
}

/* ---- لوحة المالك: هوية بصرية مميزة عمداً عن صفحة دخول المشتركين ---- */

.auth-card--owner {
    position: relative;
    border: 1px solid #2b3a55;
    border-top: 4px solid var(--owner-accent, #b8791a);
    background:
        linear-gradient(180deg, rgb(43 58 85 / 4%) 0, transparent 7rem),
        var(--surface);
    box-shadow: 0 1rem 2.75rem rgb(21 35 61 / 16%);
}

.auth-card--owner .auth-logo {
    margin-bottom: 1rem;
}

.owner-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: 0 auto 1.1rem;
    padding: .5rem .9rem;
    width: fit-content;
    border: 1px solid #d9c19a;
    border-radius: 999px;
    background: #fdf6e9;
    color: #7a4f05;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.owner-badge__icon {
    display: inline-flex;
    color: #b8791a;
}

.auth-heading--owner {
    text-align: center;
    padding-bottom: 1.1rem;
    border-bottom: 1px dashed var(--border);
}

.auth-heading--owner h1 {
    color: #22314c;
}

.button--owner {
    color: #fff;
    border-color: #2b3a55;
    background: linear-gradient(180deg, #34456280 0, transparent) #2b3a55;
}

.button--owner:hover,
.button--owner:focus-visible {
    background: #22314c;
    border-color: #22314c;
}

.table-scroll {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: .55rem .6rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    font-weight: 800;
    color: var(--muted);
}

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

.form-stack {
    display: grid;
    gap: 1rem;
}

.danger-zone {
    margin-top: 1rem;
    border: 1px solid color-mix(in srgb, var(--danger, #b42318) 38%, var(--border));
    border-radius: var(--radius-sm, .5rem);
}

.danger-zone summary {
    padding: .8rem 1rem;
    color: var(--danger, #b42318);
    font-weight: 800;
    cursor: pointer;
}

.danger-zone__content {
    padding: 0 1rem 1rem;
}

.field {
    display: grid;
    gap: .4rem;
    color: var(--text);
    font-size: .9rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    min-height: 3.15rem;
    width: 100%;
    padding: .72rem .85rem;
    border: 1px solid #c7d1e0;
    border-radius: var(--radius-sm);
    outline: none;
    background: #fff;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(30 79 163 / 14%);
}

.button {
    display: inline-flex;
    min-height: 3.15rem;
    align-items: center;
    justify-content: center;
    padding: .7rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease;
    touch-action: manipulation;
}

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

.button:focus-visible {
    outline: 3px solid rgb(30 79 163 / 22%);
    outline-offset: 2px;
}

.button--primary {
    color: #fff;
    background: var(--primary);
}

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

.button--secondary {
    border-color: #cbd9f2;
    color: var(--primary);
    background: var(--primary-soft);
}

.button--compact {
    min-height: 2.75rem;
    padding: .5rem .9rem;
    font-size: .88rem;
}

.button--danger {
    border-color: #efb8c2;
    color: #fff;
    background: var(--danger);
}

.page-heading--actions {
    align-items: center;
}

.back-link {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    margin-bottom: .4rem;
    color: var(--primary);
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
}

.search-panel {
    margin-bottom: 1rem;
    padding: 1rem;
}

.search-form {
    display: grid;
    gap: .8rem;
}

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

.check-field {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
    min-height: 2.75rem;
}

.check-field input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--primary);
}

.search-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.transaction-form {
    display: grid;
    gap: 1rem;
}

.type-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.type-fieldset legend {
    margin-bottom: .5rem;
    font-size: .9rem;
    font-weight: 700;
}

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

.type-option {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-option span {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 4.5rem;
    padding: .7rem;
    border: 1px solid #c7d1e0;
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.type-option__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
}

.type-option__text {
    display: grid;
    min-width: 0;
}

.type-option small {
    overflow: hidden;
    color: var(--muted);
    font-size: .65rem;
    text-overflow: ellipsis;
}

.type-option input:checked + span {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-soft);
    box-shadow: 0 0 0 2px rgb(30 79 163 / 10%);
}

.type-option input:focus-visible + span {
    outline: 3px solid rgb(30 79 163 / 22%);
    outline-offset: 2px;
}

.type-option--receivable .type-option__icon {
    color: var(--success);
    background: var(--success-soft);
}

.type-option--payable .type-option__icon {
    color: var(--danger);
    background: var(--danger-soft);
}

.type-option--receivable input:checked + span {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-soft);
    box-shadow: 0 0 0 2px rgb(20 116 84 / 12%);
}

.type-option--payable input:checked + span {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-soft);
    box-shadow: 0 0 0 2px rgb(164 38 60 / 12%);
}

.amount-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(6.5rem, .55fr);
}

.sticky-form-action {
    position: sticky;
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
    z-index: 20;
    padding: .55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgb(255 255 255 / 94%);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.review-summary {
    margin-bottom: 1rem;
}

.review-person {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.review-person div {
    display: grid;
}

.review-person small,
.movement-details dt,
.balance-state small,
.receipt-amount small,
.current-balance-card small {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
}

.movement-details {
    margin: 0;
}

.movement-details > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1.15rem;
}

.movement-details > div + div {
    border-top: 1px solid var(--border);
}

.movement-details dd {
    margin: 0;
    font-weight: 700;
    text-align: end;
    overflow-wrap: anywhere;
}

.movement-details dd small {
    color: var(--muted);
}

.balance-preview {
    display: grid;
    align-items: center;
    gap: .55rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.balance-state {
    display: grid;
    min-width: 0;
    min-height: 8.5rem;
    align-content: center;
    justify-items: center;
    padding: .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.balance-state strong {
    max-width: 100%;
    margin-block: .15rem;
    overflow: hidden;
    font-size: clamp(1rem, 5vw, 1.35rem);
    text-overflow: ellipsis;
}

.balance-state > span {
    font-size: .8rem;
    font-weight: 800;
}

.balance-state--ours > span {
    color: var(--success);
}

.balance-state--theirs > span {
    color: var(--danger);
}

.balance-state--settled > span {
    color: var(--muted);
}

.balance-arrow {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
}

.review-actions {
    display: grid;
    gap: .65rem;
    margin-top: 1rem;
}

.receipt-amount {
    display: grid;
    justify-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--primary-soft);
}

.receipt-amount strong {
    margin-block: .2rem;
    color: var(--primary-dark);
    font-size: clamp(1.6rem, 8vw, 2.35rem);
}

.receipt-amount span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
}

.current-balance-card {
    display: grid;
    justify-items: center;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.current-balance-card strong {
    font-size: 1.35rem;
}

.current-balance-card span {
    color: var(--primary);
    font-size: .85rem;
    font-weight: 800;
}

.account-section {
    margin-top: 1.25rem;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .55rem;
    padding-inline: .15rem;
}

.section-heading h2,
.section-heading p {
    margin-bottom: 0;
}

.muted-label {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}

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

.account-balance-summary {
    display: grid;
    min-width: 0;
    align-content: start;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.account-balance-summary h3 {
    margin: 0;
    padding: .8rem .65rem;
    font-size: 1.25rem;
    text-align: center;
}

.account-balance-summary--ours {
    border-top: .3rem solid var(--success);
}

.account-balance-summary--ours h3,
.account-balance-summary--ours .account-balance-summary__amounts strong {
    color: var(--success);
}

.account-balance-summary--ours h3 {
    background: var(--success-soft);
}

.account-balance-summary--theirs {
    border-top: .3rem solid var(--danger);
}

.account-balance-summary--theirs h3,
.account-balance-summary--theirs .account-balance-summary__amounts strong {
    color: var(--danger);
}

.account-balance-summary--theirs h3 {
    background: var(--danger-soft);
}

.account-balance-summary__amounts {
    display: grid;
    min-width: 0;
    gap: .1rem;
    padding: .7rem .65rem .85rem;
    text-align: center;
}

.account-balance-summary__amounts strong {
    overflow: hidden;
    padding: .45rem .15rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-balance-summary__amounts strong:last-child {
    border-bottom: 0;
}

.account-balance-summary__empty {
    padding: .65rem 0;
    color: var(--muted);
    font-size: .78rem;
}

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

.compact-empty p {
    margin-bottom: 0;
    color: var(--muted);
}

.recent-transactions {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.transaction-row {
    display: grid;
    min-width: 0;
    align-items: center;
    gap: .65rem;
    padding: .85rem 1rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    text-decoration: none;
}

.transaction-row + .transaction-row {
    border-top: 1px solid var(--border);
}

.transaction-row:hover {
    background: var(--surface-soft);
}

.transaction-type-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: var(--muted);
}

.transaction-type-dot--receivable,
.transaction-type-dot--paid {
    background: var(--success);
}

.transaction-type-dot--payable,
.transaction-type-dot--received {
    background: var(--danger);
}

.transaction-row__content,
.transaction-row__amount {
    display: grid;
    min-width: 0;
}

.transaction-row__content strong,
.transaction-row__content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-row__content small,
.transaction-row__amount small {
    color: var(--muted);
    font-size: .7rem;
}

.transaction-row__amount {
    justify-items: end;
    font-weight: 800;
}

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

.account-tools .button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.account-tools--matching .button--group-share {
    grid-column: 1 / -1;
}

.button--whatsapp {
    border-color: #168a4a;
    color: #fff;
    background: #168a4a;
}

.button--whatsapp:hover {
    border-color: #11753e;
    color: #fff;
    background: #11753e;
}

.operations-list {
    display: grid;
    gap: .7rem;
}

.operation-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-inline-start: .25rem solid var(--muted);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.operation-card--positive {
    border-inline-start-color: var(--success);
}

.operation-card--negative {
    border-inline-start-color: var(--danger);
}

.operation-card:hover {
    border-color: #c2d0e5;
    background: var(--surface-soft);
}

.operation-card__identity,
.operation-card__meta {
    display: grid;
    min-width: 0;
    gap: .25rem;
}

.operation-card__identity strong,
.operation-card__signed-amount,
.operation-card__meta small,
.operation-card__meta time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operation-card__signed-amount {
    font-size: 1.05rem;
    font-weight: 900;
}

.operation-card--positive .operation-card__signed-amount {
    color: var(--success);
}

.operation-card--negative .operation-card__signed-amount {
    color: var(--danger);
}

.operation-card__meta {
    flex: 0 0 auto;
    justify-items: end;
    text-align: end;
}

.operation-card__meta small {
    color: #8d98a8;
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .03em;
}

.operation-card__meta time {
    color: var(--muted);
    font-size: .72rem;
}

.filters-panel {
    margin-bottom: 1rem;
}

.filters-panel summary {
    display: flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    color: var(--primary-dark);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

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

.filters-panel[open] summary {
    border-bottom: 1px solid var(--border);
}

.active-filter-dot {
    padding: .2rem .55rem;
    border-radius: 999px;
    color: var(--success);
    background: var(--success-soft);
    font-size: .7rem;
}

.filters-form {
    display: grid;
    gap: .8rem;
    padding: 1rem;
}

.filter-actions {
    display: flex;
    align-items: end;
    gap: .6rem;
}

.rate-form {
    display: grid;
    gap: .8rem;
}

.rate-cards {
    display: grid;
    gap: .65rem;
}

.rate-card {
    display: grid;
    align-items: center;
    gap: .3rem 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    grid-template-columns: minmax(0, 1fr) auto;
    box-shadow: var(--shadow-sm);
}

.rate-card > div {
    display: grid;
}

.rate-card > div:nth-child(2) {
    justify-items: end;
}

.rate-card small,
.rate-card time,
.rate-history time {
    color: var(--muted);
    font-size: .7rem;
}

.rate-card time {
    grid-column: 1 / -1;
}

.rate-history {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.rate-history > div {
    display: grid;
    gap: .7rem;
    padding: .75rem 1rem;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
}

.rate-history > div + div {
    border-top: 1px solid var(--border);
}

.valuation-card {
    display: grid;
    gap: .8rem;
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid #b9dfd1;
    border-radius: var(--radius-md);
    background: var(--success-soft);
}

.valuation-card > div {
    display: grid;
}

.valuation-card small,
.valuation-card span {
    color: var(--muted);
    font-size: .75rem;
}

.valuation-card > div > strong {
    color: var(--success);
    font-size: 1.35rem;
}

.valuation-card--incomplete {
    border-color: #edd49b;
    background: var(--warning-soft);
}

.valuation-card--incomplete > div > strong {
    color: var(--warning);
}

.valuation-card details {
    border-top: 1px solid rgb(0 0 0 / 8%);
    padding-top: .6rem;
}

.valuation-card summary {
    color: var(--primary-dark);
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
}

.valuation-card ul {
    display: grid;
    gap: .35rem;
    margin: .6rem 0;
    padding: 0;
    list-style: none;
}

.valuation-card li {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    font-size: .75rem;
}

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

.dashboard-stat {
    display: grid;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

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

.dashboard-stat small,
.dashboard-stat span {
    color: var(--muted);
    font-size: .72rem;
}

.dashboard-stat strong {
    color: var(--primary-dark);
    font-size: 1.75rem;
}

.dashboard-currency-list {
    display: grid;
    gap: .65rem;
    padding: 1rem 1.15rem;
}

.dashboard-currency-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-balance--ours {
    border-top: .25rem solid var(--success);
}

.dashboard-balance--theirs {
    border-top: .25rem solid var(--danger);
}

.dashboard-valuation {
    display: grid;
    justify-items: center;
    margin-bottom: 1rem;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    text-align: center;
    box-shadow: var(--shadow-md);
}

.dashboard-valuation small,
.dashboard-valuation span {
    color: rgb(255 255 255 / 78%);
}

.dashboard-valuation strong {
    font-size: clamp(1.5rem, 8vw, 2.35rem);
}

.dashboard-valuation a {
    margin-top: .4rem;
    font-size: .8rem;
    font-weight: 800;
}

.dashboard-valuation--incomplete {
    background: linear-gradient(135deg, #7c4a00, var(--warning));
}

.dashboard-people {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.dashboard-people a {
    display: grid;
    align-items: center;
    gap: .15rem .7rem;
    padding: .75rem 1rem;
    grid-template-columns: auto minmax(0, 1fr);
    text-decoration: none;
}

.dashboard-people a + a {
    border-top: 1px solid var(--border);
}

.dashboard-people .person-avatar {
    grid-row: 1 / span 2;
}

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

.statement-period {
    display: grid;
    align-items: end;
    gap: .8rem;
    padding: 1rem;
}

.statement-summaries {
    display: grid;
    gap: .7rem;
}

.statement-summary {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.statement-summary header {
    display: flex;
    justify-content: space-between;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.statement-summary header span,
.statement-summary dt,
.statement-summary details span {
    color: var(--muted);
    font-size: .75rem;
}

.statement-summary dl {
    margin: 0;
}

.statement-summary dl > div,
.statement-summary details > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem 1rem;
}

.statement-summary dd { margin: 0; font-weight: 700; }
.statement-summary details { border-top: 1px solid var(--border); padding: .6rem 0; }
.statement-summary summary { padding-inline: 1rem; font-size: .78rem; font-weight: 800; cursor: pointer; }

.statement-transactions {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.statement-transactions a {
    display: grid;
    align-items: center;
    gap: .65rem;
    padding: .75rem 1rem;
    grid-template-columns: auto minmax(0,1fr) auto;
    text-decoration: none;
}

.statement-transactions a + a { border-top: 1px solid var(--border); }
.statement-transactions time,.statement-transactions small { color: var(--muted); font-size: .7rem; }
.statement-transactions span,.statement-transactions b { display:grid; }
.statement-transactions b { justify-items:end; }

.results-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem .15rem .55rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.person-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.person-row {
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-items: stretch;
    gap: .85rem;
    padding: 1rem;
    text-decoration: none;
}

.person-row + .person-row {
    border-top: 1px solid var(--border);
}

.person-row:hover {
    background: var(--surface-soft);
}

.person-row--archived {
    background: #fbfaf8;
}

.person-row__header {
    display: grid;
    min-width: 0;
    align-items: center;
    gap: .75rem;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.person-avatar {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 1rem;
    font-weight: 800;
    place-items: center;
}

.person-avatar--large {
    width: 4.25rem;
    height: 4.25rem;
    font-size: 1.5rem;
}

.person-row__content {
    display: grid;
    min-width: 0;
}

.person-row__content strong,
.person-row__content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.person-row__balances {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: .8rem;
    background: var(--surface-soft);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.person-balance-group {
    display: grid;
    min-width: 0;
    gap: .4rem;
    padding: .75rem;
}

.person-balance-group + .person-balance-group {
    border-inline-start: 1px solid var(--border);
}

.person-balance-group__label {
    font-size: .72rem;
    font-weight: 900;
}

.person-balance-group--ours .person-balance-group__label,
.person-balance-group--ours .person-balance-group__values strong {
    color: var(--success);
}

.person-balance-group--theirs .person-balance-group__label,
.person-balance-group--theirs .person-balance-group__values strong {
    color: var(--danger);
}

.person-balance-group__values {
    display: grid;
    min-width: 0;
    gap: .22rem;
}

.person-balance-group__values > small {
    color: var(--muted);
}

.person-balance-group__values strong {
    overflow: hidden;
    font-size: .88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-balance-group__values strong small {
    color: currentColor;
    font-size: .65rem;
    opacity: .72;
}

.person-row__valuation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .7rem;
    border-radius: .65rem;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: .76rem;
}

.person-row__valuation strong {
    text-align: end;
}

.person-row__valuation--incomplete {
    color: #8a5a00;
    background: #fff5d9;
}

.person-row__valuation--positive {
    color: var(--success);
    background: var(--success-soft);
}

.person-row__valuation--negative {
    color: var(--danger);
    background: var(--danger-soft);
}

.person-row__settled {
    padding: .65rem;
    border-radius: .65rem;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: .8rem;
    text-align: center;
}

.row-arrow {
    color: var(--muted);
    font-size: 1.4rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    margin-top: 1rem;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
}

.empty-action {
    padding: 0 1.25rem 1.5rem;
    text-align: center;
}

.form-card {
    padding: 1.15rem;
}

.field textarea {
    min-height: 7rem;
    resize: vertical;
}

.field [aria-invalid="true"] {
    border-color: var(--danger);
}

.field-error,
.required-mark {
    color: var(--danger);
}

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

.field input:disabled {
    background: var(--surface-soft);
    color: var(--muted);
    cursor: not-allowed;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-inline-end: 2.75rem;
}

.password-toggle {
    position: absolute;
    inset-inline-end: .35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle[aria-pressed="true"] {
    color: var(--primary);
}

.password-toggle:focus-visible {
    outline: 3px solid rgb(30 79 163 / 22%);
    outline-offset: 1px;
}

.detail-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem;
    border-bottom: 1px solid var(--border);
}

.detail-hero h2 {
    margin-bottom: .35rem;
    font-size: 1.2rem;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    gap: .2rem;
    padding: .9rem 1.15rem;
}

.detail-list > div + div {
    border-top: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.preserve-lines {
    white-space: pre-wrap;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid #efc6ce;
    border-radius: var(--radius-md);
    background: var(--danger-soft);
}

.test-reset-zone {
    display: grid;
    align-items: stretch;
    gap: 1rem;
}

.test-reset-zone > div p:last-child {
    margin-bottom: 0;
}

.test-reset-zone__error {
    padding: .75rem;
    border-radius: .65rem;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: .85rem;
    font-weight: 800;
}

.danger-zone h2 {
    margin-bottom: .2rem;
    color: var(--danger);
}

.danger-zone p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .85rem;
}

.button--full {
    width: 100%;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: 1rem;
    padding: .8rem .9rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}

.alert__icon {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 800;
    place-items: center;
}

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

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

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

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

.account-actions {
    margin-top: 1rem;
}

.bottom-navigation {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    border-top: 1px solid var(--border);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -.5rem 1.75rem rgb(25 45 75 / 9%);
    backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-navigation__inner {
    display: grid;
    width: min(100%, 38rem);
    min-height: 4.65rem;
    margin-inline: auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.nav-item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 4.5rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem .2rem;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.nav-item.is-active {
    color: var(--primary);
}

.nav-item.is-active::before {
    position: absolute;
    top: 0;
    width: 1.8rem;
    height: .2rem;
    border-radius: 0 0 .2rem .2rem;
    background: var(--primary);
    content: '';
}

.nav-item.is-disabled {
    opacity: .45;
}

.nav-item--action .nav-item__icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    margin-top: -.75rem;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 .4rem 1rem rgb(30 79 163 / 28%);
    place-items: center;
}

.nav-item--action .nav-item__label {
    margin-top: -.05rem;
}

@media (min-width: 40rem) {
    .user-chip__name {
        display: inline;
    }

    .auth-card {
        padding: 2rem;
    }

    .search-form {
        align-items: end;
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .form-card {
        padding: 1.5rem;
    }

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

    .person-balance-card {
        align-items: stretch;
        flex-direction: column;
    }

    .balance-value {
        justify-items: start;
        text-align: start;
    }

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

    .rate-form {
        align-items: end;
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    }

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

    .statement-period { grid-template-columns: repeat(2,minmax(0,1fr)) auto; }
    .statement-summaries { grid-template-columns: repeat(3,minmax(0,1fr)); }

    .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 30rem) {
    .page-heading--actions,
    .danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading--actions > .button,
    .danger-zone .button {
        width: 100%;
    }

    .page-heading--actions .heading-actions {
        display: grid;
        width: 100%;
    }

    .person-row .status-badge {
        display: none;
    }
}

@media (max-width: 40rem) {
    .sticky-form-action { position: static; }
}

@media (min-width: 60rem) {
    .page-content {
        padding-block-start: 2.5rem;
    }

    .bottom-navigation {
        right: auto;
        left: 50%;
        width: min(100% - 2rem, 40rem);
        border: 1px solid var(--border);
        border-bottom: 0;
        border-radius: 1rem 1rem 0 0;
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

.more-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.more-card { display: grid; gap: .3rem; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.more-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.more-card strong { color: var(--primary); font-size: 1.05rem; }
.more-card span { color: var(--muted); font-size: .9rem; }
.confirmation-list, .report-list { display: grid; gap: .75rem; }
.report-list .transaction-row { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.backup-row-actions { display: flex; gap: .5rem; }
.dashboard-summary-grid { display: grid; gap: .75rem; margin-block: 1rem 1.5rem; }
.metric-card { display: grid; gap: .35rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card > small, .metric-card > span { color: var(--muted); }
.metric-card > strong { color: var(--primary-dark); font-size: 1.15rem; }
.metric-card--positive { border-top: .25rem solid var(--success); }
.metric-card--negative { border-top: .25rem solid var(--danger); }
.section-heading > a { display: inline-flex; min-height: 2.75rem; align-items: center; }
.status-badge--pending { color: var(--warning); background: var(--warning-soft); }
.status-badge--matched { color: var(--success); background: var(--success-soft); }
.status-badge--difference { color: var(--danger); background: var(--danger-soft); }
.report-footer { margin-top: 1rem; color: var(--muted); font-size: .85rem; text-align: center; white-space: pre-line; }
form[aria-busy="true"] { opacity: .72; pointer-events: none; }
.is-offline::before { position: fixed; inset-inline: 0; top: 0; z-index: 100; padding: .35rem 1rem; color: #fff; background: var(--danger); content: 'لا يوجد اتصال — العمليات المالية متوقفة'; font-size: .78rem; font-weight: 800; text-align: center; }
.is-offline .site-header { top: 2rem; }
@media (min-width: 40rem) { .dashboard-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
.confirmation-card { display: grid; gap: .75rem; }
.inline-update-form { display: grid; grid-template-columns: minmax(9rem, .7fr) minmax(12rem, 1.5fr) auto; gap: .6rem; }
.compact-mode .transaction-row { padding-block: .55rem; }
.compact-mode .card { padding: .85rem; }
@media (max-width: 42rem) { .inline-update-form { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- التسجيل الذاتي */

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

.form-section {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.form-section + .form-section {
    padding-top: 1.1rem;
    border-top: 1px dashed var(--border);
}

.form-section legend {
    margin-bottom: .6rem;
    padding: 0;
    color: var(--primary-dark);
    font-size: .95rem;
    font-weight: 800;
}

.field small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.6;
}

.field small.field-error {
    color: var(--danger);
    font-weight: 700;
}

.field-optional {
    margin-inline-start: .3rem;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 400;
}

.required-mark {
    font-weight: 800;
}

/* مخفي عن البشر لكن يبقى ضمن النموذج فتملؤه الروبوتات. */
.hp-field {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.button--large {
    min-height: 3.5rem;
    font-size: 1.05rem;
}

.form-hint {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.7;
    text-align: center;
}

.auth-signup-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .9rem;
}

.auth-signup-cta .button {
    min-height: 2.6rem;
    padding: .45rem 1rem;
}

/* ------------------------------------------------------------ شريط التجربة */

.trial-banner {
    --tone: var(--warning);
    --tone-soft: var(--warning-soft);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .55rem .7rem;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--tone);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.trial-banner--expired { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.trial-banner--welcome { --tone: var(--success); --tone-soft: var(--success-soft); }

.trial-banner__icon {
    display: grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: var(--tone-soft);
    color: var(--tone);
}

.trial-banner__text {
    margin: 0;
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.75;
    color: var(--muted);
}

.trial-banner__text strong {
    display: block;
    color: var(--text);
    font-size: .95rem;
    font-weight: 800;
}

.trial-banner__action {
    display: inline-flex;
    grid-column: 2;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    justify-self: start;
    min-height: 2.25rem;
    padding: .35rem .9rem;
    border: 1px solid color-mix(in srgb, var(--tone) 45%, #fff);
    border-radius: 999px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: .85rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease;
}

.trial-banner__action:hover {
    border-color: var(--tone);
    background: color-mix(in srgb, var(--tone) 12%, #fff);
}

@media (min-width: 46rem) {
    .trial-banner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .trial-banner__action { grid-column: 3; }
}

/* ------------------------------------------------ لوحة المالك: الملاحظات */

.owner-nav__badge {
    display: inline-grid;
    min-width: 1.3rem;
    height: 1.3rem;
    margin-inline-start: .2rem;
    padding: 0 .3rem;
    place-items: center;
    border-radius: 999px;
    background: #f59e0b;
    color: #1b1300;
    font-size: .72rem;
    font-weight: 900;
}

.feedback-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.feedback-tab {
    padding: .45rem .9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
}

.feedback-tab span {
    margin-inline-start: .25rem;
    color: var(--text);
}

.feedback-tab.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.feedback-item {
    margin-bottom: .8rem;
}

.feedback-item--new {
    border-inline-start: 4px solid #f59e0b;
}

.feedback-item__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.feedback-item__message {
    margin: .8rem 0;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    line-height: 1.9;
    white-space: normal;
    overflow-wrap: anywhere;
}

.feedback-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.developer-photo-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.developer-photo-preview {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-soft);
}

.developer-photo-preview--empty {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1.8rem;
    font-weight: 900;
}

/* ------------------------------------------------ شريط أسعار اليوم (الرئيسية) */










/* ------------------------------------------------ مصدر السعر في صفحة الأسعار */

.rate-source {
    justify-self: start;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
}

.rate-source--platform {
    background: var(--success-soft);
    color: var(--success);
}

.rate-source--own {
    background: var(--warning-soft);
    color: var(--warning);
}

/* ---------------------------------------------------- لوحة المالك: الأسعار */

.owner-rates {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.owner-rate__value {
    display: grid;
    gap: .15rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-align: center;
}

.owner-rate__value strong {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
}

.owner-rate__value span {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
}

.owner-rate__form {
    display: grid;
    gap: .7rem;
}

@media (min-width: 48rem) {
    .owner-rates {
        grid-template-columns: 1fr 1fr;
    }
}

.owner-rate__settings summary {
    color: var(--primary);
    font-size: .88rem;
    font-weight: 800;
    cursor: pointer;
}

.owner-rate__settings[open] summary {
    margin-bottom: .8rem;
}

.register-consent {
    margin: .75rem 0 0;
    color: var(--muted, #64748b);
    font-size: .82rem;
    text-align: center;
}

/* ------------------------------------------------------------ التقارير (للجوال أولاً) */
.rp-chips {
    display: flex;
    gap: .45rem;
    margin: 0 0 .6rem;
    padding-bottom: .15rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.rp-chips::-webkit-scrollbar { display: none; }
.rp-chips--small { margin-bottom: 1.1rem; }
.rp-chip {
    flex: none;
    padding: .5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: .92rem;
    text-decoration: none;
    white-space: nowrap;
}
.rp-chips--small .rp-chip { padding: .35rem .85rem; font-size: .85rem; }
.rp-chip.is-active { border-color: var(--primary); background: var(--primary); color: #fff; }
.rp-group { margin-bottom: 1.2rem; }
.rp-group__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .55rem;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
}
.rp-group__title span {
    padding: .05rem .55rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .8rem;
}
.rp-group__title--ours::before, .rp-group__title--theirs::before {
    content: "";
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: var(--success);
}
.rp-group__title--theirs::before { background: var(--danger); }
.rp-list { display: grid; }
.rp-row {
    display: grid;
    grid-template-columns: 2.3rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .75rem .9rem;
    color: inherit;
    text-decoration: none;
}
.rp-row + .rp-row { border-top: 1px solid var(--border); }
.rp-row:active { background: var(--surface-soft); }
.rp-row__avatar {
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
}
.rp-row__name {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rp-row__name small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.rp-row__amounts {
    display: grid;
    justify-items: end;
    gap: .1rem;
    color: var(--muted);
    font-weight: 800;
    font-size: .95rem;
    white-space: nowrap;
}
.rp-row__amounts--ours { color: var(--success); }
.rp-row__amounts--theirs { color: var(--danger); }
.rp-empty { margin: 0; color: var(--muted); font-size: .92rem; }
.rp-settled > summary { cursor: pointer; list-style: none; }
.rp-settled > summary::-webkit-details-marker { display: none; }
.rp-settled > summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.rp-settled[open] > summary::after { content: "▴"; }
.rp-period { padding: 1rem; }
.rp-period h2 { margin: 0 0 .7rem; font-size: 1rem; font-weight: 800; }
.rp-period form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}
.rp-period label { display: grid; gap: .25rem; min-width: 0; color: var(--muted); font-size: .85rem; }
.rp-period input {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    color: var(--text);
}
.rp-period .button { grid-column: 1 / -1; }

/* أسعار الدولار في الهيدر: سطر واحد مضغوط بين اللوغو ودائرة الحساب */
.header-rates {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    gap: .4rem;
    color: #fff;
    text-decoration: none;
}
.header-rates__item {
    display: grid;
    justify-items: center;
    min-width: 0;
    padding: .25rem .6rem;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: .65rem;
    background: rgb(255 255 255 / 10%);
    line-height: 1.2;
    white-space: nowrap;
}
.header-rates__item small { color: rgb(255 255 255 / 68%); font-size: .62rem; }
.header-rates__item strong { font-size: .86rem; font-weight: 800; }
.header-rates__item--own { border-color: rgb(253 224 71 / 60%); }
.header-rates__item--own small { color: #fde047; }
.header-rates:hover .header-rates__item { background: rgb(255 255 255 / 16%); }
@media (max-width: 22rem) {
    .header-rates__item { padding-inline: .4rem; }
    .header-rates__item strong { font-size: .78rem; }
}

/* ------------------------------------------------------------ الإعدادات */
.st-title {
    margin: 1.4rem 0 .55rem;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 800;
}
.st-title:first-of-type { margin-top: .4rem; }
.st-card { padding: 0; }
.st-card--padded { padding: 1rem; }
.st-profile {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem;
}
.st-profile__avatar { display: grid; place-items: center; flex: none; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 1.4rem; font-weight: 800; object-fit: cover; }
.st-profile__actions { display: grid; gap: .45rem; min-width: 0; }
.st-profile__actions strong { overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: end; }
.st-inline { display: flex; flex-wrap: wrap; gap: .45rem; }
.st-inline form { margin: 0; }
.st-file { position: relative; overflow: hidden; cursor: pointer; }
.st-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.button--ghost-danger { border: 1px solid transparent; background: transparent; color: var(--danger); }
.button--ghost-danger:hover { background: var(--danger-soft); }
.st-row { border-top: 1px solid var(--border); }
.st-row > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-height: 3.4rem;
    padding: .7rem 1rem;
    cursor: pointer;
    list-style: none;
}
.st-row > summary::-webkit-details-marker { display: none; }
.st-row > summary span { color: var(--muted); font-size: .9rem; }
.st-row > summary strong { overflow: hidden; text-align: end; text-overflow: ellipsis; white-space: nowrap; }
.st-row > summary em { color: var(--primary); font-size: .88rem; font-style: normal; font-weight: 800; }
.st-row[open] > summary em { visibility: hidden; }
.st-row__form { padding: 0 1rem 1rem; }
.st-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}
.st-switch > span { display: grid; gap: .15rem; }
.st-switch small { color: var(--muted); font-size: .82rem; }
.st-switch input {
    appearance: none;
    position: relative;
    flex: none;
    width: 2.9rem;
    height: 1.7rem;
    margin: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
    transition: background-color .2s ease;
}
.st-switch input::after {
    content: "";
    position: absolute;
    top: .2rem;
    right: .2rem;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
    transition: right .2s ease;
}
.st-switch input:checked { background: var(--primary); }
.st-switch input:checked::after { right: 1.4rem; }
.st-switch input:focus-visible { outline: 3px solid rgb(30 79 163 / 25%); outline-offset: 2px; }
.st-save { width: 100%; margin-top: 1rem; }
.st-danger { display: block; margin-top: 2rem; padding: 0; }
.st-danger > summary { padding: .9rem 1rem; color: var(--danger); font-weight: 800; cursor: pointer; }
.st-danger > p, .st-danger > form, .st-danger > .test-reset-zone__error { margin: 0 1rem 1rem; }
