* { box-sizing: border-box; }
body.cl-shell { margin: 0; color: var(--ink); background: var(--surface); font: 400 1rem/1.55 var(--font-body); }
.cl-shell :is(h1,h2,h3,.cl-brand,.cl-stat) { font-family: var(--font-head); line-height: 1.18; }
.cl-shell h1 { margin: 0 0 1rem; font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.035em; }
.cl-shell h2 { font-size: 1.28rem; margin: 0 0 .8rem; }
.cl-shell a { color: var(--primary-strong); text-underline-offset: .22em; }
.cl-shell :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.cl-shell :disabled { opacity: .68; cursor: not-allowed; }
.cl-skip { position: absolute; top: .5rem; left: .5rem; z-index: 10; background: var(--surface-white); padding: .75rem; transform: translateY(-150%); }
.cl-skip:focus { transform: translateY(0); }
.cl-container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.cl-header { background: var(--surface-white); border-bottom: 1px solid var(--outline); }
.cl-header-inner { min-height: 4.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cl-brand { font-size: 1.5rem; color: var(--primary-strong); font-weight: 800; letter-spacing: -.04em; }
.cl-shell--admin .cl-header { border-top: .35rem solid var(--slate); }
.cl-admin-label { padding: .3rem .65rem; color: var(--surface-white); background: var(--slate); border-radius: var(--r-sm); }
.cl-layout { padding-block: clamp(1.5rem, 5vw, 3.5rem); display: grid; gap: clamp(1.25rem, 4vw, 3rem); }
.cl-layout > main { min-width: 0; }
.cl-shell--pay .cl-container { max-width: 44rem; }
.cl-nav { display: flex; gap: .5rem; flex-wrap: wrap; align-content: start; }
.cl-nav a { text-decoration: none; padding: .45rem .7rem; border-radius: var(--r-sm); }
.cl-nav a[aria-current] { background: var(--primary-soft); font-weight: 700; }
@media (min-width: 52rem) {
    :is(.cl-shell--panel,.cl-shell--admin) .cl-layout:has(.cl-nav) { grid-template-columns: minmax(10rem, 1fr) minmax(0, 4fr); }
    :is(.cl-shell--panel,.cl-shell--admin) .cl-nav { display: grid; }
}
.cl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.cl-stack { display: grid; gap: 1rem; }
.cl-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.cl-state-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.cl-state-picker a { border: 1px solid var(--outline); border-radius: var(--r-md); padding: .4rem .65rem; }
.cl-state-picker a[aria-current] { background: var(--primary-soft); font-weight: 700; }
.cl-card, .cl-chart, .cl-empty, .cl-toast, .cl-alert {
    margin: 0; background: var(--surface-white); padding: 1.2rem; border: 1px solid var(--outline); border-radius: var(--r-lg);
}
.cl-card { box-shadow: var(--shadow-editorial); }
.cl-card > :last-child { margin-bottom: 0; }
.cl-stat { margin: .4rem 0 0; font-weight: 800; font-size: 1.7rem; }
.cl-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-field { display: grid; gap: .35rem; }
.cl-field label { font-weight: 650; }
.cl-control { width: 100%; min-width: 0; border: 1px solid var(--ink-soft); border-radius: var(--r-md); padding: .55rem .7rem; color: var(--ink); background: var(--surface-white); font: inherit; }
.cl-control[aria-invalid] { border-color: var(--error); }
.cl-field small { color: var(--ink-muted); }
.cl-field-error { color: var(--error); margin: 0; }
.cl-checkbox { display: flex; gap: .6rem; align-items: center; }
.cl-checkbox input { accent-color: var(--primary); width: 1.15rem; height: 1.15rem; }
.cl-button { color: var(--surface-white); background: var(--primary); border: 1px solid var(--primary); border-radius: var(--r-md); padding: .55rem .85rem; min-height: 2.65rem; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.cl-button:hover { background: var(--primary-strong); }
.cl-button--secondary { background: var(--surface-white); color: var(--primary-strong); }
.cl-button--secondary:hover { background: var(--primary-tint); }
.cl-badge { display: inline-flex; align-items: center; border-radius: var(--r-md); padding: .2rem .55rem; font-weight: 650; }
.cl-badge--success { color: var(--success); background: var(--surface-white); border: 1px solid var(--success); }
.cl-badge--info { color: var(--info); background: var(--surface-mid); }
.cl-badge--error { color: var(--error); background: var(--primary-tint); }
.cl-badge--warning { color: var(--warning); background: var(--surface-low); }
.cl-badge--disputed { color: var(--surface-white); background: var(--primary-container); }
.cl-table-scroll { overflow-x: auto; }
.cl-table { width: 100%; border-collapse: collapse; }
.cl-table caption { text-align: start; font-weight: 700; margin-bottom: .4rem; }
.cl-table th, .cl-table td { text-align: start; padding: .55rem; border-bottom: 1px solid var(--hairline); }
.cl-table thead { background: var(--surface-low); }
.cl-timeline { margin: 0; padding-inline-start: 1.25rem; }
.cl-timeline li { margin-block: .5rem; }
.cl-timeline time { display: block; color: var(--ink-soft); }
.cl-chart figcaption { font-weight: 700; }
.cl-chart-item { display: grid; grid-template-columns: 1fr 2fr; gap: .5rem; }
.cl-chart-item dd { margin: 0; display: flex; align-items: center; gap: .5rem; }
.cl-chart meter { width: 75%; accent-color: var(--primary); }
.cl-dialog { width: min(29rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto; padding: 1.4rem; color: var(--ink); background: var(--surface-white); border: 1px solid var(--outline); border-radius: var(--r-xl); box-shadow: var(--shadow-float); }
.cl-dialog::backdrop { background: rgb(30 41 59 / 65%); }
.cl-dialog .cl-row { margin-top: 1rem; }
.cl-alert { border-inline-start-width: .35rem; }
.cl-alert--info { border-inline-start-color: var(--info); }
.cl-alert--warning { border-inline-start-color: var(--warning); }
.cl-alert--error { border-inline-start-color: var(--error); }
.cl-toast, .cl-alert--success { border-inline-start: .35rem solid var(--success); }
.cl-reference { overflow-wrap: anywhere; color: var(--ink-muted); }
.cl-skeleton { display: grid; gap: .75rem; }
.cl-skeleton span[aria-hidden] { height: .9rem; display: block; border-radius: var(--r-sm); background: var(--surface-high); }
.cl-skeleton span:last-child { width: 62%; }
.cl-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.cl-panel-status { display: none; }

/* Shared Crimson Ledger surfaces */
.cl-header { border: 0; }
.cl-brand { display: inline-flex; gap: .625rem; align-items: center; color: var(--on-surface); font-weight: 700; }
.cl-shell--admin .cl-header { border: 0; background: var(--admin-topbar); color: var(--inverse-on-surface); }
.cl-shell--admin .cl-header :is(a, .cl-brand) { color: var(--inverse-on-surface); }
.cl-admin-label { background: var(--inverse-surface); color: var(--inverse-on-surface); }
.cl-card, .cl-chart, .cl-empty, .cl-toast, .cl-alert { border: 0; box-shadow: none; }
.cl-card { padding: clamp(1rem, 3vw, 2rem); }
.cl-shell--identity { min-height: 100vh; background: linear-gradient(135deg, var(--surface), var(--surface-container-low)); }
.cl-shell--identity .cl-layout { width: min(100%, 38rem); }
.cl-identity-card > form, .cl-identity-card .cl-field { display: grid; gap: .65rem; }
.cl-identity-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.cl-shell--admin main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.cl-control {
    border: 1px solid var(--outline);
    border-radius: var(--r-md);
    background: var(--surface-container-low);
    color: var(--on-surface);
    padding: .7rem;
    font: inherit;
    min-height: 44px;
    max-width: 100%;
}
.cl-shell .cl-control:focus { background: var(--surface-container-highest); }
.cl-shell .cl-control[aria-invalid] { border-color: var(--error); }
.cl-shell :focus-visible { outline: 2px solid var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 40%, transparent); }
.cl-shell :is(.cl-button:not(.cl-button--secondary), button[type="submit"]:not([class]), .cl-identity-card button:not([type])) {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    border: 0;
    border-radius: var(--r-md);
    color: var(--on-primary);
    cursor: pointer;
    min-height: 44px;
    padding: .625rem 1rem;
    font: inherit;
    font-weight: 600;
}
.cl-button--secondary { color: var(--on-surface); background: var(--surface-container-high); border: 0; }
.cl-badge--success { color: var(--on-surface); background: var(--success-container); border: 0; }
.cl-badge--error, .cl-alert--error { color: var(--on-error-container); background: var(--error-container); }
.cl-dialog::backdrop { background: color-mix(in srgb, var(--inverse-surface) 65%, transparent); }
.cl-nav { background: var(--surface-container-low); padding: .5rem; border-radius: var(--r-lg); }
.cl-nav a { min-height: 44px; display: flex; align-items: center; gap: .55rem; color: var(--on-surface); }
.cl-nav a[aria-current] { color: var(--primary); background: var(--primary-fixed); }
.cl-nav svg { flex-shrink: 0; }
.cl-password-rules { padding-inline-start: 1.25rem; color: var(--on-surface-variant); }
.cl-password-rules [data-met="true"] { color: var(--success); font-weight: 600; }
.cl-table :is(th,td) { border: 0; }
.cl-table tbody tr:nth-child(odd) { background: var(--surface-container-low); }

@media (max-width: 51.99rem) {
    .cl-shell--panel .cl-layout:has(.cl-nav) { padding-bottom: 6rem; }
    .cl-shell--panel .cl-layout > .cl-nav {
        display: flex;
        flex-wrap: nowrap;
        position: fixed;
        inset: auto 0 0;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
        z-index: 5;
        padding: .35rem .25rem max(.35rem, env(safe-area-inset-bottom));
        gap: .125rem;
        box-shadow: var(--shadow-float);
        background: var(--surface-container-lowest);
    }
    .cl-shell--panel .cl-layout > .cl-nav a { flex: 1; justify-content: center; flex-direction: column; gap: .18rem; padding: .25rem; min-width: 0; text-align: center; font-size: .65rem; line-height: 1.25; }
    .cl-brand img { width: 28px; height: 28px; }
    .cl-table:has(td[data-label]) :is(tbody,tr) { display: grid; gap: .5rem; }
    .cl-table:has(td[data-label]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cl-table:has(td[data-label]) tbody tr { border-radius: var(--r-md); padding: .5rem; background: var(--surface-container-low); }
    .cl-table td[data-label] { display: flex; justify-content: space-between; gap: 1rem; overflow-wrap: anywhere; }
    .cl-table td[data-label]::before { content: attr(data-label); font-weight: 600; }
    .cl-table:has(td[data-label]) thead:has(:focus) { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}

.cl-identity-card { width: 100%; max-width: 32rem; margin-inline: auto; }
.cl-identity-card > form > p { margin-block: .15rem; }
.cl-identity-card label:not(:has(input[type="checkbox"], input[type="radio"])) { display: block; font-weight: 600; }
.cl-identity-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { display: block; width: 100%; margin-block: .2rem; }
.cl-identity-card .auth-row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; }
.cl-identity-card button[data-password-toggle] { color: var(--primary); border: 0; padding: .25rem 0; background: transparent; text-decoration: underline; }
.cl-shell .cl-stat { color: var(--on-surface); font-size: clamp(1.45rem, 3vw, 2.2rem); font-weight: 700; }
.cl-shell--panel main > :first-child > .cl-grid .cl-card:first-child,
.cl-shell--admin main > :first-child > .cl-grid .cl-card:first-child { background: var(--primary-fixed); }
.cl-checkout-amount { margin: 0; font: 700 clamp(1.8rem, 4vw, 2.8rem) / 1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.cl-chart meter::-webkit-meter-optimum-value { background: var(--primary); }
.cl-chart meter::-moz-meter-bar { background: var(--primary); }
.cl-shell pre { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 51.99rem) {
    .cl-shell main table:not(:has(thead)) :is(tbody,tr) { display: grid; gap: .5rem; }
    .cl-shell main table:not(:has(thead)) tr { background: var(--surface-container-low); border-radius: var(--r-md); padding: .65rem; }
    .cl-shell main table:not(:has(thead)) td { overflow-wrap: anywhere; }
}

.cl-badge { gap: .35rem; }

.cl-account-menu { position: relative; margin-inline-start: auto; max-width: min(46vw, 19rem); }
.cl-account-menu summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; }
.cl-account-menu summary span { min-width: 0; }
.cl-account-menu summary :is(strong,small) { display: block; overflow-wrap: anywhere; }
.cl-account-menu summary small { font-size: .7rem; }
.cl-account-actions { position: absolute; inset: 100% 0 auto auto; min-width: 12rem; max-width: 80vw; padding: .6rem; background: var(--surface-container-lowest); color: var(--on-surface); border-radius: var(--r-md); box-shadow: var(--shadow-float); z-index: 8; }
.cl-header .cl-account-actions a { color: var(--primary); }
.cl-account-actions :is(a,button) { display: flex; align-items: center; min-height: 44px; padding: .4rem .6rem; font: inherit; }
.cl-admin-menu-toggle { display: none; }
@media (max-width: 51.99rem) {
    .cl-shell--admin .cl-header-inner { gap: .45rem; }
    .cl-shell--admin .cl-account-menu { max-width: 31%; }
    .cl-shell--admin .cl-admin-menu-toggle { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; color: inherit; border: 0; background: transparent; font: inherit; cursor: pointer; }
    .cl-shell--admin .cl-layout > .cl-nav:not(.cl-nav--open) { display: none; }
    .cl-shell--admin .cl-layout > .cl-nav--open { display: grid; position: absolute; inset: 4.3rem auto auto 0; width: min(80vw, 19rem); max-height: 75vh; overflow-y: auto; background: var(--surface-container-lowest); box-shadow: var(--shadow-float); z-index: 7; }
}
.cl-metrics { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 1rem; }
.cl-metrics > .cl-card { padding: clamp(.7rem, 2vw, 1.35rem); min-width: 0; }
.cl-metrics > .cl-card:first-child { background: var(--primary-fixed); }
.cl-metrics dt { color: var(--on-surface-variant); font-size: .8rem; font-weight: 600; }
.cl-metric-value { margin: .35rem 0 0; font: 700 clamp(1.18rem, 2.6vw, 2rem)/1.2 var(--font-head); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cl-dashboard-grid { display: grid; gap: 1rem; margin-bottom: 1rem; align-items: start; }
.cl-volume p { margin: .3rem 0 1rem; color: var(--on-surface-variant); }
.cl-volume-plot { display: flex; align-items: end; gap: .18rem; height: 10rem; border-bottom: 1px solid var(--outline-variant); }
.cl-volume-plot meter { writing-mode: vertical-lr; direction: rtl; flex: 1; min-width: 0; height: 100%; appearance: none; }
.cl-volume-plot meter::-webkit-meter-bar { background: var(--surface-container-low); border: 0; }
.cl-volume-plot meter::-webkit-meter-optimum-value { background: var(--primary); }
.cl-volume-plot meter::-moz-meter-bar { background: var(--primary); }
.cl-volume-axis { display: flex; justify-content: space-between; font-size: .75rem; padding: .35rem 0; }
.cl-volume-data summary { cursor: pointer; padding: .5rem 0; }
.cl-volume-data dl > div, .cl-recent li { display: flex; justify-content: space-between; gap: .7rem; padding: .65rem 0; }
.cl-volume-data dd { margin: 0; }
.cl-recent ul { padding: 0; margin: 0; list-style: none; }
.cl-recent li + li { border-top: 1px solid var(--outline-variant); }
.cl-recent li > div { min-width: 0; overflow-wrap: anywhere; }
.cl-recent small { display: block; color: var(--on-surface-variant); margin-top: .15rem; }
.cl-recent li > strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 64rem) {
    .cl-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cl-dashboard-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
    .cl-dashboard-grid > :only-child { grid-column: 1 / -1; }
}
.cl-shell--identity .cl-layout { width: min(100%, 67rem); }
.cl-identity-grid { display: grid; gap: 1rem; }
.cl-identity-brand { display: none; }
@media (min-width: 52rem) {
    .cl-identity-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr); gap: 2rem; align-items: start; }
    .cl-identity-brand { display: grid; gap: 1.2rem; border-radius: var(--r-xl); padding: clamp(2rem, 5vw, 4rem); background: var(--inverse-surface); color: var(--inverse-on-surface); }
    .cl-identity-brand p { margin: 0; font: 700 1.05rem var(--font-head); }
    .cl-identity-brand strong { font: 700 clamp(1.8rem, 3vw, 3rem)/1.12 var(--font-head); }
}
.cl-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
.cl-dashboard-grid > * { min-width: 0; }
.cl-volume-plot meter { margin: 0; width: auto; }
.cl-pagination { padding: .75rem 0; }
.cl-pagination [aria-current] { border-radius: var(--r-md); background: var(--primary-fixed); padding: .3rem .6rem; font-weight: 700; }
@media (min-width: 64rem) { .cl-dashboard-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

.cl-table td small { display: block; }
.cl-copy { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.cl-copy code { font-variant-numeric: tabular-nums; }
.cl-payment-table th, .cl-payment-table td { overflow-wrap: anywhere; }
.cl-payment-table td[data-label="Tutar"] .cl-money { white-space: nowrap; }
.cl-dashboard-grid:has(.cl-payment-table) { grid-template-columns: minmax(0, 1fr); }

.cl-shell--admin-identity .cl-header { background: var(--admin-topbar); color: var(--inverse-on-surface); }
.cl-shell--admin-identity .cl-header .cl-brand { color: inherit; }
.cl-identity-grid--admin { grid-template-columns: minmax(0, 1fr); padding-block: clamp(1rem, 6vw, 4.5rem); }
.cl-identity-grid--login .cl-identity-brand { display: grid; gap: 1rem; }
.cl-login-features { display: grid; gap: .65rem; list-style: none; margin: 0; padding: 0; }
.cl-login-features li { border: 1px solid var(--outline-variant); padding: .8rem; border-radius: var(--r-md); }
.cl-login-warning { display: flex; align-items: flex-start; gap: .6rem; border-inline-start: .35rem solid var(--warning); }
.cl-login-warning svg { flex: none; }
.cl-login-alternative { text-align: center; }
.cl-login-alternative .cl-button { display: block; }
.cl-login-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1.25rem; margin-block: 1.5rem; }
@media (width < 52rem) {
    .cl-identity-grid--login .cl-identity-brand { padding: 1rem; border-radius: var(--r-lg); background: var(--surface-container-low); }
}
@media (min-width: 52rem) {
    .cl-identity-grid:not(.cl-identity-grid--admin) .cl-identity-card { grid-area: 1 / 2; }
    .cl-identity-grid .cl-identity-brand { grid-area: 1 / 1; }
}
