:root {
    --bg: #eef4fb;
    --paper: #ffffff;
    --ink: #262626;
    --muted: #515151;
    --line: #c2cbd2;
    --accent: #2c5ea8;
    --accent-dark: #1f447b;
    --good: #2c5ea8;
    --bad: #992b25;
    --shadow: 0 16px 46px rgba(44, 94, 168, 0.14);
    /* Логотип: меняйте размеры здесь */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--muted);
    background:
        radial-gradient(circle at top left, rgba(44, 94, 168, 0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(30, 136, 229, 0.14), transparent 38%),
        linear-gradient(180deg, #f5f9ff 0%, #eef4fb 100%);
}

a {
    color: inherit;
}

.page-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero-card,
.panel,
.notice,
.summary-card {
    background: var(--paper);
    border: 1px solid rgba(98, 92, 84, 0.18);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    padding: 28px;
    margin-bottom: 24px;
}

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

.hero-copy {
    display: grid;
    align-content: start;
    padding-top: 4px;
}

.eyebrow,
.section-kicker,
.mini-label {
    margin: 0 0 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    font-weight: 700;
}

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

h1,
h2,
h3 {
    color: var(--accent);
}

h1 {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 0.96;
    margin-bottom: 12px;
}

.hero-title {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: clamp(30px, 3.8vw, 52px) !important;
    line-height: 1.02;
}

.hero-card--start .hero-title {
    font-size: clamp(30px, 3.8vw, 52px) !important;
    line-height: 0.98;
    letter-spacing: 0.01em;
}

.is-start .hero-title {
    max-width: 980px;
    font-size: clamp(30px, 3.8vw, 52px) !important;
    line-height: 0.96;
    letter-spacing: 0.01em;
    background: linear-gradient(90deg, #2c5ea8 0%, #1f447b 65%, #2c5ea8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.is-start .hero-title::after {
    content: "Статусы, фото и документы в одном окне";
    display: block;
    margin-top: 14px;
    font-size: clamp(15px, 1.4vw, 19px);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #4d617f;
    -webkit-text-fill-color: #4d617f;
}

.is-start .hero-text {
    max-width: 920px;
}

.is-dashboard .hero-title {
    max-width: 980px;
    font-size: clamp(30px, 3.8vw, 52px) !important;
    line-height: 0.96;
    letter-spacing: 0.01em;
    background: linear-gradient(90deg, #2c5ea8 0%, #1f447b 65%, #2c5ea8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.is-dashboard .hero-title::after {
    content: "Статусы, фото и документы в одном окне";
    display: block;
    margin-top: 14px;
    font-size: clamp(15px, 1.4vw, 19px);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #4d617f;
    -webkit-text-fill-color: #4d617f;
}

.is-dashboard .hero-text {
    max-width: 920px;
}

.is-dashboard .hero-card {
    grid-template-columns: 1fr;
}

h2 {
    font-size: 30px;
    margin-bottom: 10px;
}

.hero-text,
.section-text,
.empty-state {
    color: var(--muted);
    line-height: 1.6;
}

.hero-text--legacy {
    display: none;
}

.logo-card--partner::after {
    content: "ЦМС — Центральный Медицинский Склад";
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #2f5f93;
    text-align: right;
    line-height: 1.2;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.notice {
    padding: 16px 20px;
    margin-bottom: 18px;
}

.notice--error {
    border-color: rgba(153, 43, 37, 0.28);
    color: var(--bad);
    background: #fff2f1;
}

.notice--success {
    border-color: rgba(45, 108, 79, 0.24);
    color: var(--good);
    background: #f3fbf6;
}

.panel {
    padding: 26px;
    margin-bottom: 22px;
}

.support-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef4fb 100%);
    border-color: rgba(44, 94, 168, 0.22);
}

.support-panel__content h2 {
    margin-bottom: 8px;
}

.support-panel__content .section-text {
    margin: 0;
}

.support-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(44, 94, 168, 0.35);
    background: #ffffff;
    color: var(--accent-dark);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(44, 94, 168, 0.12);
    transition: transform 0.14s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.support-email:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(44, 94, 168, 0.18);
    background: #f3f8ff;
}

.partner-names-panel {
    padding: 14px 18px;
}

.partner-names-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.partner-names-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(44, 94, 168, 0.24);
    background: #f7faff;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.partner-names-item--with-logo {
    padding-left: 8px;
}

.partner-names-logo {
    display: inline-block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 20px;
}

.partner-logos-dock {
    padding: 12px 16px;
}

.partner-logos-dock--dashboard {
    padding-top: 18px;
}

.partner-logos-dock__track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    width: 100%;
}

.partner-logo-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: 62px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(44, 94, 168, 0.24);
    background: #f7faff;
    text-decoration: none;
}

.partner-logo-chip--static {
    cursor: default;
}

.partner-logo-chip img {
    display: block;
    max-width: 100%;
    max-height: 38px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.partner-logo-chip__label {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    padding: 0 6px;
}

.partner-logo-chip--with-name {
    justify-content: flex-start;
    padding: 8px 12px;
}

.partner-logo-chip--with-name .partner-logo-chip__label {
    display: inline-flex;
    flex: 1 1 auto;
    justify-content: flex-start;
    text-align: left;
}

.partner-logo-chip--with-name img {
    max-width: 48%;
}

.partner-logo-chip--primary {
    height: 62px;
    background: #ffffff;
}

.partner-logo-chip--primary img {
    max-height: 38px;
}

.login-panel {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 14px;
    font-weight: 600;
}

.field-hint {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
    color: #5e6875;
}

.field input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 16px;
}

.field input:focus {
    outline: 2px solid rgba(181, 77, 33, 0.2);
    border-color: rgba(181, 77, 33, 0.45);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.primary-button {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(44, 94, 168, 0.22);
}

.secondary-button {
    background: #e8eff9;
    color: var(--ink);
}

.primary-button:hover {
    background: var(--accent-dark);
    box-shadow: 0 12px 24px rgba(31, 68, 123, 0.28);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(31, 68, 123, 0.22);
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor: wait;
}

.primary-button.is-loading,
.secondary-button.is-loading {
    opacity: 0.92;
}

.primary-button.is-loading::after,
.secondary-button.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: button-spin 0.75s linear infinite;
}

.dashboard-head,
.panel-head,
.document-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-head {
    align-items: flex-start;
    margin-bottom: 18px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.summary-card {
    padding: 20px;
}

.summary-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

.summary-card strong {
    font-size: 20px;
    line-height: 1.25;
}

.repair-case-list {
    display: grid;
    gap: 12px;
}

.history-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.history-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.history-modal__dialog {
    position: relative;
    width: min(980px, calc(100% - 24px));
    max-height: min(80vh, 760px);
    overflow: auto;
    margin: 8vh auto 0;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(98, 92, 84, 0.18);
    background: var(--paper);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.32);
}

.history-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.history-modal__head h3 {
    margin: 0;
}

.history-modal__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #e8eff9;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.repair-case-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(98, 92, 84, 0.18);
    border-radius: 18px;
    background: #fcf9f3;
}

.repair-case-item strong {
    display: block;
    margin-bottom: 4px;
}

.repair-case-item--active {
    border-color: rgba(181, 77, 33, 0.35);
    background: #fff0e8;
}

.current-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
}

.manager-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.manager-contact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.manager-contact a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(98, 92, 84, 0.45);
}

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

.service-card {
    border: 1px solid rgba(98, 92, 84, 0.18);
    border-radius: 18px;
    background: #f8fbff;
    padding: 16px 18px;
}

.service-card strong {
    display: block;
    color: var(--ink);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.stage-chip {
    padding: 20px 16px 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #f7fbfb;
}

.stage-chip strong {
    display: block;
    line-height: 1.35;
}

.stage-chip--done {
    border-color: rgba(45, 108, 79, 0.22);
    background: #edf7f1;
}

.stage-chip--current {
    border-color: rgba(44, 94, 168, 0.34);
    background: #edf3fc;
}

.stage-chip--upcoming {
    opacity: 0.75;
}

.stage-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: currentColor;
}

.stage-chip--done .stage-dot {
    color: var(--good);
}

.stage-chip--current .stage-dot {
    color: var(--accent);
}

.stage-chip--upcoming .stage-dot {
    color: #b5aea3;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 22px;
}

.content-grid__left {
    min-width: 0;
}

.content-grid__right {
    min-width: 0;
}

.photo-panels {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.photo-date-group + .photo-date-group {
    margin-top: 18px;
}

.photo-date-title {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--ink);
}

.photo-grid--scroll {
    max-height: 560px;
    overflow: auto;
    padding-right: 6px;
}

.photo-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(98, 92, 84, 0.14);
    background: #f7fbff;
    text-decoration: none;
}

.photo-card img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #fff;
}

.photo-card__video {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #000;
}

.photo-card span {
    display: block;
    padding: 8px 10px 10px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--muted);
    word-break: break-word;
}

.document-groups {
    display: grid;
    gap: 18px;
}

.document-group {
    padding: 16px 18px;
    border-radius: 20px;
    background: #f5f8fd;
    border: 1px solid rgba(98, 92, 84, 0.14);
}

.document-group h3 {
    margin-bottom: 14px;
}

.document-row {
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid rgba(98, 92, 84, 0.12);
}

.document-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.document-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.document-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(98, 92, 84, 0.14);
}

.document-file-name {
    line-height: 1.2;
}

.document-file-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.document-file-format {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #2f5fa8;
    background: rgba(47, 95, 168, 0.08);
    border: 1px solid rgba(47, 95, 168, 0.2);
}

.document-file-date {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.page-loader {
    display: none !important;
}

.page-loader__dialog {
    display: none !important;
}

.page-loader__dialog strong {
    color: inherit;
}

.page-loader__spinner {
    display: none !important;
}

body.is-busy {
    cursor: default;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .hero-card,
    .login-panel,
    .content-grid,
    .dashboard-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    .support-panel {
        display: grid;
        justify-items: start;
    }

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

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

    .partner-logos-dock__track {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .partner-logo-chip {
        height: 56px;
    }

    .partner-logo-chip img {
        max-height: 34px;
    }

    .partner-logo-chip--with-name .partner-logo-chip__label {
        font-size: 11px;
    }

}

@media (max-width: 640px) {
    .page-shell {
        width: min(calc(100% - 20px), 1160px);
        padding-top: 20px;
    }

    .hero-card,
    .panel,
    .summary-card {
        border-radius: 24px;
    }

    .summary-grid,
    .timeline,
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .service-grid,
    .manager-contact {
        grid-template-columns: 1fr;
    }

    .document-row,
    .document-links {
        display: grid;
        justify-content: stretch;
    }

    .repair-case-item {
        display: grid;
    }

    .photo-grid--scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .photo-card img {
        height: 170px;
    }

    .history-modal__dialog {
        width: calc(100% - 14px);
        margin-top: 4vh;
        padding: 14px;
        border-radius: 18px;
    }

    .partner-logos-dock {
        padding: 10px 12px;
    }

    .partner-logo-chip {
        height: 52px;
        padding: 6px 10px;
    }

    .partner-logos-dock__track {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .partner-logo-chip img {
        max-height: 30px;
    }

    .partner-logo-chip--primary {
        height: 52px;
    }

    .partner-logo-chip--with-name {
        justify-content: center;
        flex-direction: column;
        gap: 6px;
        height: auto;
        min-height: 76px;
        padding: 8px 10px;
    }

    .partner-logo-chip--with-name img {
        max-width: 100%;
        max-height: 26px;
    }

    .partner-logo-chip--with-name .partner-logo-chip__label {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .support-email {
        width: 100%;
    }

}
