@font-face {
    font-family: VazirFd;
    src: local("Vazir FD"), local("Vazir");
}

@font-face {
    font-display: swap;
    font-family: Vazirmatn;
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/Vazirmatn-400.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: Vazirmatn;
    font-style: normal;
    font-weight: 500;
    src: url("../fonts/Vazirmatn-500.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: Vazirmatn;
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/Vazirmatn-700.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: Vazirmatn;
    font-style: normal;
    font-weight: 800 900;
    src: url("../fonts/Vazirmatn-800.ttf") format("truetype");
}

:root {
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Vazirmatn, Tahoma, VazirFd, sans-serif;
    background: #f3f5f7;
    color: #17202a;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.app {
    width: min(1180px, calc(100% - 24px));
    margin: 18px auto;
}

.app-dashboard {
    width: min(1120px, calc(100% - 20px));
}

.home-app {
    width: min(980px, calc(100% - 24px));
}

.home-app::before {
    background:
        radial-gradient(circle at 12% 10%, rgba(22, 105, 216, .22), transparent 28%),
        radial-gradient(circle at 84% 16%, rgba(16, 185, 129, .18), transparent 30%),
        radial-gradient(circle at 52% 100%, rgba(124, 58, 237, .18), transparent 34%),
        linear-gradient(135deg, #eef4fb 0%, #f8fafc 48%, #eef2ff 100%);
    content: "";
    inset: 0;
    position: fixed;
    z-index: -1;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.home-card {
    --card-accent: #1669d8;
    --card-soft: #eff6ff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(248, 250, 252, .88)),
        var(--card-soft);
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 8px;
    color: #17202a;
    display: grid;
    gap: 10px;
    min-height: 140px;
    padding: 22px;
    position: relative;
    text-decoration: none;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
    overflow: hidden;
}

.home-card::before {
    background: var(--card-accent);
    content: "";
    height: 5px;
    inset: 0 0 auto 0;
    position: absolute;
}

.home-card::after {
    background: var(--card-accent);
    border-radius: 50%;
    content: "";
    height: 120px;
    left: -38px;
    opacity: .08;
    position: absolute;
    top: -46px;
    width: 120px;
}

.home-card:hover {
    border-color: var(--card-accent);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
    transform: translateY(-2px);
}

.home-card strong {
    font-size: 22px;
    position: relative;
    z-index: 1;
}

.home-card-icon {
    background: var(--card-accent);
    height: 48px;
    justify-self: start;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    position: relative;
    width: 48px;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    z-index: 1;
}

.home-card-icon.icon-order {
    mask-image: url("../icons/ui/order.svg");
    -webkit-mask-image: url("../icons/ui/order.svg");
}

.home-card-icon.icon-orders {
    mask-image: url("../icons/ui/orders.svg");
    -webkit-mask-image: url("../icons/ui/orders.svg");
}

.home-card-icon.icon-price-list {
    mask-image: url("../icons/ui/price-list.svg");
    -webkit-mask-image: url("../icons/ui/price-list.svg");
}

.home-card-icon.icon-map {
    mask-image: url("../icons/ui/map.svg");
    -webkit-mask-image: url("../icons/ui/map.svg");
}

.home-card-icon.icon-users {
    mask-image: url("../icons/ui/users.svg");
    -webkit-mask-image: url("../icons/ui/users.svg");
}

.home-card-icon.icon-tools {
    mask-image: url("../icons/ui/tools.svg");
    -webkit-mask-image: url("../icons/ui/tools.svg");
}

.home-card-icon.icon-settings {
    mask-image: url("../icons/ui/settings.svg");
    -webkit-mask-image: url("../icons/ui/settings.svg");
}

.home-card-icon.icon-route {
    mask-image: url("../icons/ui/route.svg");
    -webkit-mask-image: url("../icons/ui/route.svg");
}

.home-card-icon.icon-driver {
    mask-image: url("../icons/ui/route.svg");
    -webkit-mask-image: url("../icons/ui/route.svg");
}

.home-card-icon.icon-location {
    mask-image: url("../icons/ui/location.svg");
    -webkit-mask-image: url("../icons/ui/location.svg");
}

.home-card-icon.icon-location-log {
    mask-image: url("../icons/ui/location-log.svg");
    -webkit-mask-image: url("../icons/ui/location-log.svg");
}

.home-card-icon.icon-backup {
    mask-image: url("../icons/ui/backup.svg");
    -webkit-mask-image: url("../icons/ui/backup.svg");
}

.home-card span {
    color: #64748b;
    line-height: 1.9;
    position: relative;
    z-index: 1;
}

.home-card.primary-card {
    border-color: rgba(22, 105, 216, .42);
    box-shadow: 0 14px 34px rgba(22, 105, 216, .13);
}

.home-card.card-blue {
    --card-accent: #1669d8;
    --card-soft: #eff6ff;
}

.home-card.card-emerald {
    --card-accent: #059669;
    --card-soft: #ecfdf5;
}

.home-card.card-violet {
    --card-accent: #7c3aed;
    --card-soft: #f5f3ff;
}

.home-card.card-amber {
    --card-accent: #d97706;
    --card-soft: #fffbeb;
}

.home-card.card-rose {
    --card-accent: #e11d48;
    --card-soft: #fff1f2;
}

.home-card.card-slate {
    --card-accent: #475569;
    --card-soft: #f8fafc;
}

.home-card.card-cyan {
    --card-accent: #0891b2;
    --card-soft: #ecfeff;
}

.home-card.card-indigo {
    --card-accent: #4f46e5;
    --card-soft: #eef2ff;
}

.home-app .dashboard-topbar {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(239, 246, 255, .9)),
        #fff;
    border-color: rgba(148, 163, 184, .35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.home-brand-title {
    align-items: center;
    display: flex;
    margin: 0;
    min-height: 38px;
}

.home-brand-title img {
    display: block;
    height: auto;
    max-height: 41px;
    max-width: min(140px, 42vw);
    object-fit: contain;
}

.topbar,
.panel {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 100%;
}

.dashboard-topbar {
    border-color: #cfd9e4;
}

.user-heading {
    display: grid;
    gap: 3px;
}

.user-heading strong {
    color: #1669d8;
    font-size: 13px;
}

.location-box {
    align-items: center;
    display: grid;
    gap: 7px 10px;
    grid-template-areas:
        "location home"
        "status status";
    grid-template-columns: auto auto;
    justify-content: end;
    justify-items: stretch;
}

.location-box span {
    color: #9a3412;
    font-size: 12px;
    font-weight: 700;
    grid-area: status;
    text-align: left;
}

.location-box a {
    color: #1669d8;
    font-size: 12px;
    text-decoration: none;
}

.location-box .home-link {
    align-items: center;
    background: #1669d8;
    border: 1px solid #1669d8;
    border-radius: 8px;
    color: #fff;
    display: flex;
    font-size: 16px;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    min-width: 96px;
    padding: 10px 18px;
}

.location-box #btnLocation {
    grid-area: location;
}

.location-box .home-link {
    grid-area: home;
}

.location-box .home-link:hover {
    background: #1459b2;
}

.location-box span.ok {
    color: #166534;
}

h1 {
    font-size: 24px;
    margin: 0 0 4px;
}

.quick-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.quick-card {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    color: #17202a;
    display: grid;
    gap: 5px;
    min-height: 72px;
    padding: 12px;
    text-align: right;
    text-decoration: none;
}

.quick-card strong {
    font-size: 15px;
}

.quick-card span {
    color: #637083;
    font-size: 12px;
}

.quick-card.active {
    border-color: #1669d8;
    box-shadow: inset 0 3px 0 #1669d8;
}

.quick-card.order-jump-card {
    border-color: #c7daef;
    background: #eef5ff;
}

.quick-action {
    cursor: pointer;
}

.workbench {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.order-guide-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.order-guide-title-row {
    align-items: center;
    margin-bottom: 0;
}

.order-guide-title-row > div {
    display: grid;
    gap: 4px;
}

.order-guide-toggle {
    background: #eef5ff;
    border-color: #bfd4ef;
    color: #0f2f61;
    min-height: 38px;
    min-width: 116px;
}

.order-guide-body {
    display: grid;
    gap: 12px;
}

.order-guide-body[hidden] {
    display: none;
}

.order-guide-steps {
    counter-reset: order-guide;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.order-guide-steps li {
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 7px;
    min-height: 116px;
    padding: 12px 42px 12px 12px;
    position: relative;
}

.order-guide-steps li::before {
    align-items: center;
    background: #1669d8;
    border-radius: 6px;
    color: #fff;
    content: counter(order-guide);
    counter-increment: order-guide;
    display: flex;
    font-weight: 800;
    height: 26px;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 26px;
}

.order-guide-steps strong {
    color: #0f2f61;
    font-size: 14px;
    line-height: 1.7;
}

.order-guide-steps span,
.order-guide-notes span {
    color: #566579;
    font-size: 12px;
    line-height: 1.9;
}

.order-guide-notes {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 10px 12px;
}

.order-guide-notes span {
    color: #7c2d12;
}

.work-main {
    display: grid;
    gap: 12px;
}

.work-side {
    display: grid;
    gap: 12px;
    position: static;
}

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.section-title strong {
    font-size: 16px;
}

.section-title span {
    color: #64748b;
    font-size: 12px;
}

.product-section-title {
    align-items: center;
}

.product-title-copy {
    display: grid;
    gap: 2px;
}

.product-view-switch {
    align-items: center;
    background: #edf2f7;
    border: 1px solid #d7e0e8;
    border-radius: 7px;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 3px;
}

.product-view-option {
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: #526173;
    font-size: 12px;
    font-weight: 800;
    min-height: 36px;
    min-width: 92px;
    padding: 7px 10px;
}

.product-view-option.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .14);
    color: #1459b2;
}

.product-view-option:focus-visible {
    outline: 2px solid #1669d8;
    outline-offset: 1px;
}

.customer-panel {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 10px;
}

.customer-search {
    display: grid;
    gap: 8px;
}

.customer-actions {
    display: flex;
    gap: 8px;
}

.customer-results {
    display: grid;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.customer-result {
    border: 1px solid #dbe2e8;
    border-radius: 6px;
    background: #fbfcfd;
    padding: 8px 10px;
    cursor: pointer;
}

.customer-result:hover {
    border-color: #8bb4ea;
}

.customer-result strong,
.customer-current strong {
    display: block;
}

.customer-result span,
.customer-current span {
    color: #637083;
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.customer-current .customer-draft-status {
    color: #b45309;
    font-weight: 700;
}

.customer-current .customer-draft-status.ok {
    color: #166534;
}

.customer-current {
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}

.customer-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.customer-choice-modal {
    align-items: center;
    background: rgba(15, 23, 42, .46);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 80;
}

.customer-choice-dialog {
    background: #fff;
    border: 1px solid #dbe2e8;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
    display: grid;
    gap: 14px;
    max-height: min(720px, calc(100vh - 32px));
    max-width: 680px;
    overflow: auto;
    padding: 18px;
    position: relative;
    width: min(680px, 100%);
}

.customer-choice-close {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    display: flex;
    font-size: 22px;
    height: 38px;
    justify-content: center;
    left: 14px;
    line-height: 1;
    position: absolute;
    top: 14px;
    width: 38px;
}

.customer-choice-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
}

.customer-choice-list {
    border-top: 1px solid #e5eaf0;
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.choice-location-hint {
    color: #64748b;
    font-size: 12px;
}

.choice-customer-results {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.choice-customer-card,
.choice-empty {
    background: #fbfcfd;
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: right;
    width: 100%;
}

.choice-customer-card:hover {
    border-color: #2563eb;
}

.choice-customer-card strong,
.choice-customer-card span {
    display: block;
}

.choice-customer-card span,
.choice-empty {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.status-panel {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-radius: 8px;
    padding: 12px;
}

.status-panel strong,
.status-panel span {
    display: block;
}

.status-panel span {
    color: #64748b;
    font-size: 12px;
    margin-top: 5px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

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

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cad4dd;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
}

button {
    border: 1px solid #b9c6d2;
    border-radius: 6px;
    background: #fff;
    padding: 10px 16px;
    cursor: pointer;
}

button.primary {
    width: 100%;
    background: #1669d8;
    border-color: #1669d8;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.icon-action {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
}

.icon-action::before {
    background: currentColor;
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    height: 20px;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    width: 20px;
}

.icon-map::before {
    mask-image: url("../icons/ui/map.svg");
    -webkit-mask-image: url("../icons/ui/map.svg");
}

.icon-order::before {
    mask-image: url("../icons/ui/order.svg");
    -webkit-mask-image: url("../icons/ui/order.svg");
}

.icon-home::before {
    mask-image: url("../icons/ui/home.svg");
    -webkit-mask-image: url("../icons/ui/home.svg");
}

.icon-orders::before {
    mask-image: url("../icons/ui/orders.svg");
    -webkit-mask-image: url("../icons/ui/orders.svg");
}

.icon-users::before {
    mask-image: url("../icons/ui/users.svg");
    -webkit-mask-image: url("../icons/ui/users.svg");
}

.icon-help::before {
    mask-image: url("../icons/tenant-admin/help.png");
    -webkit-mask-image: url("../icons/tenant-admin/help.png");
}

.icon-action.primary::before,
.secondary-action.icon-action::before {
    height: 22px;
    width: 22px;
}

.secondary-action {
    background: #eef5ff;
    border-color: #c7daef;
    color: #1459b2;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    min-height: 52px;
    width: 100%;
}

.floating-cart-btn {
    align-items: center;
    background: #1669d8;
    border: 1px solid #1669d8;
    border-radius: 14px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 16px 34px rgba(22, 105, 216, .34);
    color: #fff;
    display: flex;
    gap: 10px;
    left: 18px;
    min-height: 58px;
    max-width: calc(100vw - 36px);
    padding: 10px 18px;
    position: fixed;
    touch-action: manipulation;
    z-index: 900;
}

.floating-cart-btn strong {
    font-size: 16px;
}

.floating-cart-btn span {
    align-items: center;
    background: #fff;
    border-radius: 999px;
    color: #1459b2;
    display: flex;
    font-size: 17px;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    min-width: 34px;
    padding: 4px 8px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(circle at 18% 12%, rgba(22, 105, 216, .16), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(5, 150, 105, .13), transparent 30%),
        linear-gradient(145deg, #eef5ff 0%, #f8fafc 48%, #eef2f7 100%);
}

.login-card {
    width: min(380px, 100%);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .96)),
        #fff;
    border: 1px solid rgba(148, 163, 184, .36);
    border-radius: 12px;
    box-shadow: 0 24px 55px rgba(15, 23, 42, .16);
    padding: 22px;
    display: grid;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    background: linear-gradient(90deg, #1669d8, #059669);
    content: "";
    height: 5px;
    inset: 0 0 auto 0;
    position: absolute;
}

.login-card h1 {
    text-align: center;
}

.login-company-name {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(239, 246, 255, .92)),
        #fff;
    border: 1px solid rgba(22, 105, 216, .25);
    border-radius: 10px;
    box-shadow:
        0 12px 28px rgba(22, 105, 216, .14),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    color: #0f3f87;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.8;
    padding: 13px 14px;
    text-align: center;
}

.home-company-name {
    display: inline-block;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    max-width: min(430px, 50vw);
    padding: 7px 16px;
    vertical-align: middle;
}

.home-heading-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.home-heading-row .home-brand-title {
    margin: 0;
}

.login-brand {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.login-brand img {
    display: block;
    height: auto;
    max-height: 46px;
    max-width: 150px;
    object-fit: contain;
}

.login-card p {
    color: #637083;
    font-size: 12px;
    margin: 0;
    text-align: center;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    padding: 10px;
}

.tenant-login-tools {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 8px;
}

.tenant-login-tools button {
    min-height: 36px;
    white-space: nowrap;
}

.tenant-login-tools span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.tenant-code-box {
    background: #f8fbff;
    border: 1px dashed #aac2df;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

.tenant-code-box[hidden] {
    display: none;
}

.tenant-code-box p {
    color: #64748b;
    font-size: 12px;
    line-height: 1.8;
    margin: 0;
    text-align: right;
}

.settings-subtitle {
    border-top: 1px solid #e2e8f0;
    margin-top: 6px;
    padding-top: 12px;
}

.settings-app {
    width: min(980px, calc(100% - 24px));
}

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

.invoice-settings-grid label {
    margin: 0;
    min-width: 0;
}

.invoice-settings-grid input,
.invoice-settings-grid textarea {
    width: 100%;
}

.invoice-settings-grid textarea {
    resize: vertical;
}

.invoice-settings-grid .invoice-setting-wide {
    grid-column: 1 / -1;
}

.required-settings-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.required-settings-group {
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px;
}

.required-settings-group legend {
    color: #0f172a;
    font-weight: 900;
    padding: 0 6px;
}

.required-settings-group p {
    color: #64748b;
    font-size: 12px;
    line-height: 1.8;
    margin: 0;
}

.sms-provider-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #f0c36a;
    border-radius: 6px;
    background: #fff8e6;
    color: #76520a;
}

.sms-provider-state.is-live {
    border-color: #8ad4b2;
    background: #eefaf4;
    color: #126347;
}

.sms-provider-state span {
    color: inherit;
}

.sms-provider-card {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #bfd2e8;
    border-radius: 6px;
    background: #f6faff;
}

.sms-provider-card legend {
    padding: 0 6px;
    color: #174f8c;
    font-weight: 700;
}

.sms-provider-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 10px;
}

.sms-provider-card small {
    color: #60748c;
    line-height: 1.8;
}

.sms-provider-live-toggle {
    padding: 9px 10px;
    background: #eaf4ff;
    border-inline-start: 4px solid #2474cf;
}

.sms-token-state {
    padding: 9px 11px;
    border: 1px solid #edc879;
    border-radius: 5px;
    background: #fff9e9;
    color: #76520a;
    font-size: 12px;
}

.sms-token-state.is-saved {
    border-color: #9ed7bd;
    background: #effaf5;
    color: #126347;
}

.sms-token-clear {
    color: #9b2c2c;
}

.sms-master-toggle {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border-inline-start: 4px solid #2474cf;
    background: #f1f7fe;
}

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

.sms-event-card,
.sms-otp-card {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid #cfdae8;
    border-radius: 6px;
    background: #f8fbff;
}

.sms-event-card legend,
.sms-otp-card legend {
    padding: 0 6px;
    font-weight: 700;
    color: #174f8c;
}

.sms-event-card small,
.sms-otp-card small {
    display: block;
    margin-top: 8px;
    line-height: 1.8;
    color: #60748c;
}

.sms-otp-card {
    margin-top: 12px;
    background: #f5f2ff;
    border-color: #cfc3ed;
}

.sms-test-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
    align-items: end;
    gap: 10px;
}

@media (max-width: 850px) {
    .sms-event-grid,
    .sms-test-form,
    .sms-provider-fields {
        grid-template-columns: 1fr;
    }

    .sms-provider-state {
        align-items: flex-start;
        flex-direction: column;
    }
}

.sms-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
}

.sms-summary-item {
    padding: 12px;
    border: 1px solid #d4deea;
    border-inline-end: 4px solid #5f7896;
    border-radius: 6px;
    background: #f7f9fc;
}

.sms-summary-item span,
.sms-summary-item strong {
    display: block;
}

.sms-summary-item strong {
    margin-top: 5px;
    font-size: 1.35rem;
}

.sms-summary-item.status-sent {
    border-inline-end-color: #13835f;
    background: #effaf5;
}

.sms-summary-item.status-failed {
    border-inline-end-color: #b73d4c;
    background: #fff2f3;
}

.sms-summary-item.status-queued,
.sms-summary-item.status-processing {
    border-inline-end-color: #2474cf;
    background: #f0f6fe;
}

.sms-manager-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

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

.sms-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.sms-table th,
.sms-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #dbe3ed;
    text-align: right;
    vertical-align: top;
}

.sms-table th {
    background: #edf3f9;
    color: #23415f;
}

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

.required-setting-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
}

label.field-is-required {
    position: relative;
}

label.field-is-required::before {
    color: #dc2626;
    content: "*";
    font-size: 16px;
    font-weight: 900;
    inset-inline-start: 2px;
    position: absolute;
    top: 0;
}

.customer-location-card.field-is-required strong::after,
.signature-panel.field-is-required .section-title strong::after,
.location-box.field-is-required #btnLocation::after {
    color: #dc2626;
    content: " *";
    font-weight: 900;
}

.user-form,
.map-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}

.user-management-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e3a5f;
    font-size: 13px;
    margin: 0 0 12px;
    padding: 10px 12px;
}

.user-form-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
}

.user-form-actions .primary {
    flex: 1 1 280px;
    width: auto;
}

.user-form-actions #newUserButton {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #334155;
    flex: 0 0 auto;
    font-weight: 700;
}

.map-filters {
    grid-template-columns: repeat(4, minmax(150px, 1fr)) repeat(2, auto);
}

.employee-permissions {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    grid-column: 1 / -1;
    padding: 14px;
}

.employee-permissions[hidden] {
    display: none;
}

.employee-permissions-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.employee-permissions-head > div {
    display: grid;
    gap: 4px;
}

.employee-permissions-head span,
.employee-permission-note {
    color: #475569;
    font-size: 12px;
}

.employee-select-all {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    margin: 0;
    padding: 8px 10px;
}

.employee-permission-groups {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.employee-permission-group {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    display: grid;
    gap: 8px;
    margin: 0;
    min-width: 0;
    padding: 10px;
}

.employee-permission-group legend {
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    padding: 0 6px;
}

.employee-permission-item {
    align-items: flex-start;
    display: flex;
    gap: 8px;
}

.employee-permission-item input {
    flex: 0 0 auto;
    margin-top: 3px;
    width: auto;
}

.employee-permission-item span {
    display: grid;
    gap: 2px;
}

.employee-permission-item small {
    color: #64748b;
    font-size: 11px;
}

.employee-permission-note {
    margin: 10px 0 0;
}

.user-permission-summary {
    color: #475569;
    font-size: 11px;
    max-width: 340px;
    min-width: 180px;
}

.user-row-actions {
    align-items: center;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 130px;
}

.user-row-actions form {
    display: block;
    margin: 0;
    width: 100%;
}

.user-row-actions button {
    font-size: 12px;
    min-height: 32px;
    padding: 5px 7px;
    white-space: nowrap;
    width: 100%;
}

.user-disable-button {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.user-enable-button {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.user-delete-button {
    background: #fff1f2;
    border-color: #fda4af;
    color: #9f1239;
}

.current-user-badge {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    color: #075985;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    grid-column: 1 / -1;
    justify-content: center;
    padding: 7px 9px;
    white-space: nowrap;
}

.notice {
    border-radius: 6px;
    margin-top: 10px;
    padding: 10px;
}

.notice.ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.notice.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

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

.map-app {
    width: min(1360px, calc(100% - 24px));
}

.map-summary {
    color: #334155;
    font-weight: 700;
    padding-bottom: 10px;
}

.map-admin-hint {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 700;
    grid-column: 1 / -1;
    padding: 9px 12px;
}

.map-legend {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    grid-column: 1 / -1;
    padding: 9px 12px;
}

.map-legend span,
.popup-status {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.legend-dot,
.popup-status i {
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .24);
    display: inline-block;
    height: 14px;
    width: 14px;
}

.legend-new {
    background: #2563eb;
}

.legend-reviewing {
    background: #d97706;
}

.legend-confirmed {
    background: #16a34a;
}

.legend-rejected {
    background: #dc2626;
}

.legend-inactive {
    background: #64748b;
}

.map-panel {
    padding: 0;
    overflow: hidden;
}

.map-popup-action {
    background: #1669d8;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    margin-top: 8px;
    padding: 7px 12px;
    width: 100%;
}

#customerMap {
    height: calc(100vh - 210px);
    min-height: 520px;
    width: 100%;
}

#visitorRouteMap {
    height: calc(100vh - 230px);
    min-height: 520px;
    width: 100%;
}

.route-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 1.2fr)) repeat(3, minmax(135px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}

.route-order-marker span {
    align-items: center;
    background: #1669d8;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .32);
    color: #fff;
    display: flex;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.delivery-map-panel #deliveryRouteMap {
    height: calc(100vh - 230px);
    min-height: 58vh;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.delivery-route-marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .35);
}

.delivery-invoice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.delivery-invoice-card {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.delivery-invoice-card.delivery-invoice-focus {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

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

.delivery-invoice-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.delivery-map-focus-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    min-height: 30px;
    padding: 4px 9px;
    white-space: nowrap;
}

.delivery-map-focus-btn:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.cargo-load-panel[hidden] {
    display: none;
}

.cargo-load-list {
    display: grid;
    gap: 8px;
}

.cargo-load-item {
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 10px;
}

.cargo-load-item span {
    color: #166534;
    font-size: 12px;
    font-weight: 800;
}

.cargo-load-item small {
    color: #64748b;
    line-height: 1.6;
}

.delivery-status-pill {
    color: #fff;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    white-space: nowrap;
}

.delivery-invoice-body {
    display: grid;
    gap: 5px;
    color: #334155;
    line-height: 1.7;
}

.delivery-location-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.delivery-location-state {
    border: 1px solid;
    border-radius: 7px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
}

.delivery-location-state.is-defined {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.delivery-location-state.is-unknown {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.delivery-location-edit {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.delivery-popup-warning {
    color: #9a3412;
    font-weight: 800;
    margin: 5px 0;
}

.delivery-status-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
}

.delivery-status-actions button {
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-weight: 700;
}

.delivery-status-title {
    grid-column: 1 / -1;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.delivery-status-actions .status-delivered {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.delivery-status-actions .status-settled {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}

.delivery-status-actions .status-partial {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.delivery-status-actions .status-returned {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.location-send-panel {
    display: grid;
    gap: 14px;
}

.location-send-panel textarea {
    resize: vertical;
    width: 100%;
}

.location-send-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.location-send-actions button,
.location-log-table button {
    min-height: 38px;
}

.form-message {
    border-radius: 8px;
    min-height: 22px;
    padding: 8px 10px;
}

.form-message.success {
    background: #ecfdf5;
    color: #047857;
}

.form-message.error {
    background: #fef2f2;
    color: #b91c1c;
}

.location-log-map-panel #locationLogMap {
    min-height: 420px;
}

.location-log-map-panel.provider-osm {
    border-top: 3px solid #16a34a;
}

.location-log-map-panel.provider-neshan {
    border-top: 3px solid #1669d8;
}

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

.location-log-table {
    border-collapse: collapse;
    min-width: 900px;
    width: 100%;
}

.location-log-table th,
.location-log-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 9px 10px;
    text-align: right;
    vertical-align: top;
}

.location-log-table th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
}

.location-log-table tbody tr:hover {
    background: #f8fafc;
}

.location-log-marker {
    background: #e11d48;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .35);
    height: 20px;
    width: 20px;
}

.customer-marker span {
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .35);
    display: block;
    height: 20px;
    width: 20px;
}

.customer-map-tooltip {
    color: #0f172a;
    direction: rtl;
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.8;
    min-width: 190px;
    text-align: right;
}

.customer-map-tooltip .tooltip-title {
    color: #0f3f8f;
    font-weight: 800;
    margin-bottom: 3px;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.group-search-panel {
    align-items: center;
    background: #f0f8f6;
    border: 1px solid #bfddd5;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 44px;
    margin-top: 10px;
    padding: 8px;
}

.group-search-panel[hidden] {
    display: none;
}

.group-search-close {
    background: #fff;
    border-color: #bfddd5;
    color: #37675c;
    font-size: 24px;
    min-height: 44px;
    padding: 0;
}

.product-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 10px;
    max-height: 70vh;
    overflow-y: auto;
    padding-left: 4px;
    scroll-snap-type: y proximity;
}

.product-load-more {
    align-items: center;
    background: #f1f7ff;
    border: 1px solid #c9dcf4;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 10px;
    padding: 10px 12px;
}

.product-load-more[hidden] {
    display: none;
}

.product-load-more span {
    color: #52677f;
    font-size: 13px;
}

.product-load-more button {
    background: #1669d8;
    border-color: #1669d8;
    color: #fff;
    min-width: 220px;
}

.product-load-more button:disabled {
    cursor: wait;
    opacity: .7;
}

.group-scroll-shell {
    align-items: stretch;
    display: grid;
    grid-template-columns: 54px minmax(0, 372px) 54px;
    gap: 8px;
    justify-content: start;
    max-width: 100%;
    padding: 10px 0 8px;
}

.group-scroll-window {
    min-width: 0;
    overflow: hidden;
}

.group-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 180px;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    padding: 0 2px 8px;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
}

.group-scroll-btn {
    align-self: stretch;
    background: #eef5ff;
    border-color: #c7daef;
    color: #1459b2;
    font-size: 30px;
    font-weight: 800;
    min-height: 64px;
    padding: 0;
    touch-action: manipulation;
}

.group-tab {
    min-width: 0;
    min-height: 64px;
    border-color: #d3dde7;
    background: #f7f9fb;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.group-tab span {
    color: #637083;
    font-size: 12px;
    margin-right: 6px;
}

.group-tab.active {
    background: #1669d8;
    border-color: #1669d8;
    color: #fff;
}

.group-tab.active span {
    color: #dceaff;
}

.group-search-tab {
    background: #eef8f5;
    border-color: #b9d9d0;
    color: #176452;
}

.group-search-tab[aria-expanded="true"] {
    background: #187a64;
    border-color: #187a64;
    color: #fff;
}

.product-card {
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfd;
    cursor: pointer;
    min-height: 304px;
    display: grid;
    align-content: start;
    gap: 10px;
    position: relative;
    scroll-snap-align: start;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

.product-card:hover {
    border-color: #8bb4ea;
    box-shadow: 0 6px 16px rgba(22, 105, 216, .12);
    transform: translateY(-1px);
}

.product-card.from-cache {
    border-color: #d7e4f2;
}

.product-thumb {
    width: 100%;
    height: 178px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #e8f0fb;
    color: #1459b2;
    font-size: 46px;
    font-weight: 800;
    overflow: hidden;
}

.product-thumb-image {
    background: #f1f5f9;
}

.product-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.product-card strong {
    display: block;
    font-size: 17px;
    line-height: 1.7;
    min-height: 58px;
    overflow-wrap: anywhere;
}

.product-card span {
    display: block;
    color: #576574;
    margin-top: 6px;
}

.product-card .package-line {
    color: #0f766e;
    font-weight: 800;
}

.product-cart-qty {
    display: none;
}

.product-results--gallery {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 8px;
}

.product-results--gallery .product-card {
    align-content: start;
    gap: 5px;
    min-height: 0;
    overflow: hidden;
    padding: 7px;
}

.product-results--gallery .product-thumb {
    aspect-ratio: 1;
    border-radius: 6px;
    font-size: 34px;
    height: auto;
}

.product-results--gallery .product-thumb img {
    object-fit: contain;
}

.product-results--gallery .product-card-name {
    display: -webkit-box;
    font-size: 12px;
    line-height: 1.55;
    min-height: 38px;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-results--gallery .product-price {
    color: #1459b2;
    font-size: 12px;
    font-weight: 900;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-results--gallery .product-stock,
.product-results--gallery .package-line,
.product-results--gallery .product-select-hint {
    display: none !important;
}

.product-results--gallery .product-card.is-out-of-stock {
    background: #f8fafc;
}

.product-results--gallery .product-card.is-out-of-stock .product-thumb {
    filter: grayscale(.5);
    opacity: .68;
}

.product-results--gallery .product-card.is-out-of-stock .product-stock-empty {
    background: rgba(51, 65, 85, .88);
    border-radius: 5px;
    color: #fff;
    display: block;
    font-size: 10px;
    font-weight: 900;
    inset: 11px auto auto 11px;
    margin: 0;
    padding: 3px 6px;
    position: absolute;
}

.product-results--gallery .product-card.is-in-cart {
    border-color: #16a36a;
    box-shadow: inset 0 0 0 1px rgba(22, 163, 106, .18);
}

.product-results--gallery .product-cart-qty:not([hidden]) {
    background: #0f9f67;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .22);
    color: #fff;
    display: block;
    font-size: 10px;
    font-weight: 900;
    inset: 10px 10px auto auto;
    margin: 0;
    max-width: calc(100% - 20px);
    overflow: hidden;
    padding: 3px 7px;
    position: absolute;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
}

.product-select-hint {
    align-items: center;
    background: #e8f0fb;
    border: 1px solid #d2e3f7;
    border-radius: 999px;
    color: #1459b2 !important;
    display: inline-flex !important;
    font-size: 13px;
    font-weight: 800;
    gap: 6px;
    justify-content: center;
    justify-self: start;
    margin-top: 0 !important;
    padding: 6px 12px;
}

.product-select-hint::before {
    background: currentColor;
    content: "";
    height: 16px;
    mask-image: url("../icons/ui/order.svg");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-image: url("../icons/ui/order.svg");
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    width: 16px;
}

.order-panel {
    scroll-margin-top: 10px;
    overflow-x: auto;
}

.order-panel table {
    font-size: 15px;
    min-width: 620px;
}

.order-item-price {
    color: #334155;
    display: inline-block;
    font-weight: 800;
    white-space: nowrap;
}

.signature-panel {
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    margin: 12px 0;
    padding: 10px;
}

.signature-toggle-button {
    align-items: center;
    background: #eef5ff;
    border-color: #bfd4ef;
    color: #0f2f61;
    display: inline-flex;
    gap: 8px;
    min-height: 40px;
}

.signature-toggle-button img {
    display: block;
    height: 22px;
    object-fit: contain;
    width: 22px;
}

.signature-body {
    display: grid;
    gap: 10px;
}

.signature-body[hidden] {
    display: none;
}

.signature-hint {
    color: #64748b;
    display: block;
    font-size: 12px;
    line-height: 1.8;
}

.signature-pad {
    background: #fff;
    border: 1px dashed #9fb2c7;
    border-radius: 8px;
    display: block;
    height: 180px;
    touch-action: none;
    width: 100%;
}

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

.signature-skip {
    padding-bottom: 0;
}

.status-panel {
    order: 2;
}

.empty-products {
    grid-column: 1 / -1;
    border: 1px dashed #cbd6e2;
    border-radius: 8px;
    color: #637083;
    padding: 20px;
    text-align: center;
}

.product-selection-prompt {
    background: #f7fafc;
    display: grid;
    gap: 6px;
}

.product-selection-prompt strong {
    color: #274b72;
    font-size: 16px;
}

.product-selection-prompt span {
    font-size: 13px;
}

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

th,
td {
    border-bottom: 1px solid #e5ebf0;
    padding: 10px;
    text-align: right;
}

th {
    background: #f8fafc;
}

td input {
    padding: 7px;
}

.totals {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    font-size: 20px;
    margin: 12px 0;
}

.totals strong {
    font-size: 28px;
}

.admin-panel {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 320px) auto auto;
    gap: 10px;
    align-items: end;
}

.admin-compact {
    opacity: .9;
}

.admin-panel strong,
.admin-panel span {
    display: block;
}

.admin-panel span {
    color: #637083;
    font-size: 12px;
    margin-top: 4px;
}

.admin-tool-app {
    width: min(560px, calc(100% - 24px));
}

.admin-tool-card {
    display: grid;
    gap: 14px;
}

.admin-tool-card button.primary {
    min-height: 54px;
}

.tenant-admin-app {
    width: min(980px, calc(100% - 24px));
}

.tenant-admin-app {
    display: grid;
    gap: 14px;
    position: relative;
}

.tenant-admin-app::before {
    background:
        linear-gradient(180deg, rgba(239, 246, 255, .92), rgba(248, 250, 252, .98) 42%, rgba(236, 253, 245, .42)),
        #f5f8fb;
    content: "";
    inset: 0;
    position: fixed;
    z-index: -1;
}

.tenant-admin-topbar {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(239, 246, 255, .94) 58%, rgba(236, 253, 245, .84)),
        #fff;
    border-color: rgba(125, 152, 179, .34);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
}

.tenant-admin-topbar::before {
    background: linear-gradient(180deg, #1669d8, #059669);
    content: "";
    inset: 0 0 0 auto;
    position: absolute;
    width: 5px;
}

.tenant-admin-topbar .user-heading {
    padding-right: 8px;
}

.tenant-admin-topbar h1 {
    align-items: center;
    color: #0f3f87;
    display: flex;
    font-size: 26px;
    gap: 10px;
    line-height: 1.5;
}

.tenant-admin-topbar h1::before,
.tenant-form-card .section-title::before,
.tenant-list-card .section-title::before,
.tenant-help-panel::before {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    display: inline-block;
    flex: 0 0 auto;
}

.tenant-admin-topbar h1::before {
    background-image: url("../icons/tenant-admin/tenant.png");
    height: 42px;
    width: 42px;
}

.tenant-admin-topbar .user-heading span {
    color: #64748b;
    font-weight: 700;
}

.tenant-admin-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-items: initial;
}

.tenant-admin-links a {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #174c87;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    min-height: 38px;
    min-width: 88px;
    padding: 8px 13px;
    text-decoration: none;
}

.tenant-admin-links a::before,
.tenant-edit-button::before,
.tenant-inline-button::before,
.tenant-recovery-button::before,
.tenant-asan-sell-reset-button::before,
.tenant-schema-button::before,
.tenant-delete-button::before,
.tenant-dropdb-button::before,
.tenant-helper-toggle::before {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    height: 20px;
    width: 20px;
}

.tenant-admin-links a:first-child::before {
    background-image: url("../icons/tenant-admin/login.png");
}

.tenant-admin-links a[href="asan_sell_password_reset.php"]::before {
    background-image: url("../icons/tenant-admin/recovery.png");
}

.tenant-admin-links a.tenant-neshan-link {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.tenant-admin-links a.tenant-neshan-link::before {
    background-image: url("../icons/tenant-admin/token.png");
}

.tenant-admin-links a:last-child::before {
    background-image: url("../icons/tenant-admin/exit.png");
}

.tenant-admin-links a:hover {
    background: #eaf3ff;
    border-color: #8bb4ea;
}

.tenant-admin-app > .notice {
    margin: 0;
}

.tenant-login-card,
.tenant-form-card,
.tenant-list-card,
.tenant-help-panel {
    border-color: rgba(148, 163, 184, .32);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    margin-bottom: 0;
}

.tenant-login-card {
    justify-self: center;
    max-width: 460px;
    width: 100%;
}

.tenant-form-card {
    padding: 18px;
}

.tenant-form-card .section-title,
.tenant-list-card .section-title {
    align-items: flex-start;
    border-bottom: 1px solid #e8eef5;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    justify-content: start;
    margin-bottom: 4px;
    padding-bottom: 12px;
}

.tenant-form-card .section-title::before,
.tenant-list-card .section-title::before {
    height: 42px;
    width: 42px;
}

.tenant-form-card .section-title::before {
    background-image: url("../icons/tenant-admin/tenant.png");
}

.tenant-list-card .section-title::before {
    background-image: url("../icons/tenant-admin/list.png");
}

.tenant-form-card .section-title strong,
.tenant-list-card .section-title strong {
    color: #0f3f87;
    font-size: 18px;
}

.tenant-form-card .section-title span,
.tenant-list-card .section-title span {
    grid-column: 2;
}

.tenant-form-card label,
.tenant-search-box label {
    color: #334155;
    position: relative;
}

.tenant-form-grid label::before,
.tenant-search-box label::before {
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    height: 22px;
    left: 10px;
    pointer-events: none;
    position: absolute;
    top: 34px;
    width: 22px;
    z-index: 1;
}

.tenant-form-grid label:nth-of-type(1)::before {
    background-image: url("../icons/tenant-admin/tenant.png");
}

.tenant-form-grid label:nth-of-type(2)::before {
    background-image: url("../icons/tenant-admin/edit.png");
}

.tenant-form-grid label:nth-of-type(3)::before {
    background-image: url("../icons/tenant-admin/database.png");
}

.tenant-form-grid label:nth-of-type(4)::before {
    background-image: url("../icons/tenant-admin/token.png");
}

.tenant-form-grid label:nth-of-type(5)::before {
    background-image: url("../icons/tenant-admin/recovery.png");
}

.tenant-search-box label::before {
    background-image: url("../icons/tenant-admin/search.png");
}

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

.tenant-form-grid label:nth-of-type(4) {
    grid-column: 1 / -1;
}

.tenant-form-card input {
    border-color: #cbd5e1;
    min-height: 43px;
    padding-left: 42px;
}

.tenant-form-card input:focus,
.tenant-search-box input:focus {
    border-color: #1669d8;
    box-shadow: 0 0 0 3px rgba(22, 105, 216, .12);
    outline: 0;
}

.tenant-form-actions {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.tenant-form-actions .primary {
    align-items: center;
    display: inline-flex;
    gap: 9px;
    justify-content: center;
    min-height: 50px;
}

.tenant-form-actions .primary::before {
    background: url("../icons/tenant-admin/schema.png") center / contain no-repeat;
    content: "";
    display: inline-block;
    height: 24px;
    width: 24px;
}

.tenant-form-actions .tenant-inline-button {
    margin-top: 0;
    min-width: 120px;
}

.price-list-app {
    width: min(1180px, calc(100% - 20px));
}

.price-list-topbar {
    align-items: center;
}

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

.price-list-actions button {
    min-height: 38px;
}

.price-filter-panel form {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) 110px repeat(4, auto) auto;
}

.price-summary {
    align-items: center;
    color: #475569;
    display: flex;
    gap: 10px;
    margin: 12px 0;
}

.price-summary strong {
    background: #eaf3ff;
    border-radius: 999px;
    color: #1459b2;
    min-width: 44px;
    padding: 7px 12px;
    text-align: center;
}

.price-card-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    margin-bottom: 14px;
}

.price-product-card {
    background: #fff;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: 88px 1fr;
    min-height: 120px;
    padding: 10px;
}

.price-product-image {
    align-items: center;
    background: #eef5ff;
    border-radius: 8px;
    color: #1459b2;
    display: flex;
    font-size: 32px;
    font-weight: 900;
    height: 100px;
    justify-content: center;
    overflow: hidden;
}

.price-product-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.price-product-placeholder {
    border: 1px dashed #b7c7dc;
}

.price-product-info {
    display: grid;
    gap: 4px;
}

.price-product-info strong {
    color: #0f172a;
    font-size: 16px;
    line-height: 1.6;
}

.price-product-info span,
.price-product-info small {
    color: #64748b;
    line-height: 1.7;
}

.price-product-info b {
    color: #1459b2;
    font-size: 18px;
}

.price-table-panel {
    padding: 0;
    overflow: hidden;
}

.price-table th,
.price-table td {
    font-size: 13px;
}

.tenant-search-box {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    margin: 4px 0 12px;
}

.tenant-search-box input {
    padding-left: 42px;
}

.tenant-edit-button,
.tenant-inline-button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #b7c7dc;
    border-radius: 6px;
    color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 700;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
}

.tenant-edit-button::before {
    background-image: url("../icons/tenant-admin/edit.png");
}

.tenant-inline-button::before {
    background-image: url("../icons/tenant-admin/search.png");
}

#tenantGenerateTokenButton::before {
    background-image: url("../icons/tenant-admin/token.png");
}

#tenantNewButton::before {
    background-image: url("../icons/tenant-admin/tenant.png");
}

.tenant-row-action {
    display: inline-block;
    margin: 4px 6px 0 0;
}

.tenant-list-card {
    padding: 0;
    overflow: hidden;
}

.tenant-list-card > .section-title,
.tenant-list-card > .tenant-search-box {
    margin-left: 16px;
    margin-right: 16px;
}

.tenant-list-card > .section-title {
    margin-top: 16px;
}

.tenant-list-card .table-scroll {
    border-top: 1px solid #e8eef5;
}

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

.tenant-table th {
    background: #f6faff;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.tenant-table td {
    color: #1f2937;
    font-size: 13px;
    vertical-align: middle;
}

.tenant-table tbody tr:hover {
    background: #f2f8ff;
}

.tenant-table td[dir="ltr"] {
    color: #0f3f87;
    font-family: Consolas, Tahoma, sans-serif;
    font-weight: 800;
}

.tenant-status-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    justify-content: center;
    min-width: 64px;
    padding: 5px 10px;
}

.tenant-status-pill.is-active {
    background: #dcfce7;
    color: #166534;
}

.tenant-status-pill.is-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.tenant-actions-cell {
    min-width: 390px;
}

.tenant-actions-cell button {
    white-space: nowrap;
}

.tenant-empty-cell {
    color: #64748b;
    font-weight: 800;
    padding: 22px !important;
    text-align: center;
}

.tenant-recovery-button {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 6px;
    color: #9a3412;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
}

.tenant-recovery-button::before {
    background-image: url("../icons/tenant-admin/recovery.png");
}

.tenant-asan-sell-reset-button {
    align-items: center;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    color: #3730a3;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    text-decoration: none;
}

.tenant-asan-sell-reset-button::before {
    background-image: url("../icons/tenant-admin/recovery.png");
}

.tenant-reset-card {
    border-color: rgba(99, 102, 241, .28);
}

.tenant-reset-result-card {
    border-color: rgba(34, 197, 94, .34);
}

.tenant-reset-result-line {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) 120px;
}

.tenant-reset-result-line input {
    background: #f8fafc;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #14532d;
    direction: ltr;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;
    min-height: 48px;
    padding: 8px 12px;
    text-align: center;
}

.tenant-delete-button,
.tenant-dropdb-button {
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
}

.tenant-schema-button {
    align-items: center;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 6px;
    color: #166534;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
}

.tenant-schema-button::before {
    background-image: url("../icons/tenant-admin/schema.png");
}

.tenant-delete-button::before,
.tenant-dropdb-button::before {
    background-image: url("../icons/tenant-admin/delete.png");
}

.tenant-delete-button {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.tenant-dropdb-button {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.tenant-help-panel {
    gap: 12px;
    overflow: hidden;
    padding-top: 16px;
    position: relative;
}

.tenant-help-panel::before {
    background-image: url("../icons/tenant-admin/help.png");
    height: 42px;
    position: absolute;
    right: 16px;
    top: 14px;
    width: 42px;
}

.tenant-helper-toggle {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    justify-content: center;
    justify-self: start;
    margin-right: 52px;
    min-width: 150px;
}

.tenant-helper-toggle::before {
    background-image: url("../icons/tenant-admin/help.png");
}

.tenant-helper-box {
    background: #f8fbff;
    border: 1px solid #d8e6f6;
    border-radius: 8px;
    overflow: hidden;
}

.tenant-helper-box[hidden] {
    display: none;
}

.tenant-helper-item {
    background:
        linear-gradient(90deg, rgba(22, 105, 216, .07), rgba(5, 150, 105, .04) 44%, transparent),
        #fff;
    display: grid;
    gap: 5px;
    padding: 13px 15px;
}

.tenant-helper-item + .tenant-helper-item {
    border-top: 1px solid #dbe7f4;
}

.tenant-helper-item strong {
    color: #0f3f87;
    font-size: 15px;
}

.tenant-helper-item span {
    color: #475569;
    line-height: 1.9;
}

.tenant-helper-item b {
    background: #eef5ff;
    border-radius: 6px;
    color: #1459b2;
    display: inline-block;
    padding: 2px 7px;
}

.recovery-card .section-title {
    margin-bottom: 2px;
}

.recovery-login-link {
    display: block;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.remember-login-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #d9e2e8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
}

.remember-login-row input {
    accent-color: #1669d8;
    height: 18px;
    margin: 0;
    min-height: 18px;
    min-width: 18px;
    padding: 0;
    width: 18px;
}

.remember-login-row span {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
}

.tenant-edit-button:hover,
.tenant-inline-button:hover {
    background: #eaf2ff;
    border-color: #1669d8;
}

.tenant-inline-button {
    margin-top: 8px;
}

.tenant-token-line {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.tenant-token-line .tenant-inline-button {
    margin-top: 0;
    white-space: nowrap;
}

.tenant-clear-link {
    align-items: center;
    color: #1669d8;
    display: inline-flex;
    font-weight: 700;
    min-height: 34px;
    padding: 7px 10px;
    text-decoration: none;
}

.tenant-clear-link:hover {
    text-decoration: underline;
}

.backup-download-button {
    align-items: center;
    background: #1669d8;
    border: 1px solid #1669d8;
    border-radius: 6px;
    color: #fff;
    display: flex;
    font-size: 18px;
    font-weight: 700;
    justify-content: center;
    min-height: 54px;
    padding: 10px 16px;
    text-decoration: none;
}

.backup-manager-app form {
    margin: 0;
}

.backup-settings-grid {
    display: grid;
    gap: 12px;
}

.backup-actions-cell form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.backup-actions-cell button {
    min-height: 36px;
    padding: 7px 10px;
}

.admin-tool-result {
    border-radius: 6px;
    margin: 0;
    min-height: 20px;
    padding: 10px;
}

.admin-tool-result:empty {
    display: none;
}

.admin-tool-result.ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.admin-tool-result.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.feedback-card {
    display: grid;
    gap: 14px;
}

.feedback-options {
    display: grid;
    gap: 8px;
}

.feedback-options label {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
}

.feedback-options input {
    width: auto;
}

.voice-panel {
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    padding: 10px;
}

.voice-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
}

.voice-status {
    color: #475569;
    font-weight: 700;
    padding: 10px 0;
}

.voice-panel audio {
    width: 100%;
}

.orders-app {
    width: min(920px, calc(100% - 24px));
}

.orders-panel {
    display: grid;
    gap: 12px;
}

.orders-admin-filter {
    justify-content: start;
    padding: 0;
}

.orders-filter-bar {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(125px, 1fr));
}

.orders-filter-bar label {
    display: grid;
    gap: 5px;
}

.orders-filter-bar input,
.orders-filter-bar select {
    min-height: 42px;
}

.orders-filter-bar .pdp-wrapper,
.report-filters .pdp-wrapper,
.route-filters .pdp-wrapper,
.map-filters .pdp-wrapper {
    margin: 0;
}

.orders-filter-bar .pdp-input,
.report-filters .pdp-input,
.route-filters .pdp-input,
.map-filters .pdp-input {
    min-height: 42px;
    text-align: right;
    width: 100%;
}

.orders-filter-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(95px, 1fr));
}

.orders-filter-actions button {
    min-height: 42px;
}

.orders-filter-actions button[type="button"] {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
}

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

.my-order-card {
    background: #fbfcfd;
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.my-order-head,
.my-order-amounts {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.my-order-head strong {
    color: #0f172a;
    font-size: 18px;
}

.my-order-meta {
    color: #475569;
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    font-size: 13px;
}

.my-order-amounts {
    border-top: 1px solid #e5ebf0;
    color: #475569;
    padding-top: 10px;
}

.my-order-amounts strong {
    color: #0f172a;
    font-size: 18px;
}

.my-order-card p {
    background: #f8fafc;
    border-radius: 6px;
    color: #475569;
    margin: 0;
    padding: 8px 10px;
}

.my-order-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
}

.my-order-actions a,
.my-order-actions button {
    align-items: center;
    border: 1px solid #b9c6d2;
    border-radius: 6px;
    color: #17202a;
    display: flex;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    text-decoration: none;
}

.my-order-actions a {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 700;
}

.my-order-actions button {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    font-weight: 700;
}

.order-status {
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
}

.order-status.wait {
    background: #fff7ed;
    color: #9a3412;
}

.order-status.info {
    background: #eff6ff;
    color: #1d4ed8;
}

.order-status.ok {
    background: #f0fdf4;
    color: #166534;
}

.order-status.bad {
    background: #fef2f2;
    color: #991b1b;
}

.order-status.muted {
    background: #f1f5f9;
    color: #475569;
}

.report-app {
    width: min(1180px, calc(100% - 24px));
}

.report-app > .topbar {
    background: #f8fbff;
    border-color: #c9d9ea;
    border-inline-start: 4px solid #2563eb;
    box-shadow: 0 8px 24px rgba(30, 64, 105, .08);
}

.report-app > .topbar h1 {
    color: #173b66;
}

.management-dashboard {
    display: grid;
    gap: 12px;
    margin: 12px 0;
}

.dashboard-section-title {
    align-items: center;
    background: #f2f7fb;
    border: 1px solid #cbdbe8;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
}

.dashboard-section-title strong {
    color: #174a70;
    font-size: 18px;
}

.dashboard-section-title span,
.dashboard-data-note {
    color: #64748b;
    font-size: 12px;
}

.dashboard-kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dashboard-kpi {
    --kpi-accent: #2563eb;
    --kpi-border: #bfd8f5;
    --kpi-soft: #eef6ff;
    background: var(--kpi-soft);
    border: 1px solid var(--kpi-border);
    border-inline-start: 4px solid var(--kpi-accent);
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(30, 64, 105, .06);
    display: grid;
    gap: 7px;
    min-height: 106px;
    padding: 14px;
}

.dashboard-kpi span {
    color: #52677b;
    font-size: 12px;
}

.dashboard-kpi strong {
    color: var(--kpi-accent);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.dashboard-kpi small {
    color: #475569;
    font-size: 11px;
    line-height: 1.7;
}

.dashboard-kpi:nth-child(1) {
    --kpi-accent: #087a55;
    --kpi-border: #b7ead2;
    --kpi-soft: #eefbf5;
}

.dashboard-kpi:nth-child(2) {
    --kpi-accent: #1d5f9e;
    --kpi-border: #bfd8f5;
    --kpi-soft: #eef6ff;
}

.dashboard-kpi:nth-child(3) {
    --kpi-accent: #0f766e;
    --kpi-border: #b8e2df;
    --kpi-soft: #edfafa;
}

.dashboard-kpi:nth-child(4) {
    --kpi-accent: #946200;
    --kpi-border: #f0d594;
    --kpi-soft: #fff8e8;
}

.dashboard-kpi:nth-child(5) {
    --kpi-accent: #6547a5;
    --kpi-border: #d8cff6;
    --kpi-soft: #f6f3ff;
}

.dashboard-kpi:nth-child(6) {
    --kpi-accent: #a23b48;
    --kpi-border: #f3c6ca;
    --kpi-soft: #fff2f3;
}

.dashboard-kpi:nth-child(7) {
    --kpi-accent: #0e6f7b;
    --kpi-border: #b8dfe7;
    --kpi-soft: #edf9fc;
}

.dashboard-kpi:nth-child(8) {
    --kpi-accent: #475569;
    --kpi-border: #cbd5e1;
    --kpi-soft: #f1f5f9;
}

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

.dashboard-chart-panel,
.dashboard-list-panel {
    background: #fbfdff;
    border-color: #d4e0ea;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dashboard-chart-panel canvas {
    background: #fdfefe;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: block;
    height: auto;
    max-width: 100%;
    width: 100%;
}

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

.dashboard-list[hidden] {
    display: none;
}

.dashboard-collapsible-panel {
    align-self: start;
}

.dashboard-collapsible-title {
    align-items: center;
}

.dashboard-collapse-toggle {
    align-items: center;
    background: #edf5fb;
    border: 1px solid #c9dce9;
    color: #24516c;
    display: inline-flex;
    font-size: 12px;
    gap: 7px;
    justify-content: center;
    min-height: 34px;
    padding: 5px 10px;
}

.dashboard-collapse-toggle:hover {
    background: #e1eff8;
    border-color: #9fc4da;
}

.dashboard-toggle-icon {
    align-items: center;
    display: inline-flex;
    font-size: 18px;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    line-height: 1;
    width: 18px;
}

.dashboard-list-item,
.dashboard-empty {
    background: #f3f7fa;
    border: 1px solid #dbe5ec;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 10px;
}

.dashboard-list-item strong {
    color: #0f172a;
    font-size: 13px;
}

.dashboard-list-item span,
.dashboard-list-item small,
.dashboard-empty {
    color: #64748b;
    font-size: 12px;
    line-height: 1.7;
}

.dashboard-data-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
}

.report-filters {
    background: #f7fafc;
    border-color: #cbdbe8;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-filter-actions {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1.4fr;
}

.report-hint {
    align-self: end;
    color: #64748b;
    font-size: 12px;
    grid-column: 1 / -1;
}

.report-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin: 12px 0;
}

.report-card {
    --report-accent: #1d5f9e;
    --report-border: #bfd8f5;
    --report-soft: #eef6ff;
    background: var(--report-soft);
    border: 1px solid var(--report-border);
    border-inline-start: 4px solid var(--report-accent);
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(30, 64, 105, .06);
    display: grid;
    gap: 8px;
    padding: 16px;
}

.report-card span {
    color: #52677b;
    font-size: 13px;
}

.report-card strong {
    color: var(--report-accent);
    font-size: 23px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.report-card:nth-child(1) {
    --report-accent: #1d5f9e;
    --report-border: #bfd8f5;
    --report-soft: #eef6ff;
}

.report-card:nth-child(2) {
    --report-accent: #087a55;
    --report-border: #b7ead2;
    --report-soft: #eefbf5;
}

.report-card:nth-child(3) {
    --report-accent: #946200;
    --report-border: #f0d594;
    --report-soft: #fff8e8;
}

.report-card:nth-child(4) {
    --report-accent: #a23b48;
    --report-border: #f3c6ca;
    --report-soft: #fff2f3;
}

.report-card:nth-child(5) {
    --report-accent: #0e6f7b;
    --report-border: #b8dfe7;
    --report-soft: #edf9fc;
}

.report-two-columns {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

@media (max-width: 820px) {
    .dashboard-chart-grid,
    .dashboard-lists-grid,
    .report-two-columns {
        grid-template-columns: 1fr;
    }

    .dashboard-section-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

.report-table-panel {
    background: #fbfdff;
    border-color: #d4e0ea;
    display: grid;
    gap: 12px;
}

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

.report-table {
    border-collapse: collapse;
    min-width: 100%;
    white-space: nowrap;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid #e5ebf0;
    padding: 10px;
    text-align: right;
}

.report-table th {
    background: #eaf1f7;
    color: #254a66;
    font-size: 13px;
}

.report-table td {
    color: #17202a;
    font-size: 13px;
}

.orders-report-table {
    min-width: 980px;
}

@media (min-width: 900px) {
    .orders-report-table {
        min-width: 0;
        table-layout: fixed;
        width: 100%;
    }

    .orders-report-table th,
    .orders-report-table td {
        overflow: hidden;
        padding-inline: 6px;
        text-overflow: ellipsis;
    }

    .orders-report-table .report-col-date {
        width: 116px;
    }

    .orders-report-table .report-col-number {
        width: 145px;
    }

    .orders-report-table .report-col-visitor {
        width: 72px;
    }

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

    .orders-report-table .report-col-items {
        width: 46px;
    }

    .orders-report-table .report-col-amount {
        width: 104px;
    }

    .orders-report-table .report-col-location {
        width: 48px;
    }

    .orders-report-table .report-col-invoice {
        width: 112px;
    }

    .orders-report-table tbody td:nth-child(5) {
        line-height: 1.45;
        text-overflow: clip;
        white-space: normal;
    }
}

.report-return-highlight td {
    background: #fff7d6;
    transition: background-color .35s ease;
}

.small-map-btn {
    align-items: center;
    border: 1px solid #bfd0e5;
    border-radius: 6px;
    background: #eef6ff;
    color: #174c87;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.small-map-btn:hover {
    background: #dcecff;
}

.small-map-btn.location-source-customer {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.small-map-btn.location-source-customer:hover {
    background: #d1fae5;
}

.location-status-icon {
    align-items: center;
    border: 1px solid #d7dee7;
    border-radius: 6px;
    color: #94a3b8;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    opacity: .72;
    width: 34px;
}

.small-map-btn::before,
.location-status-icon::before {
    height: 18px;
    width: 18px;
}

.invoice-action-cell {
    align-items: center;
    display: flex;
    justify-content: center;
    width: 100%;
}

.invoice-view-btn {
    background: #eef6ff;
    border: 1px solid #bfd0e5;
    border-radius: 8px;
    color: #174c87;
    display: inline-flex;
    font-weight: 700;
    font-size: 12px;
    min-width: 0;
    padding: 6px 8px;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    justify-content: center;
}

.invoice-view-btn:hover {
    background: #dcecff;
}

.inline-map-provider {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: #475569;
    font-size: 0.9rem;
}

.inline-map-provider select {
    min-width: 150px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.location-missing {
    color: #b42318;
    font-weight: 700;
}

.map-modal[hidden] {
    display: none;
}

.map-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.45);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 16px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 80;
}

.map-modal-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    display: grid;
    gap: 10px;
    max-width: 880px;
    padding: 14px;
    width: min(96vw, 880px);
}

.report-location-map {
    border: 1px solid #d8e2ee;
    border-radius: 12px;
    height: min(62vh, 520px);
    min-height: 320px;
    overflow: hidden;
}

.report-location-marker {
    width: 30px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
}

.report-location-marker .pin-shape {
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    display: block;
    transform: rotate(-45deg);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
    position: relative;
}

.report-location-marker .pin-shape::after {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
}

.check-line input {
    width: auto;
}

.check-line span {
    color: #17202a;
    font-size: 13px;
    margin: 0;
}

.hidden-login-field {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.qty-modal[hidden] {
    display: none;
}

.qty-modal {
    align-items: center;
    background: rgba(15, 23, 42, .42);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 14px;
    position: fixed;
    z-index: 1000;
}

.qty-modal--preview {
    background: rgba(15, 23, 42, .72);
    padding: 10px;
}

.qty-modal--image-only {
    background: rgba(2, 6, 23, .92);
    padding: 8px;
}

.qty-dialog {
    background: #fff;
    border: 1px solid #cfd9e4;
    border-radius: 10px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, .28);
    display: grid;
    gap: 12px;
    max-width: 100%;
    padding: 18px;
    position: relative;
    text-align: center;
    width: min(430px, calc(100vw - 28px));
}

.qty-modal--preview .qty-dialog {
    align-content: stretch;
    gap: 10px;
    grid-template-rows: minmax(0, 1fr) auto auto;
    height: calc(100dvh - 20px);
    padding: 10px;
    perspective: 1100px;
    width: calc(100vw - 20px);
}

.qty-modal--image-only .qty-dialog {
    background: transparent;
    border: 0;
    box-shadow: none;
    height: calc(100dvh - 16px);
    padding: 0;
    width: calc(100vw - 16px);
}

.qty-product-image {
    align-items: center;
    backface-visibility: hidden;
    background: #e8f0fb;
    border: 1px solid #d6e4f4;
    border-radius: 10px;
    color: #1459b2;
    display: flex;
    font-size: 54px;
    font-weight: 800;
    height: 190px;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
    width: 100%;
    will-change: transform, opacity;
}

.qty-modal--preview .qty-product-image {
    border-radius: 8px;
    font-size: 92px;
    height: 100%;
    min-height: 0;
}

.qty-modal--image-only .qty-product-image {
    background: transparent;
    border: 0;
    border-radius: 0;
    height: 100%;
}

.qty-product-image img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.qty-product-image.has-image {
    background: #f8fafc;
}

.qty-product-summary-row {
    align-items: stretch;
    backface-visibility: hidden;
    direction: ltr;
    display: grid;
    gap: 8px;
    grid-template-columns: 44px 1fr 44px;
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

.qty-catalog-next-out .qty-product-image {
    animation: qtyCatalogNextOut 220ms ease-in forwards;
}

.qty-catalog-next-in .qty-product-image {
    animation: qtyCatalogNextIn 260ms ease-out both;
}

.qty-catalog-prev-out .qty-product-image {
    animation: qtyCatalogPrevOut 220ms ease-in forwards;
}

.qty-catalog-prev-in .qty-product-image {
    animation: qtyCatalogPrevIn 260ms ease-out both;
}

@keyframes qtyCatalogNextOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: .2;
        transform: translateX(-86%) scale(.96);
    }
}

@keyframes qtyCatalogNextIn {
    from {
        opacity: .35;
        transform: translateX(86%) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes qtyCatalogPrevOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: .2;
        transform: translateX(86%) scale(.96);
    }
}

@keyframes qtyCatalogPrevIn {
    from {
        opacity: .35;
        transform: translateX(-86%) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .qty-catalog-next-out .qty-product-image,
    .qty-catalog-next-in .qty-product-image,
    .qty-catalog-prev-out .qty-product-image,
    .qty-catalog-prev-in .qty-product-image {
        animation: none;
    }
}

.qty-product-summary-row--single {
    grid-template-columns: 1fr;
}

.qty-product-summary {
    direction: rtl;
    display: grid;
    gap: 2px;
    grid-column: 2;
    grid-row: 1;
}

.qty-product-summary-row--single .qty-product-summary {
    grid-column: 1;
}

.qty-product-nav {
    align-items: center;
    background: #eef5ff;
    border: 1px solid #cfe0f5;
    border-radius: 8px;
    color: #1459b2;
    display: flex;
    font-size: 28px;
    font-weight: 900;
    justify-content: center;
    min-height: 54px;
    padding: 0;
}

.qty-product-nav[hidden] {
    display: none;
}

.qty-product-nav-prev {
    grid-column: 1;
    grid-row: 1;
}

.qty-product-nav-next {
    grid-column: 3;
    grid-row: 1;
}

.qty-dialog strong {
    font-size: 20px;
    line-height: 1.8;
    padding: 0 36px;
}

.qty-modal--preview .qty-product-summary {
    background: #f8fafc;
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    padding: 8px 12px;
}

.qty-modal--preview .qty-dialog strong {
    font-size: 18px;
    line-height: 1.6;
}

.qty-dialog span {
    color: #64748b;
}

.qty-dialog .qty-product-hint {
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.qty-close {
    height: 36px;
    left: auto;
    padding: 0;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 36px;
}

.qty-image-zoom {
    align-items: center;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #0f172a;
    display: flex;
    font-size: 20px;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 58px;
    top: 14px;
    width: 34px;
    z-index: 2;
}

.qty-modal--image-only .qty-close {
    background: rgba(255, 255, 255, .94);
    right: 14px;
    top: 14px;
    z-index: 3;
}

.qty-modal--image-only .qty-image-zoom,
.qty-modal--image-only .qty-product-summary-row,
.qty-modal--image-only .qty-preview-actions,
.qty-modal--image-only .qty-controls {
    display: none;
}

.qty-preview-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1.7fr;
}

.qty-preview-actions[hidden] {
    display: none;
}

.qty-preview-actions button {
    min-height: 58px;
}

.qty-controls {
    display: grid;
    gap: 10px;
}

.qty-controls[hidden] {
    display: none;
}

.qty-value {
    background: #eef5ff;
    border: 1px solid #cfe0f5;
    border-radius: 10px;
    color: #1459b2;
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    padding: 18px 10px;
}

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

.qty-package-box {
    align-items: center;
    background: #eef8f6;
    border: 1px solid #bfe7df;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: 64px 1fr 64px;
    padding: 8px;
}

.qty-package-box[hidden] {
    display: none;
}

.qty-package-box button {
    font-size: 20px;
    font-weight: 800;
    min-height: 52px;
}

.qty-package-box .qty-package-step {
    background: #ffffff;
    border-color: #82cfc1;
    color: #0f766e;
    font-size: 30px;
    line-height: 1;
    padding: 0;
}

.qty-package-box span {
    color: #0f766e;
    grid-column: 1 / -1;
    font-weight: 800;
    text-align: center;
}

.qty-stepper button,
.qty-presets button {
    font-size: 28px;
    font-weight: 800;
    min-height: 60px;
}

.qty-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.qty-actions {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 10px;
}

.qty-actions button {
    min-height: 56px;
}

.print-body {
    background: #e9eef4;
    font-family: Vazirmatn, Tahoma, sans-serif;
}

.print-body button,
.print-body select {
    font-family: inherit;
}

.print-page {
    background: #fff;
    border: 1px solid #d8e0ea;
    margin: 18px auto;
    max-width: 980px;
    padding: 24px;
}

.print-header {
    align-items: start;
    border-bottom: 2px solid #17202a;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
}

.print-header span {
    color: #475569;
}

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

.print-paper-select {
    align-items: center;
    border: 1px solid #b9c6d2;
    border-radius: 6px;
    color: #334155;
    display: inline-flex;
    gap: 8px;
    min-height: 40px;
    padding: 6px 10px;
}

.print-paper-select select {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    color: #17202a;
    font: inherit;
    padding: 3px 8px;
}

.print-actions a {
    border: 1px solid #b9c6d2;
    border-radius: 6px;
    color: #17202a;
    padding: 10px 16px;
    text-decoration: none;
}

.print-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.print-info-grid div {
    border: 1px solid #dbe2e8;
    border-radius: 6px;
    padding: 9px;
}

.print-info-grid .wide {
    grid-column: span 3;
}

.print-table th,
.print-table td {
    border: 1px solid #d8e0ea;
}

.print-product-image-cell {
    min-width: 76px;
    text-align: center;
}

.print-product-thumb {
    background: #f8fafc;
    border: 1px solid #d8e0ea;
    border-radius: 6px;
    display: inline-block;
    height: 54px;
    object-fit: cover;
    vertical-align: middle;
    width: 54px;
}

.print-product-no-image {
    color: #94a3b8;
    font-size: 12px;
}

.print-totals {
    display: grid;
    gap: 8px;
    justify-content: end;
    margin-top: 14px;
}

.print-totals div {
    align-items: center;
    border: 1px solid #dbe2e8;
    border-radius: 6px;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    min-width: 280px;
    padding: 9px 12px;
}

.print-totals strong {
    font-size: 18px;
}

.print-signature {
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    margin-top: 18px;
    min-height: 130px;
    padding: 12px;
}

.print-signature img {
    border-top: 1px solid #cbd5e1;
    max-height: 150px;
    max-width: 360px;
    object-fit: contain;
    padding-top: 8px;
}

.official-invoice-layout[hidden],
.standard-invoice-layout[hidden] {
    display: none !important;
}

.print-layout-official .print-header {
    border-bottom: 0;
    justify-content: flex-end;
    padding-bottom: 12px;
}

.print-layout-official .standard-print-heading {
    display: none;
}

.official-invoice-layout {
    color: #111827;
    direction: rtl;
    font-size: 11px;
}

.official-document-header {
    align-items: center;
    border-bottom: 2px solid #111827;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(150px, 1fr) minmax(260px, 1.5fr) minmax(180px, 1fr);
    padding: 2px 0 5px;
}

.official-document-brand {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
}

.official-document-title {
    text-align: center;
}

.official-document-title h1 {
    font-size: 15px;
    line-height: 1.4;
    margin: 0 0 1px;
}

.official-document-title span {
    color: #475569;
    font-size: 9px;
    font-weight: 700;
}

.official-document-meta {
    display: grid;
    font-size: 9px;
    gap: 1px;
}

.official-document-meta div {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    line-height: 1.4;
}

.official-document-meta span {
    color: #475569;
}

.official-document-status {
    border: 1px solid #9ca3af;
    display: block;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.4;
    margin: 4px 0;
    padding: 2px 6px;
    text-align: center;
}

.official-document-status.is-final {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.official-document-status.is-draft {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.official-party-block {
    border: 1px solid #374151;
    margin-bottom: 4px;
}

.official-party-block h2 {
    background: #eef1f4;
    border-bottom: 1px solid #374151;
    font-size: 10px;
    line-height: 1.4;
    margin: 0;
    padding: 2px 5px;
    text-align: center;
}

.official-party-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.official-party-grid > div {
    align-items: baseline;
    border-bottom: 1px solid #cbd5e1;
    border-inline-end: 1px solid #cbd5e1;
    display: flex;
    gap: 4px;
    min-height: 26px;
    padding: 2px 5px;
}

.official-party-grid > div:nth-child(4n) {
    border-inline-end: 0;
}

.official-party-grid > div.span-2 {
    grid-column: span 2;
}

.official-party-grid > div.span-all {
    border-bottom: 0;
    border-inline-end: 0;
    grid-column: 1 / -1;
}

.official-party-grid span {
    color: #64748b;
    flex: 0 0 auto;
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
}

.official-party-grid strong {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.official-items-caption {
    align-items: center;
    background: #eef1f4;
    border: 1px solid #374151;
    border-bottom: 0;
    display: flex;
    justify-content: space-between;
    padding: 3px 6px;
}

.official-items-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.official-items-table th,
.official-items-table td {
    border: 1px solid #374151;
    font-size: 9px;
    line-height: 1.35;
    padding: 3px 2px;
    text-align: center;
    vertical-align: middle;
}

.official-items-table th {
    background: #f3f4f6;
    font-weight: 900;
}

.official-items-table th:nth-child(1) { width: 4%; }
.official-items-table th:nth-child(2) { width: 9%; }
.official-items-table th:nth-child(3) { width: 31%; }
.official-items-table th:nth-child(4) { width: 7%; }
.official-items-table th:nth-child(n+5) { width: 9.8%; }

.official-items-table .official-item-name {
    overflow-wrap: anywhere;
    text-align: right;
}

.official-summary {
    border: 1px solid #374151;
    border-top: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.official-summary div {
    border-inline-end: 1px solid #374151;
    display: grid;
    gap: 4px;
    padding: 7px 8px;
    text-align: center;
}

.official-summary div:last-child {
    border-inline-end: 0;
}

.official-summary span {
    color: #475569;
    font-size: 10px;
}

.official-summary strong {
    font-size: 12px;
}

.official-summary .official-payable {
    background: #111827;
    color: #fff;
}

.official-summary .official-payable span {
    color: #e5e7eb;
}

.official-notes {
    border: 1px solid #374151;
    border-top: 0;
    line-height: 1.8;
    padding: 7px 9px;
}

.official-signatures {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.official-signatures > div {
    border: 1px solid #9ca3af;
    display: grid;
    gap: 8px;
    min-height: 105px;
    padding: 9px;
}

.official-signatures span {
    align-self: end;
    color: #64748b;
}

.official-signatures img {
    align-self: end;
    max-height: 78px;
    max-width: 220px;
    object-fit: contain;
}

.official-document-footer {
    border-top: 1px solid #9ca3af;
    color: #475569;
    line-height: 1.8;
    margin-top: 12px;
    padding-top: 7px;
    text-align: center;
}

.print-paper-a4 .print-page {
    max-width: 210mm;
}

.print-paper-a5 .print-page {
    font-size: 12px;
    max-width: 148mm;
    padding: 16px;
}

.print-orientation-landscape.print-paper-a4 .print-page {
    max-width: 297mm;
}

.print-orientation-landscape.print-paper-a5 .print-page {
    max-width: 210mm;
}

.print-orientation-landscape.print-paper-a5 .official-document-header {
    grid-template-columns: minmax(120px, 1fr) minmax(220px, 1.5fr) minmax(150px, 1fr);
    text-align: initial;
}

.print-orientation-landscape.print-paper-a5 .official-document-meta {
    margin-inline: 0;
    min-width: 0;
}

.print-orientation-landscape.print-paper-a5 .official-party-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.print-orientation-landscape.print-paper-a5 .official-party-grid > div {
    min-height: 26px;
    padding: 2px 5px;
}

.print-orientation-landscape.print-paper-a5 .official-party-grid > div:nth-child(2n) {
    border-inline-end: 1px solid #cbd5e1;
}

.print-orientation-landscape.print-paper-a5 .official-party-grid > div:nth-child(4n) {
    border-inline-end: 0;
}

.print-orientation-landscape.print-paper-a5 .official-party-grid > div.seller-contact {
    grid-column: span 2;
}

.print-paper-a5 .print-header {
    gap: 10px;
    padding-bottom: 10px;
}

.print-paper-a5 .print-header h1 {
    font-size: 20px;
    margin: 0 0 3px;
}

.print-paper-a5 .print-info-grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 12px 0;
}

.print-paper-a5 .print-info-grid .wide {
    grid-column: span 2;
}

.print-paper-a5 .print-info-grid div {
    padding: 7px;
}

.print-paper-a5 .print-table th,
.print-paper-a5 .print-table td {
    font-size: 11px;
    padding: 5px;
}

.print-paper-a5 .print-product-image-cell {
    min-width: 48px;
}

.print-paper-a5 .print-product-thumb {
    height: 38px;
    width: 38px;
}

.print-paper-a5 .print-totals div {
    min-width: 210px;
    padding: 7px 10px;
}

.print-paper-a5 .print-totals strong {
    font-size: 15px;
}

.print-paper-a5 .print-signature {
    margin-top: 12px;
    min-height: 90px;
    padding: 9px;
}

.print-paper-a5 .official-invoice-layout {
    font-size: 9px;
}

.print-paper-a5 .official-document-header {
    gap: 5px;
    grid-template-columns: minmax(90px, 0.8fr) minmax(190px, 1.4fr) minmax(120px, 1fr);
    text-align: initial;
}

.print-paper-a5 .official-document-meta {
    margin-inline: 0;
    min-width: 0;
}

.print-paper-a5 .official-party-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-paper-a5 .official-party-grid > div:nth-child(4n) {
    border-inline-end: 1px solid #cbd5e1;
}

.print-paper-a5 .official-party-grid > div:nth-child(2n) {
    border-inline-end: 0;
}

.print-paper-a5 .official-party-grid > div.seller-contact {
    grid-column: span 1;
}

.print-paper-a5 .official-party-grid > div {
    min-height: 26px;
    padding: 2px 5px;
}

.print-paper-a5 .official-items-table th,
.print-paper-a5 .official-items-table td {
    font-size: 7.5px;
    padding: 3px 2px;
}

.print-paper-a5 .official-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-paper-a5 .official-summary div:nth-child(2) {
    border-inline-end: 0;
}

.print-paper-a5 .official-summary div:nth-child(-n+2) {
    border-bottom: 1px solid #374151;
}

@media print {
    body {
        background: #fff;
    }

    .price-filter-panel,
    .price-list-actions,
    .home-link,
    .location-box {
        display: none !important;
    }

    .price-list-app {
        margin: 0;
        width: 100%;
    }

    .price-list-topbar {
        border: 0;
        box-shadow: none;
        margin-bottom: 10px;
    }

    .price-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .price-product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .price-table th,
    .price-table td {
        font-size: 11px;
        padding: 6px;
    }

    .print-page {
        border: 0;
        margin: 0;
        max-width: none;
        padding: 0;
        width: 100%;
    }

    .print-actions {
        display: none;
    }

    .print-layout-official .print-header {
        display: none;
    }

    .official-document-header,
    .official-party-block,
    .official-summary,
    .official-notes,
    .official-signatures,
    .official-document-footer {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .official-items-table thead {
        display: table-header-group;
    }

    .official-items-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-paper-a4 .print-page,
    .print-paper-a5 .print-page {
        max-width: none;
    }

    .print-paper-a5 .print-page {
        font-size: 11px;
    }
}

@media screen and (max-width: 980px) {
    .order-guide-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 760px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .invoice-settings-grid {
        grid-template-columns: 1fr;
    }

    .official-document-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

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

    .location-box {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        justify-content: stretch;
        width: 100%;
    }

    .location-box span {
        text-align: right;
    }

    .orders-filter-bar {
        grid-template-columns: 1fr;
    }

    .orders-filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .price-filter-panel form {
        grid-template-columns: 1fr;
    }

    .price-list-actions {
        justify-content: stretch;
    }

    .price-list-actions button,
    .price-list-actions a {
        flex: 1;
    }

    .price-card-grid {
        grid-template-columns: 1fr;
    }

    .quick-panel,
    .workbench {
        grid-template-columns: 1fr;
    }

    .order-guide-panel {
        margin-bottom: 10px;
    }

    .order-guide-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .order-guide-toggle {
        width: 100%;
    }

    .order-guide-steps {
        grid-template-columns: 1fr;
    }

    .order-guide-steps li {
        min-height: 0;
    }

    .work-side {
        position: static;
    }

    .product-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        overflow-y: visible;
        gap: 10px;
    }

    .product-load-more {
        align-items: stretch;
        flex-direction: column;
    }

    .product-load-more button {
        min-width: 0;
        width: 100%;
    }

    .group-scroll-shell {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
    }

    .group-tabs {
        grid-auto-columns: minmax(145px, calc((100vw - 132px) / 2));
    }

    .product-card {
        min-height: 306px;
        padding: 10px;
    }

    .product-thumb {
        height: 178px;
    }

    .product-card strong {
        font-size: 15px;
        line-height: 1.55;
        min-height: 70px;
    }

    .product-card span {
        font-size: 13px;
        margin-top: 2px;
    }

    .product-section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .product-view-switch {
        width: 100%;
    }

    .product-view-option {
        min-width: 0;
    }

    .product-results.product-results--gallery {
        gap: 6px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-results--gallery .product-card {
        min-height: 0;
        padding: 5px;
    }

    .product-results--gallery .product-thumb {
        height: auto;
    }

    .product-results--gallery .product-card-name {
        font-size: 11px;
        line-height: 1.5;
        min-height: 34px;
    }

    .product-results--gallery .product-price {
        font-size: 11px;
    }

    .product-results--gallery .product-card.is-out-of-stock .product-stock-empty {
        inset: 8px auto auto 8px;
    }

    .product-results--gallery .product-cart-qty:not([hidden]) {
        inset: 7px 7px auto auto;
    }

    .product-select-hint {
        font-size: 12px;
        padding: 5px 10px;
    }

    .floating-cart-btn {
        left: 12px;
        min-height: 54px;
        padding: 9px 14px;
    }

    .floating-cart-btn strong {
        font-size: 14px;
    }

    .qty-modal {
        align-items: end;
        padding: 10px;
    }

    .qty-modal--preview {
        align-items: center;
        padding: 6px;
    }

    .qty-dialog {
        border-radius: 14px 14px 10px 10px;
        gap: 8px;
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
        padding: 12px;
        width: 100%;
    }

    .qty-modal--preview .qty-dialog {
        border-radius: 10px;
        height: calc(100dvh - 12px);
        padding: 8px;
        width: calc(100vw - 12px);
    }

    .qty-product-image {
        height: min(210px, 28vh);
    }

    .qty-modal--preview .qty-product-image {
        height: 100%;
    }

    .qty-modal--preview .qty-product-summary {
        padding: 8px 42px 8px 10px;
    }

    .qty-product-summary-row {
        gap: 6px;
        grid-template-columns: 38px 1fr 38px;
    }

    .qty-product-summary-row--single {
        grid-template-columns: 1fr;
    }

    .qty-product-nav {
        font-size: 24px;
        min-height: 48px;
    }

    .qty-value {
        font-size: 34px;
        padding: 10px 8px;
    }

    .qty-stepper button,
    .qty-presets button {
        font-size: 22px;
        min-height: 46px;
        padding: 8px;
    }

    .qty-package-box {
        gap: 6px;
        grid-template-columns: 52px 1fr 52px;
        padding: 6px;
    }

    .qty-package-box button {
        font-size: 17px;
        min-height: 44px;
        padding: 8px;
    }

    .qty-package-box .qty-package-step {
        font-size: 24px;
    }

    .qty-presets {
        gap: 8px;
    }

    .qty-actions button,
    .qty-preview-actions button {
        min-height: 48px;
        padding: 9px 10px;
    }

    .qty-dialog .qty-product-hint {
        font-size: 12px;
    }

    .qty-modal--quantity .qty-dialog strong {
        font-size: 17px;
        line-height: 1.45;
    }

    .qty-image-zoom {
        height: 32px;
        right: 52px;
        top: 12px;
        width: 32px;
    }

    .qty-close {
        right: 12px;
        top: 12px;
    }

    .customer-panel,
    .customer-fields,
    .search-row,
    .admin-panel,
    .user-form,
    .map-filters,
    .route-filters {
        grid-template-columns: 1fr;
    }

    .delivery-invoice-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-permission-groups {
        grid-template-columns: 1fr;
    }

    .employee-permissions-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .delivery-invoice-tools {
        justify-content: flex-start;
        width: 100%;
    }

    .customer-choice-actions {
        grid-template-columns: 1fr;
    }

    .customer-choice-dialog {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }

    th:nth-child(3),
    td:nth-child(3) {
        display: none;
    }

    .tenant-admin-app {
        width: min(100% - 16px, 980px);
        margin: 8px auto calc(16px + var(--safe-area-bottom));
    }

    .tenant-admin-topbar {
        align-items: stretch;
        display: grid;
        gap: 12px;
        padding: 14px;
    }

    .tenant-admin-topbar .user-heading {
        padding-right: 6px;
    }

    .tenant-admin-topbar h1 {
        font-size: 21px;
    }

    .tenant-admin-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .tenant-admin-links a {
        min-width: 0;
    }

    .tenant-form-card,
    .tenant-list-card,
    .tenant-help-panel {
        padding: 14px;
    }

    .tenant-list-card {
        padding-left: 0;
        padding-right: 0;
    }

    .tenant-form-grid,
    .tenant-form-actions,
    .tenant-search-box,
    .tenant-token-line {
        grid-template-columns: 1fr;
    }

    .tenant-form-grid label:nth-of-type(4) {
        grid-column: auto;
    }

    .tenant-form-actions .tenant-inline-button,
    .tenant-search-box .tenant-inline-button,
    .tenant-token-line .tenant-inline-button {
        margin-top: 0;
        width: 100%;
    }

    .tenant-list-card > .section-title,
    .tenant-list-card > .tenant-search-box {
        margin-left: 14px;
        margin-right: 14px;
    }

    .tenant-list-card .table-scroll {
        border-top: 0;
        overflow: visible;
    }

    .tenant-table,
    .tenant-table thead,
    .tenant-table tbody,
    .tenant-table tr,
    .tenant-table th,
    .tenant-table td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .tenant-table thead {
        display: none;
    }

    .tenant-table tbody {
        display: grid;
        gap: 10px;
        padding: 0 14px 14px;
    }

    .tenant-table tr {
        background: #fff;
        border: 1px solid #dbe5ef;
        border-radius: 8px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
        overflow: hidden;
    }

    .tenant-table td,
    .tenant-table td:nth-child(3) {
        align-items: flex-start;
        border-bottom: 1px solid #edf2f7;
        display: grid;
        gap: 6px;
        grid-template-columns: 90px minmax(0, 1fr);
        padding: 10px 12px;
        text-align: right;
    }

    .tenant-table td::before {
        color: #64748b;
        content: attr(data-label);
        font-size: 12px;
        font-weight: 900;
    }

    .tenant-table td:last-child {
        border-bottom: 0;
    }

    .tenant-actions-cell {
        min-width: 0;
    }

    .tenant-actions-cell button,
    .tenant-row-action {
        margin: 0;
        width: 100%;
    }

    .tenant-actions-cell {
        gap: 7px !important;
        grid-template-columns: 1fr !important;
    }

    .tenant-empty-cell {
        display: block !important;
        text-align: center;
    }
}

.customer-code-hint {
    align-self: end;
    background: #f1f5f9;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    padding: 11px 12px;
}

.customer-code-hint.ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
    direction: ltr;
    text-align: left;
}

.customer-location-card {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 10px 12px;
}

.customer-location-card strong {
    color: #0f172a;
    display: block;
    font-size: 13px;
    font-weight: 900;
}

.customer-location-card span {
    color: #64748b;
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-top: 3px;
}

.customer-location-card button {
    min-height: 38px;
    white-space: nowrap;
}

.customer-location-picker {
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 10px 12px;
}

.customer-location-picker-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.customer-location-picker-head strong {
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
}

.customer-location-picker-head span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

#customerLocationMap {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    height: 220px;
    overflow: hidden;
}

.customer-location-badge {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    color: #c2410c;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 8px;
    white-space: nowrap;
}

.customer-location-badge.ok {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

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

.meta-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.meta-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 80px 70px;
    padding: 10px 12px;
    text-align: right;
}

.meta-row:hover {
    background: #eef6ff;
    border-color: #bfdbfe;
}

.meta-row span,
.meta-row small,
.meta-row em {
    direction: ltr;
    text-align: left;
}

.meta-row em {
    color: #64748b;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.product-groups-app .meta-row {
    grid-template-columns: minmax(180px, 1fr) 86px 74px 82px;
}

.product-groups-app .meta-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-groups-app .meta-row span:empty::before {
    color: #94a3b8;
    content: "-";
}

@media (max-width: 800px) {
    .meta-admin-grid {
        grid-template-columns: 1fr;
    }

    .meta-row {
        grid-template-columns: 1fr;
    }

    .product-groups-app .meta-row {
        grid-template-columns: 1fr;
    }
}

.customers-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.customer-edit-card {
    align-self: start;
}

.customer-form-actions,
.customers-toolbar,
.customers-pager {
    align-items: center;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.customer-back-button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    text-decoration: none;
}

.customer-back-button:hover {
    background: #eef5ff;
    border-color: #b7cbe8;
    color: #1459b2;
}

.field-shortcut-link {
    align-self: flex-start;
    background: #eef8f6;
    border: 1px solid #bfe7df;
    border-radius: 8px;
    color: #0f766e;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    margin-top: 8px;
    padding: 7px 10px;
    text-decoration: none;
}

.field-shortcut-link:hover {
    background: #dcf7f1;
    border-color: #82cfc1;
    color: #0f5f59;
}

.customer-form-message {
    color: #047857;
    font-weight: 800;
    min-height: 22px;
}

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

.customers-toolbar input {
    flex: 1 1 260px;
}

.customers-toolbar select {
    flex: 0 0 150px;
}

.customers-table {
    min-width: 1080px;
    width: 100%;
}

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

.customers-table td:first-child {
    min-width: 42px;
    text-align: center;
}

.customers-table td:nth-child(2) {
    min-width: 190px;
    white-space: normal;
}

.customer-bulk-assign {
    align-items: center;
    display: flex;
    flex: 1 1 520px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    min-width: 0;
}

.customer-bulk-assign select {
    flex: 0 0 180px;
}

.customer-bulk-assign button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 12px;
    white-space: nowrap;
}

.customer-visitor-select {
    min-width: 150px;
    padding: 6px 8px;
}

.customer-visitor-select.is-saving {
    background: #eef6ff;
    color: #1d4ed8;
}

.customers-pager {
    justify-content: center;
    margin-top: 12px;
}

.products-admin-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.product-edit-card {
    align-self: start;
}

.product-form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-active-toggle {
    align-items: center;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-start;
    padding: 9px 10px;
}

.product-active-toggle input {
    width: auto;
}

.product-admin-preview {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 140px;
    overflow: hidden;
}

.product-admin-preview img {
    display: block;
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
}

.product-admin-preview span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.product-row-inactive {
    background: #fff7ed;
    color: #64748b;
}

.product-status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 7px 10px;
}

.product-status-pill.is-active {
    background: #dcfce7;
    color: #166534;
}

.product-status-pill.is-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.product-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-code-field {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.product-group-field {
    align-items: stretch;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.product-code-field input {
    min-width: 0;
}

.product-group-field input {
    min-width: 0;
}

.product-code-field button {
    font-size: 12px;
    font-weight: 900;
    min-height: 42px;
    padding: 0 12px;
    white-space: nowrap;
}

.product-group-field a {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #0f2f61;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
}

.product-group-field a:hover,
.product-group-field a:focus-visible {
    background: #eef6ff;
    border-color: #1669d8;
    outline: none;
}

.product-groups-app {
    width: min(1180px, calc(100% - 24px));
}

.product-groups-grid {
    align-items: start;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.product-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-admin-thumb {
    background: #eef2ff;
    border-radius: 8px;
    display: inline-flex;
    height: 44px;
    object-fit: cover;
    width: 44px;
}

.product-admin-thumb.no-image {
    align-items: center;
    color: #1d4ed8;
    font-weight: 900;
    justify-content: center;
}

.product-image-search-button {
    align-self: end;
    min-height: 42px;
}

.product-image-modal[hidden] {
    display: none;
}

.product-image-modal {
    inset: 0;
    position: fixed;
    z-index: 1000;
}

.product-image-modal__backdrop {
    background: rgba(15, 23, 42, .42);
    inset: 0;
    position: absolute;
}

.product-image-modal__panel {
    background: #fff;
    border: 1px solid #d5e0ea;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
    display: grid;
    gap: 14px;
    left: 50%;
    max-height: min(720px, calc(100vh - 36px));
    max-width: min(920px, calc(100vw - 28px));
    overflow: auto;
    padding: 16px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 920px;
}

.product-image-modal__panel header {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding-bottom: 12px;
}

.product-image-modal__panel header strong {
    color: #0f2f61;
    font-size: 18px;
    font-weight: 900;
}

.product-image-search-message {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    line-height: 1.9;
    padding: 10px 12px;
}

.product-image-search-message a {
    color: #1669d8;
    font-weight: 900;
    text-decoration: none;
}

.product-image-suggestions {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.product-image-suggestion {
    background: #f8fafc;
    border: 1px solid #d9e2e8;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 8px;
    padding: 8px;
    text-align: right;
}

.product-image-suggestion:hover,
.product-image-suggestion:focus-visible {
    background: #eef6ff;
    border-color: #1669d8;
    outline: none;
}

.product-image-suggestion img {
    background: #fff;
    border-radius: 6px;
    height: 126px;
    object-fit: contain;
    width: 100%;
}

.product-image-suggestion span,
.product-image-suggestion small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-image-suggestion span {
    color: #17202a;
    font-size: 12px;
    font-weight: 900;
}

.product-image-suggestion small {
    color: #64748b;
    font-size: 11px;
}

.product-image-empty {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #9a3412;
    font-weight: 900;
    grid-column: 1 / -1;
    padding: 14px;
    text-align: center;
}

.products-admin-table td:first-child,
.products-admin-table th:first-child {
    text-align: center;
    width: 62px;
}

@media (max-width: 960px) {
    .customers-layout,
    .products-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1100px) {
    .customers-app,
    .products-admin-app {
        max-width: none;
        width: min(1320px, calc(100% - 32px));
    }

    .customers-layout,
    .products-admin-layout {
        align-items: start;
        gap: 16px;
        grid-template-columns: 1fr;
    }

    .customer-edit-card,
    .product-edit-card {
        border-color: #d5e0ea;
        box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
        display: grid;
        gap: 12px 14px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 16px;
    }

    .customer-list-card,
    .product-list-card {
        min-width: 0;
    }

    .customer-edit-card label,
    .product-edit-card label {
        color: #1f2937;
        font-size: 13px;
        font-weight: 900;
        margin: 0;
    }

    .customer-edit-card input,
    .customer-edit-card select,
    .product-edit-card input,
    .product-edit-card select {
        min-height: 42px;
    }

    .customer-edit-card .section-title,
    .product-edit-card .section-title {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .customer-edit-card input[type="hidden"],
    .product-edit-card input[type="hidden"] {
        display: none;
    }

    .customer-code-hint,
    .customer-form-message,
    .customer-location-card {
        align-self: center;
        grid-column: span 2;
    }

    .customer-location-picker {
        grid-column: span 2;
    }

    .customer-form-actions,
    .product-form-actions {
        grid-column: span 2;
        justify-content: flex-end;
        margin-top: 0;
    }

    .product-admin-preview {
        grid-column: span 2;
        min-height: 122px;
    }

    .product-image-search-button {
        grid-column: span 2;
    }

    .product-admin-preview img {
        max-height: 132px;
    }

    .customers-toolbar {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }

    .customers-toolbar input {
        flex: 1 1 320px;
        min-height: 42px;
    }

    .customers-toolbar select {
        flex: 0 0 170px;
        min-height: 42px;
    }

    .customers-toolbar .customer-bulk-assign {
        flex: 1 1 520px;
    }

    .customers-toolbar .customer-bulk-assign select {
        flex: 0 0 180px;
    }

    .customers-table {
        border-collapse: separate;
        border-spacing: 0;
        font-size: 13px;
    }

    .customers-table thead th {
        background: #eef4fb;
        border-bottom: 1px solid #cbd5e1;
        color: #0f2f61;
        font-weight: 900;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .customers-table tbody tr:hover {
        background: #f8fbff;
    }

    .customers-table th,
    .customers-table td {
        padding: 10px 12px;
        vertical-align: middle;
    }

    .customers-table button {
        min-height: 34px;
        padding: 7px 14px;
    }

    .product-admin-thumb {
        height: 52px;
        width: 52px;
    }

    .customers-pager {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 10px;
    }
}

.maintenance-app {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.maintenance-card {
    max-width: 520px;
    text-align: center;
}

.maintenance-card strong {
    color: #0f2f61;
    display: block;
    font-size: 26px;
    margin-bottom: 12px;
}

.maintenance-card span {
    color: #475569;
    display: block;
    font-size: 15px;
    line-height: 2;
    margin-bottom: 18px;
}

/* Backup center */
body.backup-page {
    background: #eef3f2;
}

.backup-manager-app {
    display: grid;
    gap: 12px;
    width: min(1120px, calc(100% - 24px));
}

.backup-manager-app > * {
    margin-bottom: 0;
}

.backup-manager-topbar {
    background: #fff;
    border-color: #cbd8d5;
    border-right: 5px solid #16865f;
    min-height: 82px;
}

.backup-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.backup-heading-icon {
    align-items: center;
    background: #e7f7ef;
    border: 1px solid #bde6d2;
    border-radius: 8px;
    display: flex;
    flex: 0 0 48px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.backup-heading-icon img {
    height: 27px;
    width: 27px;
}

.backup-manager-topbar h1 {
    color: #123b32;
    font-size: 23px;
    letter-spacing: 0;
    line-height: 1.6;
}

.backup-manager-topbar .user-heading span {
    color: #536661;
    font-size: 12px;
}

.backup-nav {
    align-items: center;
    display: flex;
    gap: 8px;
}

.backup-nav a {
    align-items: center;
    border: 1px solid #c8d4d1;
    border-radius: 6px;
    color: #23473f;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    text-decoration: none;
}

.backup-nav .home-link {
    background: #1669d8;
    border-color: #1669d8;
    color: #fff;
    min-width: 80px;
}

.backup-overview {
    align-items: stretch;
    background: #fff;
    border: 1px solid #cad8d4;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1.6fr);
    padding: 14px;
}

.backup-overview-copy {
    align-content: center;
    border-right: 4px solid #16865f;
    display: grid;
    gap: 6px;
    padding: 8px 12px;
}

.backup-overview-copy strong {
    color: #123b32;
    font-size: 16px;
    line-height: 1.8;
}

.backup-overview-copy span {
    color: #60716d;
    font-size: 12px;
    line-height: 1.8;
}

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

.backup-metric {
    border: 1px solid #d7e1df;
    border-radius: 6px;
    display: grid;
    gap: 7px;
    min-height: 78px;
    padding: 12px;
}

.backup-metric.metric-green {
    background: #edf9f3;
    border-top: 4px solid #16865f;
}

.backup-metric.metric-blue {
    background: #eef6ff;
    border-top: 4px solid #2878c8;
}

.backup-metric.metric-amber {
    background: #fff8e7;
    border-top: 4px solid #c38313;
}

.backup-metric span {
    color: #5c6b68;
    font-size: 11px;
}

.backup-metric strong {
    color: #172d28;
    font-size: 20px;
    line-height: 1.4;
}

.backup-health-value.ok {
    color: #117451;
}

.backup-health-value.error {
    color: #b42318;
}

.backup-health-value.pending {
    color: #9a6700;
}

.backup-work-grid {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
}

.backup-action-card,
.backup-settings-card,
.backup-health-card,
.backup-list-card {
    border-color: #cad8d4;
}

.backup-action-card {
    border-top: 4px solid #16865f;
}

.backup-settings-card {
    border-top: 4px solid #c38313;
}

.backup-manager-app .section-title {
    align-items: flex-start;
    margin-bottom: 0;
}

.backup-manager-app .section-title strong {
    color: #183c34;
}

.backup-create-form {
    display: grid;
    gap: 10px;
    grid-template-columns: 1.1fr 1.35fr 1fr;
}

.backup-create-form .backup-create-button,
.backup-create-form .backup-full-button,
.backup-create-form .backup-download-button {
    min-height: 52px;
}

.backup-create-form .backup-create-button {
    align-items: center;
    background: #16865f;
    border-color: #16865f;
    display: flex;
    font-size: 15px;
    gap: 9px;
    justify-content: center;
}

.backup-create-button img {
    filter: brightness(0) invert(1);
    height: 22px;
    width: 22px;
}

.backup-create-form .backup-full-button {
    background: #c38313;
    border-color: #c38313;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.backup-create-form .backup-download-button {
    background: #1669d8;
    font-size: 15px;
}

.backup-scope-list {
    border-top: 1px solid #dbe4e2;
    display: grid;
    gap: 0;
    margin: 0;
}

.backup-scope-list > div {
    align-items: start;
    border-bottom: 1px solid #e5ecea;
    display: grid;
    gap: 12px;
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 9px 0;
}

.backup-scope-list dt {
    color: #667570;
    font-size: 12px;
}

.backup-scope-list dd {
    color: #1d3b34;
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.backup-settings-card label {
    color: #3f514d;
}

.backup-settings-card input {
    border-color: #cbd8d5;
    min-height: 42px;
}

.backup-settings-card button.primary {
    font-size: 14px;
    min-height: 44px;
}

.backup-health-card {
    border-right: 5px solid #2878c8;
    padding: 12px 14px;
}

.backup-health-summary {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 12px minmax(0, 1fr) auto;
}

.backup-health-indicator {
    background: #c38313;
    border-radius: 2px;
    height: 12px;
    width: 12px;
}

.backup-health-indicator.ok {
    background: #16865f;
}

.backup-health-indicator.error {
    background: #c2392d;
}

.backup-health-summary strong {
    color: #183c34;
    display: block;
    font-size: 14px;
}

.backup-health-summary p {
    color: #5b6b67;
    font-size: 12px;
    line-height: 1.8;
    margin: 3px 0 0;
}

.backup-health-time {
    color: #60716d;
    font-size: 11px;
    white-space: nowrap;
}

.backup-legacy-note {
    background: #fff8e7;
    border: 1px solid #ecd291;
    border-right: 5px solid #c38313;
    border-radius: 6px;
    color: #76520e;
    font-size: 12px;
    line-height: 1.9;
    padding: 10px 13px;
}

.backup-list-card {
    border-top: 4px solid #2878c8;
}

.backup-table {
    min-width: 900px;
}

.backup-table thead th {
    background: #edf4f3;
    color: #24443d;
    white-space: nowrap;
}

.backup-table tbody tr:hover {
    background: #f7fbfa;
}

.backup-file-cell {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 310px;
    text-align: left;
}

.backup-file-dot {
    background: #16865f;
    border-radius: 2px;
    flex: 0 0 9px;
    height: 9px;
    width: 9px;
}

.backup-file-cell small {
    background: #e7f7ef;
    border: 1px solid #bde6d2;
    border-radius: 5px;
    color: #117451;
    font-size: 10px;
    padding: 3px 7px;
}

.backup-type-badge {
    border: 1px solid #bde6d2;
    border-radius: 5px;
    color: #117451;
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
    white-space: nowrap;
}

.backup-type-badge.full {
    background: #fff8e7;
    border-color: #ecd291;
    color: #76520e;
}

.backup-type-badge.standard {
    background: #e7f7ef;
}

.backup-actions-cell form {
    align-items: center;
    flex-wrap: nowrap;
}

.backup-actions-cell button {
    font-size: 12px;
    min-height: 34px;
    white-space: nowrap;
}

.backup-actions-cell .backup-test-button {
    border-color: #88acd0;
    color: #155da4;
}

.backup-actions-cell .backup-delete-button {
    border-color: #e5a7a2;
    color: #b42318;
}

.backup-empty-state {
    color: #667570;
    padding: 28px 12px !important;
    text-align: center;
}

@media (max-width: 880px) {
    .backup-overview {
        grid-template-columns: 1fr;
    }

    .backup-overview-copy {
        min-height: 70px;
    }

    .backup-work-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .backup-manager-app {
        margin: 10px auto;
        width: min(100% - 16px, 1120px);
    }

    .backup-manager-topbar {
        min-height: 0;
    }

    .backup-nav {
        width: 100%;
    }

    .backup-nav a {
        flex: 1;
    }

    .backup-metrics {
        grid-template-columns: 1fr;
    }

    .backup-metric {
        min-height: 66px;
    }

    .backup-create-form {
        grid-template-columns: 1fr;
    }

    .backup-health-summary {
        align-items: start;
        grid-template-columns: 12px minmax(0, 1fr);
    }

    .backup-health-time {
        grid-column: 2;
        white-space: normal;
    }

    .backup-table th:nth-child(3),
    .backup-table td:nth-child(3),
    .backup-table th:nth-child(4),
    .backup-table td:nth-child(4) {
        display: table-cell;
    }
}

/* Tenant operations console */
.tenant-admin-app {
    gap: 12px;
    width: min(1180px, calc(100% - 28px));
}

.tenant-admin-app::before {
    background: #edf3f6;
}

.tenant-admin-topbar {
    background: #fff;
    border-color: #cbd7e2;
    box-shadow: 0 10px 26px rgba(22, 50, 74, .08);
    min-height: 98px;
    padding: 18px 20px;
}

.tenant-admin-topbar::before {
    background: #1376a8;
}

.tenant-admin-topbar .user-heading small {
    color: #0f766e;
    display: block;
    font-size: 11px;
    font-weight: 900;
    margin: 0 0 2px;
}

.tenant-admin-topbar h1 {
    color: #183b56;
    font-size: 24px;
}

.tenant-admin-topbar .user-heading span {
    color: #667785;
    font-size: 12px;
}

.tenant-admin-links {
    background: #f4f7f9;
    border: 1px solid #d8e1e8;
    border-radius: 8px;
    padding: 6px;
}

.tenant-admin-links a {
    background: #fff;
    border-color: #d2dde5;
    color: #28526d;
    min-height: 36px;
    padding: 7px 11px;
}

.tenant-summary-bar {
    background: #fff;
    border: 1px solid #cbd7e2;
    border-radius: 8px;
    box-shadow: 0 7px 20px rgba(22, 50, 74, .05);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
}

.tenant-summary-bar > div {
    align-items: center;
    border-left: 1px solid #e3e9ee;
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 12px 16px;
}

.tenant-summary-bar > div:last-child {
    border-left: 0;
}

.tenant-summary-bar span {
    color: #637482;
    font-size: 12px;
    font-weight: 800;
}

.tenant-summary-bar strong {
    color: #174d70;
    font-size: 23px;
}

.tenant-summary-bar .is-success {
    box-shadow: inset 0 -3px #1b9a72;
}

.tenant-summary-bar .is-success strong {
    color: #14765b;
}

.tenant-summary-bar .is-muted {
    box-shadow: inset 0 -3px #8a98a5;
}

.tenant-summary-bar .is-warning {
    box-shadow: inset 0 -3px #d79328;
}

.tenant-summary-bar .is-warning strong {
    color: #a15c04;
}

.tenant-admin-workspace {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr);
}

.tenant-form-card,
.tenant-list-card,
.tenant-help-panel,
.tenant-login-card {
    border-color: #cbd7e2;
    box-shadow: 0 7px 20px rgba(22, 50, 74, .05);
}

.tenant-form-card {
    padding: 16px;
}

.tenant-form-card .section-title,
.tenant-list-card .section-title {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding-bottom: 10px;
}

.tenant-form-card .section-title::before,
.tenant-list-card .section-title::before {
    height: 36px;
    width: 36px;
}

.tenant-form-card .section-title strong,
.tenant-list-card .section-title strong {
    color: #183b56;
    font-size: 17px;
}

.tenant-form-card .section-title span,
.tenant-list-card .section-title span {
    color: #73818d;
    font-size: 11px;
}

.tenant-form-mode,
.tenant-maintenance-status,
.tenant-list-count {
    align-self: center;
    background: #e8f6f1;
    border: 1px solid #b9dfd3;
    border-radius: 999px;
    color: #146b55;
    font-size: 11px;
    font-weight: 900;
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    padding: 5px 10px;
    white-space: nowrap;
}

.tenant-form-mode.is-editing {
    background: #fff4df;
    border-color: #efd09a;
    color: #95510a;
}

.tenant-maintenance-status {
    background: #e9f5fb;
    border-color: #b9dce9;
    color: #176285;
}

.tenant-maintenance-card.is-enabled .tenant-maintenance-status {
    background: #fff1e5;
    border-color: #f2c59f;
    color: #9a4712;
}

.tenant-list-count {
    background: #edf2f6;
    border-color: #d2dde5;
    color: #4e6372;
}

.tenant-code-field {
    grid-column: 1 / -1;
}

.tenant-code-line {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.tenant-code-field small {
    color: #71808c;
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
}

.tenant-code-line input[readonly] {
    background: #f4f8fa;
    color: #0f5277;
    font-family: Consolas, Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0;
}

.tenant-code-line .tenant-inline-button {
    margin: 0;
    min-height: 43px;
    min-width: 112px;
    white-space: nowrap;
}

#tenantGenerateCodeButton::before {
    background-image: url("../icons/tenant-admin/tenant.png");
}

.tenant-form-grid {
    gap: 10px 12px;
}

.tenant-form-card label,
.tenant-search-box label {
    color: #344b5b;
    font-size: 12px;
}

.tenant-form-card input,
.tenant-form-card select,
.tenant-search-box input {
    border-color: #c8d4dd;
    min-height: 42px;
}

.tenant-maintenance-card {
    align-content: start;
    background: #fbfcfd;
}

.tenant-maintenance-card .section-title::before {
    background-image: url("../icons/tenant-admin/schema.png");
}

.tenant-maintenance-card > .primary {
    margin-top: auto;
    min-height: 46px;
}

.tenant-form-actions .primary {
    min-height: 46px;
}

.tenant-list-card > .section-title {
    margin-top: 14px;
}

.tenant-list-card .table-scroll {
    border-top-color: #dce5ec;
}

.tenant-table {
    min-width: 1040px;
}

.tenant-table th {
    background: #eef4f7;
    color: #405666;
    padding-bottom: 11px;
    padding-top: 11px;
}

.tenant-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

.tenant-table tbody tr:hover {
    background: #edf7f9;
}

.tenant-actions-cell {
    min-width: 410px;
}

.tenant-users-card {
    background: #fff;
    border-color: #bdd5de;
    border-right: 5px solid #1376a8;
    box-shadow: 0 7px 20px rgba(22, 50, 74, .05);
    margin-bottom: 0;
    overflow: hidden;
    padding: 0;
}

.tenant-users-card[hidden] {
    display: none;
}

.tenant-users-title {
    align-items: center;
    border-bottom: 1px solid #dce7ec;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 14px 16px;
}

.tenant-users-title > div {
    display: grid;
    gap: 3px;
}

.tenant-users-title strong {
    color: #183b56;
    font-size: 17px;
}

.tenant-users-title span {
    color: #667785;
    font-size: 12px;
}

.tenant-users-close {
    align-items: center;
    background: #f4f7f9;
    border: 1px solid #cbd7e2;
    color: #405666;
    display: inline-flex;
    font-size: 22px;
    height: 38px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 38px;
}

.tenant-users-close:hover {
    background: #e8f1f5;
    border-color: #9ebdc9;
}

.tenant-users-card > .notice {
    margin: 12px 16px 0;
}

.tenant-users-note {
    background: #eef7f8;
    border-bottom: 1px solid #d6e7e9;
    color: #45616d;
    font-size: 12px;
    line-height: 1.9;
    padding: 10px 16px;
}

.tenant-users-table {
    min-width: 760px;
    table-layout: fixed;
}

.tenant-users-table th:nth-child(1) { width: 18%; }
.tenant-users-table th:nth-child(2) { width: 9%; }
.tenant-users-table th:nth-child(3) { width: 18%; }
.tenant-users-table th:nth-child(4) { width: 20%; }
.tenant-users-table th:nth-child(5) { width: 22%; }
.tenant-users-table th:nth-child(6) { width: 13%; }

.tenant-users-table th {
    background: #eef4f7;
    color: #405666;
    font-size: 12px;
    white-space: nowrap;
}

.tenant-users-table td {
    vertical-align: middle;
}

.tenant-users-table tbody tr:nth-child(even) {
    background: #fbfcfd;
}

.tenant-users-table tbody tr:hover {
    background: #edf7f9;
}

.tenant-user-identity {
    display: grid;
    gap: 2px;
    min-width: 140px;
}

.tenant-user-identity strong {
    color: #183b56;
    font-size: 13px;
}

.tenant-user-identity small,
.tenant-user-state {
    color: #71808c;
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

.tenant-users-table input {
    border: 1px solid #c8d4dd;
    min-height: 40px;
    min-width: 0;
    width: 100%;
}

.tenant-users-table input:focus {
    border-color: #1376a8;
    box-shadow: 0 0 0 3px rgba(19, 118, 168, .12);
    outline: 0;
}

.tenant-user-save {
    min-height: 40px;
    min-width: 88px;
    white-space: nowrap;
}

.tenant-user-save:disabled {
    cursor: wait;
    opacity: .68;
}

.tenant-help-panel {
    background: #fff;
}

@media (max-width: 900px) {
    .tenant-admin-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .tenant-admin-app {
        margin: 8px auto calc(16px + var(--safe-area-bottom));
        width: min(100% - 16px, 1180px);
    }

    .tenant-admin-topbar {
        min-height: 0;
        padding: 14px;
    }

    .tenant-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tenant-summary-bar > div:nth-child(2) {
        border-left: 0;
    }

    .tenant-summary-bar > div:nth-child(-n+2) {
        border-bottom: 1px solid #e3e9ee;
    }

    .tenant-form-card .section-title,
    .tenant-list-card .section-title {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .tenant-form-mode,
    .tenant-maintenance-status,
    .tenant-list-count {
        grid-column: 2;
        grid-row: auto;
        justify-self: start;
        margin-top: 6px;
    }

    .tenant-code-line {
        grid-template-columns: 1fr;
    }

    .tenant-code-line .tenant-inline-button {
        width: 100%;
    }

    .tenant-table {
        min-width: 0;
    }

    .tenant-users-title {
        align-items: flex-start;
    }

    .tenant-users-table {
        min-width: 760px;
    }
}

/* Support-only tenant restore */
.tenant-restore-app {
    width: min(1220px, calc(100% - 24px));
}

.tenant-restore-topbar {
    background:
        linear-gradient(90deg, rgba(19, 113, 129, .08), rgba(41, 91, 132, .04)),
        #fff;
    border-bottom-color: #bad5dc;
}

.restore-safety-strip {
    background: #f7fafb;
    border: 1px solid #cbdce2;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
    overflow: hidden;
}

.restore-safety-strip > div {
    align-items: center;
    border-left: 1px solid #d9e5e9;
    color: #425b68;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    gap: 9px;
    min-height: 58px;
    padding: 10px 14px;
}

.restore-safety-strip > div:last-child {
    border-left: 0;
}

.restore-safety-strip b {
    align-items: center;
    background: #dceff0;
    border: 1px solid #b8d9dc;
    border-radius: 50%;
    color: #17636d;
    display: inline-flex;
    flex: 0 0 29px;
    height: 29px;
    justify-content: center;
}

.restore-upload-card,
.restore-confirm-card,
.restore-result-card,
.restore-side-card,
.restore-log-card {
    border-color: #cad9df;
    box-shadow: 0 7px 20px rgba(24, 56, 74, .05);
}

.restore-upload-card .section-title::before,
.restore-log-card .section-title::before {
    background-image: url("../icons/tenant-admin/recovery.png");
}

.restore-input-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
}

.restore-input-grid label,
.restore-confirm-card label {
    color: #344b5b;
    font-size: 12px;
    font-weight: 800;
}

.restore-input-grid input,
.restore-input-grid select,
.restore-confirm-card input[type="text"] {
    min-height: 44px;
}

.restore-input-grid input[type="file"] {
    background: #f8fbfc;
    border: 1px dashed #96b8c4;
    padding: 8px;
}

.restore-input-grid small {
    color: #71818c;
    display: block;
    font-size: 11px;
    margin-top: 5px;
}

.restore-inspect-button {
    margin-top: 14px;
    min-height: 46px;
}

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

.restore-side-card {
    margin: 0;
}

.restore-side-card.source {
    box-shadow: inset 0 4px #2e8b93, 0 7px 20px rgba(24, 56, 74, .05);
}

.restore-side-card.target {
    box-shadow: inset 0 4px #356e9e, 0 7px 20px rgba(24, 56, 74, .05);
}

.restore-side-card dl {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.restore-side-card dl > div {
    border-bottom: 1px solid #e2e9ed;
    min-width: 0;
    padding: 9px 10px;
}

.restore-side-card dt {
    color: #77858e;
    font-size: 10px;
    font-weight: 800;
}

.restore-side-card dd {
    color: #263f4d;
    font-size: 13px;
    font-weight: 900;
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.restore-warning {
    background: #fff6e8;
    border: 1px solid #ebc783;
    border-radius: 5px;
    color: #7a4a08;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.restore-capacity-error {
    background: #fdecec;
    border: 1px solid #e7b4b4;
    border-radius: 5px;
    color: #8c2929;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 10px;
    padding: 12px 14px;
}

.restore-acknowledgement {
    align-items: center;
    background: #f6f9fa;
    border: 1px solid #d5e0e4;
    border-radius: 5px;
    display: flex;
    gap: 9px;
    margin-bottom: 13px;
    padding: 11px 12px;
}

.restore-acknowledgement input {
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.restore-confirm-phrase {
    background: #edf3f6;
    border: 1px solid #c9d8de;
    border-radius: 4px;
    color: #173e55;
    display: inline-block;
    font-family: Consolas, monospace;
    margin: 0 6px;
    padding: 3px 7px;
}

.restore-final-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.restore-final-actions .danger {
    background: #a93c3c;
    border: 1px solid #8e3030;
    color: #fff;
    min-height: 46px;
}

.restore-final-actions .danger:hover {
    background: #8f3030;
}

.restore-final-actions .danger:disabled {
    background: #a9b2b7;
    border-color: #98a2a8;
    cursor: not-allowed;
}

.restore-running-notice {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    color: #1e3a5f;
    background: #eff6ff;
}

.restore-running-notice[hidden] {
    display: none;
}

.restore-running-notice strong {
    color: #075985;
}

.restore-summary-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.restore-summary-grid > div {
    background: #f1f7f6;
    border: 1px solid #cce1dc;
    border-radius: 5px;
    padding: 10px;
}

.restore-summary-grid span {
    color: #647a7c;
    display: block;
    font-size: 10px;
}

.restore-summary-grid b {
    color: #176657;
    display: block;
    font-size: 18px;
    margin-top: 4px;
}

.restore-safety-file {
    color: #435966;
    font-size: 11px;
    margin: 12px 0 0;
}

.restore-log-card {
    margin-top: 12px;
}

.restore-log-table {
    min-width: 1050px;
}

.restore-log-table td {
    font-size: 11px;
}

.restore-status {
    background: #e9eff2;
    border: 1px solid #ccd9de;
    border-radius: 999px;
    color: #4b616d;
    display: inline-block;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 8px;
    white-space: nowrap;
}

.restore-status.success {
    background: #e5f5ee;
    border-color: #b5ddcd;
    color: #17674e;
}

.restore-status.failed {
    background: #fff1df;
    border-color: #edcc9e;
    color: #8a510b;
}

.restore-status.rollback_failed {
    background: #fdeaea;
    border-color: #edbcbc;
    color: #9b2f2f;
}

.restore-log-table small {
    color: #9b2f2f;
    display: block;
    font-size: 9px;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .restore-safety-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .restore-safety-strip > div:nth-child(2) {
        border-left: 0;
    }

    .restore-safety-strip > div:nth-child(-n+2) {
        border-bottom: 1px solid #d9e5e9;
    }

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

@media (max-width: 700px) {
    .tenant-restore-app {
        width: min(100% - 16px, 1220px);
    }

    .restore-safety-strip,
    .restore-input-grid,
    .restore-compare-grid,
    .restore-side-card dl {
        grid-template-columns: 1fr;
    }

    .restore-safety-strip > div {
        border-bottom: 1px solid #d9e5e9;
        border-left: 0;
    }

    .restore-safety-strip > div:last-child {
        border-bottom: 0;
    }

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

    .restore-final-actions > * {
        justify-content: center;
        width: 100%;
    }
}
