/* =========================================================
   Aqua — design system
   Только оформление: цвета, типографика, отступы, поверхности
   ========================================================= */

:root {
    --ink: #0f1b2d;
    --ink-soft: #33445c;
    --muted: #6b7a90;
    --line: #e3ebf4;
    --line-soft: #eef3f9;
    --bg: #f4f7fb;
    --surface: #ffffff;

    --brand: #0ea5b7;
    --brand-dark: #0b8292;
    --brand-blue: #2563eb;
    --brand-gradient: linear-gradient(135deg, #0ea5b7 0%, #2563eb 100%);
    --brand-soft: rgba(14, 165, 183, .1);
    --brand-soft-blue: rgba(37, 99, 235, .1);

    --radius-lg: 20px;
    --radius: 16px;
    --radius-sm: 12px;

    --shadow-xs: 0 1px 2px rgba(15, 27, 45, .05);
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .04), 0 10px 28px rgba(15, 27, 45, .055);
    --shadow-md: 0 18px 45px rgba(15, 27, 45, .1);
}

/* ---------- База ---------- */

html,
body {
    height: 100%;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 420px at 8% -10%, rgba(14, 165, 183, .10), transparent 65%),
        radial-gradient(800px 380px at 100% 0%, rgba(37, 99, 235, .09), transparent 60%);
    background-repeat: no-repeat;
    font-size: .94rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ink);
    font-weight: 750;
    letter-spacing: -.02em;
}

a {
    color: var(--brand-blue);
}

a:hover {
    color: var(--brand-dark);
}

hr {
    border-color: var(--line);
    opacity: 1;
}

.text-muted {
    color: var(--muted) !important;
}

::selection {
    background: rgba(14, 165, 183, .22);
}

/* ---------- Шапка сайта ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: .75rem 0;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(227, 235, 244, .9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
}

.app-brand:hover {
    color: var(--ink);
}

.app-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--brand-gradient);
    border-radius: 13px;
    box-shadow: 0 8px 18px rgba(14, 165, 183, .35);
}

.app-brand-mark svg {
    width: 22px;
    height: 22px;
}

.app-brand-name {
    display: block;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.app-brand-tag {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
}

.app-nav {
    display: flex;
    align-items: center;
    gap: .15rem;
    margin-left: .75rem;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .8rem;
    color: var(--ink-soft);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: background .15s ease, color .15s ease;
}

.app-nav-link svg {
    width: 16px;
    height: 16px;
    opacity: .7;
}

.app-nav-link:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.app-nav-link.active {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.app-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.app-user-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .8rem .3rem .35rem;
    color: var(--ink);
    background: #f6f9fc;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 650;
    text-decoration: none;
}

.app-user-chip:hover {
    color: var(--ink);
    border-color: rgba(14, 165, 183, .4);
    background: #fff;
}

.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #fff;
    background: var(--brand-gradient);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ---------- Основной контент ---------- */

.app-main {
    flex: 1 0 auto;
    padding: 1.75rem 0 2.5rem;
}

.app-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-main > .container,
.app-main > .container-fluid {
    padding: 0 1.5rem 1.5rem;
}

/* Хлебные крошки */
.breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .15rem;
    margin: 0 0 1.1rem;
    padding: .45rem .85rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
    font-size: .8rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #b7c3d2;
}

.breadcrumb-item > a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb-item > a:hover {
    color: var(--brand-dark);
}

/* Заголовок страницы */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.page-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.page-subtitle {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .45rem;
    padding: .25rem .6rem;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page-kicker svg {
    width: 13px;
    height: 13px;
}

.section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -.01em;
}

/* ---------- Карточки ---------- */

.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    --bs-card-cap-bg: transparent;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    background: transparent;
    border-bottom: 1px solid var(--line-soft);
}

.card-header:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-body {
    padding: 1.15rem 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--line-soft);
}

.card-hover {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    border-color: rgba(14, 165, 183, .35);
    box-shadow: var(--shadow-md);
}

/* ---------- Кнопки ---------- */

.btn {
    --bs-btn-border-radius: 11px;
    --bs-btn-font-weight: 650;
    --bs-btn-font-size: .875rem;
    padding: .52rem 1rem;
    border-radius: 11px;
    letter-spacing: -.01em;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}

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

.btn-primary {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: transparent;
    background-image: var(--brand-gradient);
    color: #fff;
    border: 0;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-image: var(--brand-gradient);
    filter: brightness(1.05);
    box-shadow: 0 10px 22px rgba(37, 99, 235, .3);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-dark);
    --bs-btn-border-color: rgba(14, 165, 183, .45);
    --bs-btn-hover-bg: var(--brand-soft);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-hover-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-soft);
    --bs-btn-active-color: var(--brand-dark);
    background: #fff;
}

.btn-success {
    --bs-btn-bg: #14a06a;
    --bs-btn-border-color: #14a06a;
    --bs-btn-hover-bg: #118a5b;
    --bs-btn-hover-border-color: #118a5b;
    box-shadow: 0 6px 14px rgba(20, 160, 106, .2);
}

.btn-danger {
    --bs-btn-bg: #e25563;
    --bs-btn-border-color: #e25563;
    --bs-btn-hover-bg: #cd4553;
    --bs-btn-hover-border-color: #cd4553;
    box-shadow: 0 6px 14px rgba(226, 85, 99, .18);
}

.btn-info {
    --bs-btn-bg: var(--brand-soft);
    --bs-btn-border-color: transparent;
    --bs-btn-color: var(--brand-dark);
    --bs-btn-hover-bg: rgba(14, 165, 183, .18);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-hover-color: var(--brand-dark);
}

.btn-light,
.btn-outline-secondary {
    --bs-btn-color: var(--ink-soft);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: #f4f8fc;
    --bs-btn-hover-border-color: #cfdbe8;
    --bs-btn-hover-color: var(--ink);
    background: #fff;
}

.btn-ghost {
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.btn-sm {
    --bs-btn-padding-y: .35rem;
    --bs-btn-padding-x: .7rem;
    --bs-btn-font-size: .8rem;
    --bs-btn-border-radius: 9px;
}

.btn-lg {
    --bs-btn-padding-y: .7rem;
    --bs-btn-padding-x: 1.35rem;
    --bs-btn-font-size: .95rem;
    --bs-btn-border-radius: 13px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon:hover {
    color: var(--brand-dark);
    border-color: rgba(14, 165, 183, .45);
    background: var(--brand-soft);
}

/* ---------- Формы ---------- */

.form-label {
    margin-bottom: .4rem;
    font-size: .83rem;
    font-weight: 650;
    color: var(--ink-soft);
}

.form-control,
.form-select {
    padding: .6rem .85rem;
    color: var(--ink);
    background-color: #fff;
    border: 1px solid #dbe4ee;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    box-shadow: none;
}

.form-control::placeholder {
    color: #a6b3c4;
}

.form-control:focus,
.form-select:focus {
    color: var(--ink);
    background-color: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(14, 165, 183, .13);
}

.form-select {
    padding-right: 2.2rem;
}

.form-text,
.hint-block {
    display: block;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .78rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(14, 165, 183, .13);
}

.invalid-feedback {
    font-size: .8rem;
}

.form-card {
    max-width: 780px;
    margin: 0 auto;
}

.form-card-wide {
    max-width: 100%;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding-top: .35rem;
}

/* ---------- Таблицы ---------- */

.table-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.table-card .table {
    margin-bottom: 0;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink-soft);
    margin-bottom: 0;
    font-size: .875rem;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: .8rem .95rem;
    border-bottom-color: var(--line-soft);
}

.table > thead > tr > th {
    padding: .7rem .95rem;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #f7fafc;
    color: var(--ink);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #fbfcfe;
    color: inherit;
}

.table-sm > :not(caption) > * > * {
    padding: .6rem .8rem;
}

.table .fw-semibold {
    font-weight: 650;
}

.table-actions {
    display: inline-flex;
    gap: .35rem;
}

/* ---------- Бейджи и статусы ---------- */

.badge {
    padding: .42em .7em;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .01em;
}

.badge.bg-light {
    color: var(--ink-soft) !important;
    background: #f1f5fa !important;
    border: 1px solid var(--line);
}

.badge.bg-success {
    color: #0d7a50 !important;
    background: rgba(20, 160, 106, .13) !important;
}

.badge.bg-danger {
    color: #bc3c4a !important;
    background: rgba(226, 85, 99, .13) !important;
}

.badge.bg-warning {
    color: #a16207 !important;
    background: rgba(245, 176, 32, .18) !important;
}

.badge.bg-info {
    color: var(--brand-dark) !important;
    background: var(--brand-soft) !important;
}

.badge.bg-primary {
    color: #1d4ed8 !important;
    background: var(--brand-soft-blue) !important;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.badge-soft svg {
    width: 12px;
    height: 12px;
}

/* ---------- Алерты ---------- */

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    box-shadow: var(--shadow-xs);
}

.alert-success {
    color: #0d7a50;
    background: #eefaf4;
    border-color: #c9efdd;
}

.alert-danger {
    color: #a8323f;
    background: #fdf1f2;
    border-color: #f6d3d7;
}

.alert-info {
    color: #0b6673;
    background: #eefafb;
    border-color: #c9ecf1;
}

.alert-warning {
    color: #8a5a06;
    background: #fff9ec;
    border-color: #f7e4b8;
}

/* ---------- Hero / главная ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 2.1rem 2.2rem;
    color: #fff;
    background: var(--brand-gradient);
    border-radius: var(--radius-lg);
    box-shadow: 0 22px 48px rgba(37, 99, 235, .26);
}

.hero::after {
    content: "";
    position: absolute;
    top: -70px;
    right: -40px;
    width: 290px;
    height: 290px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.hero::before {
    content: "";
    position: absolute;
    bottom: -110px;
    right: 130px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.hero-title {
    margin: 0 0 .5rem;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.03em;
    color: #fff;
}

.hero-text {
    margin: 0 0 1.4rem;
    color: rgba(255, 255, 255, .82);
    font-size: .95rem;
}

.hero .btn-light {
    color: var(--brand-dark);
    font-weight: 700;
    border: 0;
}

.hero .btn-outline-light {
    border-color: rgba(255, 255, 255, .55);
}

.hero-stats {
    display: flex;
    gap: 1.75rem;
    margin-top: 1.6rem;
}

.hero-stat-value {
    font-size: 1.35rem;
    font-weight: 750;
    line-height: 1.1;
}

.hero-stat-label {
    font-size: .72rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
}

/* Карточка мойки */
.wash-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 13px;
}

.wash-card-icon svg {
    width: 20px;
    height: 20px;
}

.wash-card-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -.01em;
}

.wash-card-meta {
    color: var(--muted);
    font-size: .8rem;
}

/* ---------- Боксы ---------- */

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.page-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.page-actions .btn svg {
    width: 15px;
    height: 15px;
}

/* Сводка по смене */

.ops-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.ops-stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    overflow: hidden;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.ops-stat::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -52px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--ops-tint, rgba(14, 165, 183, .08));
    pointer-events: none;
}

.ops-stat > * {
    position: relative;
    z-index: 1;
}

.ops-stat.is-green {
    --ops-color: #0d7a50;
    --ops-soft: rgba(20, 160, 106, .12);
    --ops-tint: rgba(20, 160, 106, .09);
}

.ops-stat.is-amber {
    --ops-color: #a16207;
    --ops-soft: rgba(245, 176, 32, .18);
    --ops-tint: rgba(245, 176, 32, .12);
}

.ops-stat.is-slate {
    --ops-color: #5b6b80;
    --ops-soft: #eef2f7;
    --ops-tint: rgba(107, 122, 144, .09);
}

.ops-stat.is-brand {
    --ops-color: var(--brand-dark);
    --ops-soft: var(--brand-soft);
    --ops-tint: rgba(14, 165, 183, .1);
}

.ops-stat-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--ops-color, var(--brand-dark));
    background: var(--ops-soft, var(--brand-soft));
    border-radius: 12px;
}

.ops-stat-icon svg {
    width: 19px;
    height: 19px;
}

.ops-stat-label {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.ops-stat-value {
    margin-top: .15rem;
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.ops-stat-total {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: 0;
}

.ops-stat-caption {
    margin-top: .2rem;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.35;
}

.ops-progress {
    height: 4px;
    margin-top: .45rem;
    overflow: hidden;
    background: #eef2f7;
    border-radius: 999px;
}

.ops-progress span {
    display: block;
    height: 100%;
    background: var(--brand-gradient);
    border-radius: inherit;
}

/* Панель фильтров */

.box-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .85rem;
    margin-bottom: 1rem;
}

.section-sub {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .84rem;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    margin-left: .4rem;
    padding: 0 .45rem;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
}

.box-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .2rem;
    padding: .25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
}

.box-filter {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .7rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.box-filter:hover {
    color: var(--ink);
    background: #f4f8fc;
}

.box-filter.is-active {
    color: #fff;
    background: var(--ink);
    box-shadow: 0 4px 10px rgba(15, 27, 45, .16);
}

.box-filter-count {
    min-width: 1.35rem;
    padding: .1rem .35rem;
    color: var(--muted);
    background: #f1f5fa;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
}

.box-filter.is-active .box-filter-count {
    color: #fff;
    background: rgba(255, 255, 255, .18);
}

/* Сетка и карточки боксов */

.box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.box-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-top: 3px solid var(--state-color, var(--line));
    transition: box-shadow .18s ease;
}

.box-card:hover {
    box-shadow: var(--shadow-md);
}

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

.box-card.is-free {
    --state-color: #14a06a;
    border-color: rgba(20, 160, 106, .3);
    border-top-color: var(--state-color);
}

.box-card.is-busy {
    --state-color: #f5b020;
    border-color: rgba(245, 176, 32, .45);
    border-top-color: var(--state-color);
}

.box-card.is-closed {
    --state-color: #b7c3d2;
    border-color: var(--line);
    border-top-color: var(--state-color);
}

.box-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.25rem;
}

.box-card .card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.box-title {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: .95rem;
    font-weight: 700;
}

.box-title svg {
    width: 17px;
    height: 17px;
    color: var(--brand-dark);
}

.box-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.box-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.box-status.is-free {
    color: #0d7a50;
    background: rgba(20, 160, 106, .12);
}

.box-status.is-busy {
    color: #b06a00;
    background: rgba(245, 176, 32, .16);
}

.box-status.is-busy::before {
    animation: box-status-pulse 1.8s ease-in-out infinite;
}

.box-status.is-closed {
    color: #6b7a90;
    background: #eef2f7;
}

@keyframes box-status-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: .4;
        transform: scale(.75);
    }
}

/* Содержимое занятого бокса */

.box-vehicle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.box-plate {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .65rem;
    color: var(--ink);
    background: #f7fafc;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.box-plate svg {
    width: 14px;
    height: 14px;
    color: var(--muted);
}

.box-vehicle {
    margin-top: .4rem;
    color: var(--muted);
    font-size: .8rem;
}

.box-elapsed {
    flex-shrink: 0;
    text-align: right;
}

.box-elapsed-value {
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.box-elapsed-label {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.box-people {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line-soft);
}

.box-person {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

.box-person-icon,
.box-person-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
}

.box-person-icon {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.box-person-icon svg {
    width: 16px;
    height: 16px;
}

.box-person-avatar {
    color: #fff;
    background: var(--brand-gradient);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.box-person-body {
    min-width: 0;
}

.box-person-label {
    color: var(--muted);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.box-person-name {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.box-person-name:hover {
    color: var(--brand-dark);
}

.box-person-meta {
    display: block;
    overflow: hidden;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.4;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.box-person-meta:hover {
    color: var(--brand-dark);
}

.box-timeline {
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px dashed var(--line-soft);
}

.box-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .45rem;
}

.box-timeline-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
}

.box-timeline-label svg {
    width: 13px;
    height: 13px;
}

.box-progress {
    height: 6px;
    overflow: hidden;
    background: #eef2f7;
    border-radius: 999px;
}

.box-progress-bar {
    display: block;
    height: 100%;
    background: var(--brand-gradient);
    border-radius: inherit;
    transition: width .4s ease;
}

.box-services {
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px dashed var(--line-soft);
}

.box-section-label {
    margin-bottom: .35rem;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.box-service-list {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.box-service {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .25rem 0;
    border-bottom: 1px dashed var(--line-soft);
}

.box-service:last-child {
    border-bottom: 0;
}

.box-service-name {
    color: var(--ink-soft);
    font-size: .83rem;
}

.box-service-price {
    color: var(--ink);
    font-size: .83rem;
    font-weight: 700;
    white-space: nowrap;
}

.box-service-empty {
    color: var(--muted);
    font-size: .8rem;
    font-style: italic;
}

.box-note {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-top: .9rem;
    padding: .55rem .7rem;
    color: #8a5a06;
    background: #fff9ec;
    border: 1px solid #f7e4b8;
    border-radius: 10px;
    font-size: .78rem;
    line-height: 1.45;
}

.box-note svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 2px;
}

.box-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .9rem 1.25rem;
    background: #fbfcfe;
    border-top: 1px solid var(--line-soft);
}

.box-total {
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.box-total-label {
    color: var(--muted);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.box-total-value {
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.box-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}

.box-actions form {
    margin: 0;
}

.box-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.box-actions .btn svg {
    width: 14px;
    height: 14px;
}

.complete-payment {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.complete-payment .btn {
    flex: 1 1 9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.complete-payment .btn svg {
    width: 16px;
    height: 16px;
}

.btn-outline-danger {
    --bs-btn-color: #bc3c4a;
    --bs-btn-border-color: rgba(226, 85, 99, .4);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #e25563;
    --bs-btn-hover-border-color: #e25563;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #cd4553;
    --bs-btn-active-border-color: #cd4553;
    background: #fff;
}

/* Пустые состояния боксов */

.box-empty-state {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 220px;
    padding: 1.5rem .75rem;
    text-align: center;
}

.box-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: .15rem;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 16px;
}

.box-empty-icon svg {
    width: 24px;
    height: 24px;
}

.box-empty-icon.is-muted {
    color: var(--muted);
    background: #f1f5fa;
}

.box-empty-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -.01em;
}

.box-empty-text {
    max-width: 280px;
    margin: 0;
    color: var(--muted);
    font-size: .83rem;
    line-height: 1.5;
}

.box-empty-state .btn {
    margin-top: .35rem;
}

.box-empty-state .btn svg {
    width: 14px;
    height: 14px;
}

/* Ближайшие записи */

.upcoming-section {
    margin-top: 1.8rem;
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.upcoming-item:hover {
    border-color: rgba(14, 165, 183, .35);
    box-shadow: var(--shadow-sm);
}

.upcoming-date {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #f7fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.upcoming-date.is-soon {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-color: rgba(14, 165, 183, .28);
}

.upcoming-day {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.upcoming-month {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.upcoming-date.is-soon .upcoming-month {
    color: var(--brand-dark);
}

.upcoming-info {
    flex: 1 1 auto;
    min-width: 0;
}

.upcoming-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}

.upcoming-relative {
    padding: .2rem .45rem;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.upcoming-time {
    color: var(--ink);
    font-size: .86rem;
    font-weight: 700;
}

.upcoming-client {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .15rem;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 600;
}

.upcoming-client .text-muted {
    font-weight: 500;
}

.upcoming-note {
    margin-top: .1rem;
    overflow-wrap: anywhere;
}

.upcoming-phone {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .8rem;
}

.upcoming-phone a {
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
}

.upcoming-phone a:hover {
    color: var(--brand-dark);
}

.upcoming-actions {
    display: flex;
    flex-shrink: 0;
    gap: .35rem;
}

.upcoming-empty {
    margin-top: .25rem;
}

.upcoming-empty .btn svg {
    width: 14px;
    height: 14px;
}

/* Адаптивность дашборда */

@media (max-width: 1199.98px) {
    .ops-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .box-grid {
        grid-template-columns: 1fr;
    }

    .box-toolbar {
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .ops-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
    }

    .ops-stat {
        flex-direction: column;
        gap: .55rem;
        padding: .9rem;
    }

    .ops-stat-icon {
        width: 34px;
        height: 34px;
    }

    .ops-stat-icon svg {
        width: 17px;
        height: 17px;
    }

    .ops-stat-value {
        font-size: 1.35rem;
    }

    .ops-stat-caption {
        font-size: .7rem;
    }

    .box-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        border-radius: 14px;
    }

    .box-filter {
        justify-content: center;
    }

    .box-people {
        grid-template-columns: 1fr;
    }

    .box-card-footer {
        align-items: flex-start;
    }

    .box-actions {
        width: 100%;
    }

    .box-actions form {
        flex: 1 1 auto;
    }

    .box-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .upcoming-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .upcoming-date {
        width: 46px;
        height: 46px;
    }

    .upcoming-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .box-status.is-busy::before {
        animation: none;
    }
}

/* ---------- Оформление мойки ---------- */

.cw-required {
    color: #e25563;
    font-weight: 700;
}

.cw-plate-input {
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: 1.15rem;
}

.form-section-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 12px;
}

.form-section-icon svg {
    width: 18px;
    height: 18px;
}

.form-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -.01em;
}

.form-section-sub {
    margin: .15rem 0 0;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

/* Плитки услуг */

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

.service-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0;
    padding: .8rem .9rem;
    background: #fff;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.service-card:hover {
    border-color: rgba(14, 165, 183, .45);
    box-shadow: var(--shadow-xs);
}

.service-card.is-selected {
    background: linear-gradient(0deg, rgba(14, 165, 183, .06), rgba(14, 165, 183, .06)), #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 165, 183, .12);
}

.service-grid.is-invalid .service-card {
    border-color: rgba(226, 85, 99, .55);
}

.service-card-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.service-card-check {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    color: #fff;
    background: #fff;
    border: 1.5px solid #c3cfdd;
    border-radius: 7px;
    transition: background .15s ease, border-color .15s ease;
}

.service-card-check svg {
    width: 13px;
    height: 13px;
    opacity: 0;
    transition: opacity .15s ease;
}

.service-card.is-selected .service-card-check {
    background: var(--brand-gradient);
    border-color: transparent;
}

.service-card.is-selected .service-card-check svg {
    opacity: 1;
}

.service-card-input:focus-visible ~ .service-card-check {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(14, 165, 183, .18);
}

.service-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.service-card-name {
    display: block;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.3;
}

.service-card-meta {
    display: block;
    color: var(--muted);
    font-size: .74rem;
}

.service-card-price {
    flex-shrink: 0;
    color: var(--ink);
    font-size: .86rem;
    font-weight: 750;
    white-space: nowrap;
}

/* Итог заказа */

.summary-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.summary-client {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .85rem;
    background: #f7fafc;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
}

.summary-client-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--brand-dark);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.summary-client-icon svg {
    width: 19px;
    height: 19px;
}

.summary-client-info {
    min-width: 0;
}

.summary-client-plate {
    color: var(--ink);
    font-size: .92rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.summary-client-meta {
    overflow: hidden;
    color: var(--muted);
    font-size: .77rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-client-meta.is-empty {
    color: #a6b3c4;
    font-style: italic;
}

.summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0;
    color: var(--muted);
    font-size: .8rem;
}

.summary-row-value {
    overflow: hidden;
    max-width: 65%;
    color: var(--ink);
    font-weight: 650;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 1rem 0 .5rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.summary-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    font-size: .83rem;
}

.summary-item-name {
    color: var(--ink-soft);
}

.summary-item-price {
    color: var(--ink);
    font-weight: 650;
    white-space: nowrap;
}

.summary-empty {
    padding: .55rem 0;
    color: #a6b3c4;
    font-size: .82rem;
    font-style: italic;
}

.summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    color: var(--ink-soft);
    font-size: .85rem;
    font-weight: 650;
}

.summary-total-value {
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.summary-note {
    margin: .7rem 0 0;
    color: var(--muted);
    font-size: .74rem;
    text-align: center;
}

@media (min-width: 992px) {
    .summary-card {
        position: sticky;
        top: 5.25rem;
    }
}

@media (max-width: 575.98px) {
    .service-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Auth ---------- */

.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 290px);
    padding: 1rem 0 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    color: #fff;
    background: var(--brand-gradient);
    border-radius: 15px;
    box-shadow: 0 10px 22px rgba(14, 165, 183, .3);
}

.auth-title {
    margin: 0 0 .3rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-subtitle {
    margin: 0 0 1.4rem;
    color: var(--muted);
    font-size: .88rem;
}

.auth-links {
    margin-top: 1.1rem;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.9;
}

/* ---------- Профиль ---------- */

.profile-card {
    text-align: center;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(15, 27, 45, .12);
}

.profile-name {
    margin: .9rem 0 .15rem;
    font-size: 1.15rem;
    font-weight: 750;
}

.profile-role {
    color: var(--muted);
    font-size: .82rem;
}

.profile-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--line-soft);
}

.profile-row:last-of-type {
    border-bottom: 0;
}

.profile-row-label {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.profile-row-value {
    color: var(--ink);
    font-size: .92rem;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* ---------- Футер ---------- */

.footer {
    flex-shrink: 0;
    padding: 1.25rem 0;
    color: var(--muted);
    font-size: .82rem;
    background: transparent;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer a {
    color: var(--muted);
    text-decoration: none;
}

.footer a:hover {
    color: var(--brand-dark);
}

/* ---------- Сайдбар управления (layout test) ---------- */

.mgmt-body {
    background-color: var(--bg);
}

.mgmt-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    width: 264px;
    padding: 1.25rem 1rem;
    overflow-y: auto;
    color: #c8d4e4;
    background: linear-gradient(180deg, #0b1424 0%, #101f38 60%, #0c1a2f 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.mgmt-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .25rem .5rem 1.25rem;
    color: #fff;
    text-decoration: none;
}

.mgmt-brand:hover {
    color: #fff;
}

.mgmt-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: var(--brand-gradient);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(14, 165, 183, .35);
}

.mgmt-brand-mark svg {
    width: 21px;
    height: 21px;
}

.mgmt-brand-name {
    display: block;
    font-size: .98rem;
    font-weight: 750;
    line-height: 1.15;
}

.mgmt-brand-tag {
    display: block;
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(200, 212, 228, .6);
}

.mgmt-section-label {
    padding: .35rem .75rem .5rem;
    color: rgba(200, 212, 228, .45);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mgmt-nav {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mgmt-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .75rem;
    color: #c8d4e4;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 11px;
    transition: background .15s ease, color .15s ease;
}

.mgmt-nav-link svg {
    width: 17px;
    height: 17px;
    opacity: .75;
}

.mgmt-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.mgmt-nav-link.active {
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: 0 10px 20px rgba(14, 165, 183, .28);
}

.mgmt-nav-link.active svg {
    opacity: 1;
}

.mgmt-sidebar-footer {
    margin-top: 1.5rem;
    padding: .9rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 13px;
}

.mgmt-sidebar-footer-label {
    color: rgba(200, 212, 228, .55);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mgmt-sidebar-footer-name {
    margin-top: .2rem;
    color: #fff;
    font-size: .9rem;
    font-weight: 650;
    word-break: break-word;
}

.mgmt-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mgmt-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.75rem;
    background: rgba(255, 255, 255, .85);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mgmt-topbar-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -.01em;
}

.mgmt-topbar-sub {
    color: var(--muted);
    font-size: .78rem;
}

.mgmt-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 1.6rem 1.75rem 2.5rem;
}

.mgmt-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

@media (min-width: 768px) {
    .mgmt-content {
        margin-left: 264px;
    }
}

@media (max-width: 767.98px) {
    .mgmt-sidebar {
        position: static;
        width: 100%;
        padding: .9rem 1rem;
    }

    .mgmt-sidebar.collapse:not(.show) {
        display: none;
    }

    .mgmt-sidebar .mgmt-section-label {
        display: none;
    }

    .mgmt-sidebar .mgmt-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: .35rem;
    }

    .mgmt-sidebar .mgmt-nav-link {
        padding: .5rem .7rem;
        font-size: .82rem;
    }

    .mgmt-sidebar-footer {
        display: none;
    }

    .mgmt-toggle {
        display: inline-flex;
    }

    .mgmt-topbar,
    .mgmt-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ---------- Утилиты ---------- */

.not-set {
    color: #c55;
    font-style: italic;
}

.grid-view th,
.grid-view td:last-child {
    white-space: nowrap;
}

.grid-view .filters input,
.grid-view .filters select {
    min-width: 50px;
}

a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px var(--ink);
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px var(--ink);
    border-bottom-width: 0;
}

.error-summary {
    color: #a8323f;
    background: #fdf1f2;
    border-left: 3px solid #f6d3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
    border-radius: 10px;
}

.progress {
    height: .5rem;
    overflow: hidden;
    background-color: #eef2f7;
    border-radius: 1rem;
}

.progress-bar {
    background: var(--brand-gradient);
}

/* Пагинация */
.pagination {
    gap: .3rem;
    margin: 0;
}

.pagination .page-link {
    min-width: 36px;
    padding: .45rem .65rem;
    color: var(--ink-soft);
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 600;
}

.pagination .page-link:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-color: rgba(14, 165, 183, .35);
}

.pagination .page-item.active .page-link {
    color: #fff;
    background: var(--brand-gradient);
    border-color: transparent;
}

.pagination .page-item.disabled .page-link {
    color: #a6b3c4;
    background: #f8fafc;
    border-color: var(--line);
}

/* Страница статистики: приводим палитру к общей теме */
.stats-page .stats-hero {
    background: var(--brand-gradient);
}

.stats-page .progress-bar.bg-primary {
    background: var(--brand-gradient) !important;
}

.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px dashed #cfdbe8;
    border-radius: var(--radius);
}

.empty-state svg {
    width: 34px;
    height: 34px;
    margin-bottom: .6rem;
    color: #b7c3d2;
}

.empty-state-title {
    margin: 0 0 .25rem;
    color: var(--ink);
    font-size: .98rem;
    font-weight: 700;
}

.mgmt-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
}

/* Кнопка выхода в шапке */
.app-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.app-logout:hover {
    color: #bc3c4a;
    background: #fdf1f2;
    border-color: #f6d3d7;
}

.app-logout svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 991.98px) {
    .app-header-inner {
        flex-wrap: wrap;
    }

    .app-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        padding-top: .5rem;
        border-top: 1px solid var(--line-soft);
    }

    .app-nav:not(.show) {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .app-header-inner,
    .app-container,
    .footer-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-brand-tag {
        display: none;
    }

    .hero {
        padding: 1.6rem 1.3rem;
    }

    .hero-title {
        font-size: 1.45rem;
    }

    .page-title {
        font-size: 1.35rem;
    }
}

/* ---------- Новая запись ---------- */

.nr-required {
    color: #e25563;
    font-weight: 700;
}

.nr-phone-input {
    font-weight: 650;
    letter-spacing: .05em;
}

.nr-card .card-body > :last-child,
.nr-card .form-group:last-child {
    margin-bottom: 0;
}

.nr-card .nr-date-input {
    cursor: pointer;
}

/* TimePicker is not a yii\widgets\InputWidget, so Bootstrap 5 hides its server-side error. */
.field-newrecordform-date .invalid-feedback:not(:empty) {
    display: block;
}

.field-newrecordform-date:has(.invalid-feedback:not(:empty)) .nr-date-input {
    border-color: #dc3545;
}

.field-newrecordform-date:has(.invalid-feedback:not(:empty)) .nr-date-input:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, .13);
}

.nr-card .input-group.datetime {
    display: flex;
    align-items: stretch;
}

.nr-card .input-group.datetime .input-group-addon {
    display: flex;
    align-items: center;
    padding: 0 .8rem;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border: 1px solid #dbe4ee;
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.nr-card .input-group.datetime .input-group-addon svg {
    width: 1rem;
    height: 1rem;
}

.nr-card .input-group.datetime .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nr-card .input-group.datetime .form-control:focus {
    position: relative;
    z-index: 1;
}

.nr-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0 0 1rem;
}

.nr-preset {
    padding: .4rem .75rem;
    color: var(--ink-soft);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.2;
    transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.nr-preset:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-color: rgba(14, 165, 183, .4);
}

.nr-preset:focus-visible {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-color: rgba(14, 165, 183, .4);
    outline: none;
    box-shadow: 0 0 0 4px rgba(14, 165, 183, .13);
}

.nr-summary .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.nr-preview {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1rem;
    padding: .85rem;
    background:
        radial-gradient(120px 80px at 100% 0, rgba(37, 99, 235, .1), transparent 70%),
        rgba(14, 165, 183, .06);
    border: 1px solid rgba(14, 165, 183, .2);
    border-radius: 14px;
}

.nr-preview-date {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow-xs);
}

.nr-preview-day {
    color: var(--ink);
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.nr-preview-month {
    margin-top: .1rem;
    color: var(--muted);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.nr-preview-info {
    min-width: 0;
}

.nr-preview-relative {
    color: var(--brand-dark);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.nr-preview-time {
    margin-top: .1rem;
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.nr-preview.is-empty .nr-preview-relative,
.nr-preview.is-empty .nr-preview-time {
    color: var(--muted);
}

.nr-preview-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px dashed var(--line-soft);
    font-size: .82rem;
}

.nr-preview-row:last-of-type {
    border-bottom: 0;
}

.nr-preview-label {
    color: var(--muted);
    white-space: nowrap;
}

.nr-preview-value {
    color: var(--ink);
    font-weight: 650;
    text-align: right;
    word-break: break-word;
}

.nr-preview-value.is-empty {
    color: #a6b3c4;
    font-style: italic;
    font-weight: 500;
}

@media (min-width: 992px) {
    .nr-summary {
        position: sticky;
        top: 5.25rem;
    }
}

/* ---------- Новая услуга ---------- */

.svc-card {
    position: relative;
    overflow: hidden;
}

.svc-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--brand-gradient);
}

.svc-input-group .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.9rem;
    padding: 0 .85rem;
    color: var(--brand-dark);
    background: #f4f9fc;
    border: 1px solid #dbe4ee;
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: .92rem;
    font-weight: 700;
}

.svc-input-group .input-group-text svg {
    width: 16px;
    height: 16px;
}

.svc-input-group .form-control {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.svc-input-group .form-control:focus {
    position: relative;
    z-index: 1;
}

.svc-input-group:has(.is-invalid) .input-group-text {
    border-color: #dc3545;
}

.svc-price-input {
    font-weight: 700;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}

.svc-hint {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-top: 1.35rem;
    padding: .9rem 1rem;
    background: linear-gradient(135deg, rgba(14, 165, 183, .07), rgba(37, 99, 235, .06));
    border: 1px solid rgba(14, 165, 183, .16);
    border-radius: 14px;
}

.svc-hint-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--brand-dark);
}

.svc-hint-icon svg {
    width: 17px;
    height: 17px;
}

.svc-hint-title {
    color: var(--ink);
    font-size: .83rem;
    font-weight: 700;
}

.svc-hint-text {
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.55;
}

.svc-preview {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1rem;
    padding: .9rem;
    background:
        radial-gradient(120px 80px at 100% 0, rgba(37, 99, 235, .1), transparent 70%),
        rgba(14, 165, 183, .06);
    border: 1px solid rgba(14, 165, 183, .2);
    border-radius: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.svc-preview.is-filled {
    border-color: rgba(14, 165, 183, .35);
    box-shadow: 0 10px 24px rgba(14, 165, 183, .12);
}

.svc-preview-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--brand-gradient);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(14, 165, 183, .25);
}

.svc-preview-icon svg {
    width: 19px;
    height: 19px;
}

.svc-preview-body {
    min-width: 0;
}

.svc-preview-name {
    color: var(--ink);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.svc-preview-name.is-empty {
    color: #a6b3c4;
    font-style: italic;
    font-weight: 500;
}

.svc-preview-price {
    margin-top: .2rem;
    color: var(--brand-dark);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.svc-preview-price.is-empty {
    color: #a6b3c4;
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: 0;
}
