/* Shared action and form tokens. Loaded last so page-specific legacy rules cannot drift. */
.order-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.order-identity > span { white-space: nowrap; }
.order-identity-time { display: inline-flex; align-items: center; gap: 12px; unicode-bidi: isolate; }
.notification-connections { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.notification-connections > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.notification-connections p { font-size: .85rem; margin: 5px 0; color: var(--muted); }
.notification-guide { background: #fff9eb; border: 1px solid #f5dfad; padding: 12px 16px; border-radius: 12px; }
.notification-guide summary { cursor: pointer; font-weight: 600; }
.notification-guide p { font-size: .85rem; margin: 10px 0 0; line-height: 1.9; }
.notification-table { min-width: 850px; table-layout: fixed; }
.notification-table th:nth-child(1) { width: 17%; }
.notification-table th:nth-child(2) { width: 25%; }
.notification-table th:nth-child(3) { width: 16%; }
.notification-table th:nth-child(4) { width: 28%; }
.notification-table th:nth-child(5) { width: 14%; }
.notification-table td { padding-block: 14px; }
.notification-table .btn { width: 100%; }
.notification-recipient,.notification-error p { overflow-wrap: anywhere; unicode-bidi: plaintext; }
.notification-date { display: flex; gap: 10px; font-size: .78rem; margin-top: 6px; white-space: nowrap; }
.notification-state p { margin: 6px 0; line-height: 1.8; }
.notification-error summary { cursor: pointer; font-size: .8rem; }
@media(max-width:700px) { .notification-connections { grid-template-columns: 1fr; } }
:root {
    --action-height: 40px;
    --action-width: 168px;
    --control-radius: 8px;
    --card-radius: 14px;
    --muted: #59657b;
}
body .btn[class], body .btn.btn-sm, body .btn.btn-lg, body .admin-menu .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: var(--action-width);
    max-width: 100%;
    height: var(--action-height);
    min-height: var(--action-height);
    padding: 3px 10px;
    border-radius: var(--control-radius);
    border: 1px solid var(--line);
    font: 500 .85rem/1.2 Vazirmatn, Tahoma, sans-serif;
    white-space: normal;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    transform: none;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
    flex-shrink: 0;
}
body .btn-primary { background: #3a4cc0; border-color: #3a4cc0; color: white; }
body .btn-primary:hover { background: #2b3999; border-color: #2b3999; color: white; }
body .btn-soft, body .btn-outline-primary { background: white; color: #2b3999; border-color: #cdd5ea; }
body .btn-soft:hover, body .btn-outline-primary:hover { background: #edf1ff; color: #2b3999; border-color: #7586d4; }
body .btn-danger { background: #b23849; border-color: #b23849; color: white; }
body .btn-outline-danger { background: white; border-color: #d997a1; color: #a32638; }
body .btn-success { background: #13755b; border-color: #13755b; color: white; }
body .btn:focus-visible, body .form-control:focus, body .form-select:focus {
    outline: 2px solid #3a4cc0;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #3a4cc018;
}
body .btn:disabled, body .btn.disabled { opacity: .55; transform: none; box-shadow: none; cursor: not-allowed; }
body .admin-menu .btn { width: 100%; }
body .form-control, body .form-select {
    min-height: var(--action-height);
    border-radius: var(--control-radius);
    border-color: #cdd5e3;
    padding: .45rem .7rem;
    font-size: .9rem;
}
body textarea.form-control { min-height: 96px; }
body .form-card, body .panel-card, body .order-card, body .stat, body .table-wrap, body .payment-dialog {
    border-radius: var(--card-radius);
    border-color: #dfe5ef;
}
body .form-card, body .panel-card, body .order-card { padding: 20px; }
body .table td { vertical-align: middle; }
body .table th { font-size: .84rem; background: #f5f7fc; padding: .7rem .8rem; }
body .portal-nav { border-radius: var(--card-radius); padding: 12px; }
body .portal-nav a { min-height: 40px; padding: 8px 12px; border-radius: var(--control-radius); }
body .navbar { min-height: 68px; }
body .personal-calendar .pc-today, body .auth-tab {
    min-height: var(--action-height);
    border-radius: var(--control-radius);
    font-size: .85rem;
}
body .personal-calendar .pc-today { min-width: 112px; }
body .auth-actions { flex-wrap: wrap; }
body .auth-actions .btn { width: 112px; }
body .payment-dialog .d-flex, body .payment-review-form .d-flex, body .account-editor-form > .d-flex { flex-wrap: wrap; gap: 8px; }
body .admin-shell .form-card h2, body .accounting-page h2 { font-size: 1.2rem; }
@media(max-width:700px) {
    body .btn { --action-width: 148px; }
    body .form-card, body .panel-card, body .order-card { padding: 14px; }
    body .auth-actions .btn { width: 100px; }
    body .admin-menu { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body .payment-dialog .btn { width: 100%; }
}
@media(prefers-reduced-motion:reduce) { body .btn { transition: none; } }
.rectification-guide { direction: rtl; text-align: right; line-height: 2; }
.rectification-guide p { margin-bottom: .65rem; }
.rectification-guide ol { padding-inline-start: 1.4rem; margin: .6rem 0; }
.rectification-example { padding: 14px 16px; margin-bottom: 10px; border: 1px solid #dfe5ef; border-radius: 8px; background: #f7f9fd; color: #35425d; }
.rectification-example .example-line { padding: .35rem .6rem; border-inline-start: 3px solid #b8c5ee; background: white; overflow-wrap: anywhere; }
body .rectification-input { direction: rtl; text-align: right; line-height: 1.9; }
body .order-actions { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
body .order-actions > .btn { flex: 0 1 168px; min-width: 0; }
.customer-explanation { text-align: right; line-height: 2; margin-top: 18px; }
.customer-explanation h3 { margin-top: 20px; }
.customer-explanation li { margin-bottom: 6px; }
/* Compact administration surfaces, with a permanently paired date range. */
body .accounting-page { padding-top: 24px; }
.accounting-page .order-card-head h1 { font-size: 1.5rem; }
.accounting-page .order-card-head p { margin-bottom: 12px; }
body .accounting-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 20px; padding: 12px 16px; font-size: .88rem; }
.accounting-summary > .mt-2 { margin-top: 0!important; }
.accounting-summary [data-benefit-totals] { grid-column: 1/-1; }
.payment-filters { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.5fr; gap: 10px 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.payment-filters > * { width: auto; min-width: 0; }
.payment-filters .form-label { margin-bottom: 5px; font-size: .8rem; }
.payment-date-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; align-items: end; }
.payment-date-pair > div { min-width: 0; }
.payment-filter-actions { grid-column: 1/-1; }
.payment-filter-help { margin: 10px 0 14px; font-size: .82rem; }
.payment-filter-help summary { cursor: pointer; color: var(--blue); }
.payment-filter-help p { margin: 8px 0; }
.issued-gifts-card .table { margin-bottom: 8px; }
body .accounts-admin-page .account-editor-form { align-items: start; gap: 14px; }
.accounts-admin-page .account-editor-form > [data-valmsg-summary],
.accounts-admin-page .account-create-card > form > [data-valmsg-summary] { grid-column: 1/-1; }
.accounts-admin-page [data-valmsg-summary].validation-summary-valid { display: none; }
.account-editor-form > .form-check { grid-column: 1/-1; padding: 10px 36px 10px 12px!important; border-radius: 8px; background: #f5f7fc; }
.account-editor-form .form-label { min-height: 22px; margin-bottom: 5px; }
.accounts-admin-page .permission-picker { max-height: none!important; overflow: visible; }
.accounts-admin-page [data-permission-picker] .d-flex { flex-wrap: wrap; }
.accounts-admin-page .permission-columns { align-items: start; gap: 10px; }
.accounts-admin-page .permission-group { margin: 0; padding: 10px; border-radius: 8px; }
.accounts-admin-page .permission-group summary { font-size: .86rem; font-weight: 700; cursor: pointer; }
.accounts-admin-page .permission-option strong { font-size: .84rem; }
.accounts-admin-page .permission-option small { line-height: 1.7; }
.account-create-card > summary { font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.account-create-card .form-label { min-height: 24px; margin-bottom: 5px; }
.account-create-card > form.row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) 168px; gap: 14px; margin: 0; align-items: start; }
.account-create-card > form.row > * { width: auto; padding: 0; margin: 0; min-width: 0; }
.accounts-admin-page form > .account-form-errors { grid-column: 1/-1; direction: rtl; text-align: right; }
.accounts-admin-page form > .account-form-errors.validation-summary-valid { display: none; }
.accounts-admin-page form > .account-form-errors.validation-summary-errors { padding: 12px 16px; border: 1px solid #efbfc5; border-radius: 8px; background: #fff3f4; color: #9c2434!important; line-height: 1.9; }
.account-form-errors ul { margin: 0; padding-inline-start: 20px; }
.queue-estimate { grid-column: 1/-1; flex-basis: 100%; width: 100%; padding: 10px 12px; border: 1px solid #dce3f3; border-radius: 8px; background: #f5f7ff; font-size: .88rem; line-height: 1.9; }
.queue-estimate span { display: block; color: #59647a; font-size: .82rem; }
.solar-picker-field { position: relative; width: 100%; min-width: 0; }
.portal-main { min-width: 0; }
.portal-main .d-flex > .form-control { min-width: 0; }
.solar-picker-field > .form-control { padding-right: 38px; cursor: pointer; }
.solar-picker-trigger { position: absolute; inset: 1px 1px 1px auto; width: 34px; border: 0; border-radius: 7px; color: #3d4bc6; background: transparent; font-size: 21px; cursor: pointer; }
.solar-picker-dialog { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%,-50%); margin: 0; box-sizing: border-box; width: 340px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 16px; border: 1px solid #d8deee; border-radius: 14px; color: #142148; background: #fff; box-shadow: 0 12px 40px #10204b33; font: inherit; }
.solar-picker-dialog::backdrop { background: #10204b44; }
.solar-picker-dialog button { font: inherit; cursor: pointer; border: 1px solid #e0e4ef; border-radius: 7px; background: #fff; color: #23376d; min-height: 36px; }
.solar-picker-title { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.solar-picker-close { padding: 4px 12px; font-size: .8rem!important; }
.solar-picker-nav { display: grid; grid-template-columns: 32px minmax(0,1fr) minmax(0,1fr) 32px; gap: 5px; margin-bottom: 10px; }
.solar-picker-nav .form-select { min-width: 0; padding: 5px 9px; background-image: none; text-align: center; font-size: .87rem; }
.solar-picker-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.solar-picker-weekday { text-align: center; color: #6d758b; padding: 5px 0; font-size: .8rem; }
.solar-picker-grid button { width: 100%; padding: 0; font-size: .9rem; }
.solar-picker-grid button[aria-pressed=true] { background: #3d4bc6; color: white; border-color: #3d4bc6; }
.solar-picker-grid .is-today { outline: 1px solid #bc9447; outline-offset: -3px; }
.solar-picker-dialog button:disabled { opacity: .35; cursor: default; }
.solar-picker-clock { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 12px; direction: ltr; }
.solar-picker-clock > span { direction: rtl; font-size: .8rem; }
.solar-picker-clock .form-select { width: 65px; padding: 5px; text-align: center; background-image: none; }
.solar-picker-footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.solar-picker-footer button { flex: 1; padding: 5px 9px; font-size: .85rem; }
.solar-picker-footer .solar-picker-apply { flex-basis: 100%; color: white; background: #3d4bc6; border-color: #3d4bc6; }
.account-create-card > form.row > .d-flex { align-self: start; padding-top: 29px; }
.account-danger { border-top: 1px solid var(--line); padding-top: 12px; color: #a32638; }
.account-danger summary { cursor: pointer; font-size: .86rem; }
@media(max-width:1050px) {
    .account-create-card > form.row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .account-create-card > form.row > .d-flex { padding-top: 0; }
    .payment-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:700px) {
    body .accounting-summary { grid-template-columns: 1fr; }
    .payment-filters { grid-template-columns: 1fr; padding: 12px; }
    .account-create-card > form.row { grid-template-columns: 1fr; }
    .accounts-admin-page .permission-columns { grid-template-columns: 1fr; }
}
@media(max-width:700px) {
    body .order-actions > .btn { flex: 1 1 0; width: auto; padding-inline: 4px; font-size: .75rem; }
}
