/* Полноценная карточка лицензии */
.license-number--link:hover,
.license-primary:hover strong,
.license-item h3 a:hover { color: var(--primary); }

.license-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.license-hero::after {
    position: absolute;
    top: -80px;
    right: 11%;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgb(61 111 196 / .055);
    content: "";
    pointer-events: none;
}

.license-hero--archived { background: #f8f9fb; }
.license-hero__identity { position: relative; z-index: 1; display: flex; min-width: 0; align-items: center; gap: 17px; }
.license-hero__identity > div { min-width: 0; }
.license-hero__mark { display: inline-flex; width: 64px; height: 64px; flex: 0 0 64px; align-items: center; justify-content: center; border: 1px solid #cddcf5; border-radius: 17px; color: var(--info); background: linear-gradient(145deg, #f2f6ff, #e8f0ff); }
.license-hero__mark svg { width: 27px; height: 27px; }
.license-hero__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.license-hero .eyebrow { margin-bottom: 3px; color: var(--muted-light); }
.license-hero h1 { overflow-wrap: anywhere; margin: 0 0 4px; font-family: "Cascadia Mono", Consolas, monospace; font-size: clamp(22px, 2.15vw, 31px); line-height: 1.25; letter-spacing: -.035em; }
.license-hero p { margin: 0; color: var(--muted); font-size: 11px; }
.license-hero p a { color: var(--ink-soft); font-weight: 700; }
.license-hero p a:hover { color: var(--primary); }
.license-hero .page-actions { position: relative; z-index: 1; }

.license-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.license-kpi { --kpi-tone: var(--primary); --kpi-soft: var(--primary-soft); display: flex; min-width: 0; min-height: 78px; align-items: center; gap: 11px; padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
.license-kpi--warning { --kpi-tone: var(--warning); --kpi-soft: var(--warning-soft); }
.license-kpi--danger { --kpi-tone: var(--danger); --kpi-soft: var(--danger-soft); }
.license-kpi--success { --kpi-tone: var(--success); --kpi-soft: var(--success-soft); }
.license-kpi__icon { display: inline-flex; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 10px; color: var(--kpi-tone); background: var(--kpi-soft); }
.license-kpi__icon svg { width: 18px; height: 18px; }
.license-kpi p { display: grid; min-width: 0; margin: 0; }
.license-kpi p span { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.license-kpi p strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

.license-detail-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .72fr); align-items: start; gap: 16px; }
.license-detail-layout__main,
.license-detail-layout__side { display: grid; gap: 16px; min-width: 0; }
.current-period-card { --period-tone: var(--primary); }
.current-period-card--warning { --period-tone: var(--warning); }
.current-period-card--danger { --period-tone: var(--danger); }
.current-period-card .data-card__icon { color: var(--period-tone); background: color-mix(in srgb, var(--period-tone) 10%, white); }
.current-period { padding: 21px; }

.period-progress { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(24px, .6fr) minmax(110px, 1fr) minmax(24px, .6fr) minmax(100px, 1fr); align-items: start; }
.period-progress__step { position: relative; display: grid; justify-items: center; text-align: center; }
.period-progress__step i { position: relative; z-index: 1; width: 13px; height: 13px; margin-bottom: 8px; border: 3px solid #fff; border-radius: 50%; background: #cbd3df; box-shadow: 0 0 0 2px #d9dfe8; }
.period-progress__step.is-complete i { background: var(--period-tone); box-shadow: 0 0 0 2px color-mix(in srgb, var(--period-tone) 32%, white); }
.period-progress__step.is-danger i { background: var(--danger); box-shadow: 0 0 0 2px #efb5b5; }
.period-progress__step span { color: var(--muted); font-size: 9px; }
.period-progress__step strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.period-progress__line { height: 2px; margin-top: 6px; background: #dfe4eb; }
.current-period__workflow { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.workflow-status-form--license { min-width: 320px; }
.period-facts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; }
.period-facts span { display: grid; color: var(--muted); font-size: 9px; }
.period-facts strong { color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.period-note { margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: var(--surface-subtle); }
.period-note > span,
.license-notes > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.period-note p,
.license-notes p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }

.cycle-history { display: grid; }
.cycle-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 34px; align-items: start; gap: 10px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.cycle-row:last-child { border-bottom: 0; }
.cycle-row--current { background: linear-gradient(90deg, rgb(18 135 125 / .04), transparent 42%); }
.cycle-row__status { position: relative; align-self: stretch; padding-top: 4px; }
.cycle-row__status::after { position: absolute; top: 15px; bottom: -21px; left: 5px; width: 1px; background: var(--line); content: ""; }
.cycle-row:last-child .cycle-row__status::after { display: none; }
.cycle-row__status i { position: relative; z-index: 1; display: block; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #9aa6b7; box-shadow: 0 0 0 1px #cbd2dc; }
.cycle-row--current .cycle-row__status i { background: var(--primary); box-shadow: 0 0 0 1px #8bc8c2; }
.cycle-row__main { display: grid; min-width: 0; gap: 7px; }
.cycle-row__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cycle-row__top > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cycle-row__top > div > strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.current-chip { padding: 3px 7px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.cycle-row__facts { display: flex; flex-wrap: wrap; gap: 6px 17px; color: var(--muted); font-size: 9px; }
.cycle-row__facts b { color: var(--ink-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.cycle-row__main > p { margin: 0; color: var(--muted); font-size: 10px; }

.license-info-list { display: grid; gap: 12px; margin: 0; }
.license-info-list > div { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid #edf0f4; }
.license-info-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.license-info-list dt { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.license-info-list dd { overflow-wrap: anywhere; margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.license-info-list a { color: var(--primary-dark); }
.license-notes { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.license-outlets { display: grid; gap: 8px; }
.license-outlets > div { display: grid; gap: 2px; padding: 10px; border-radius: 9px; background: var(--surface-subtle); }
.license-outlets strong { color: var(--ink-soft); font-size: 10px; }
.license-outlets span { color: var(--muted); font-size: 9px; }
.license-danger-zone p { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }

.attachment-composer { display: grid; grid-template-columns: minmax(190px, 1.25fr) minmax(170px, 1fr) minmax(170px, .85fr) auto; align-items: end; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.attachment-composer label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.attachment-composer .input { min-width: 0; height: 38px; min-height: 38px; padding: 7px 9px; font-size: 10px; }
.attachment-composer input[type="file"] { padding: 6px; }
.attachment-composer input[type="file"]::file-selector-button { margin-right: 8px; padding: 4px 8px; border: 0; border-radius: 6px; color: var(--primary-dark); background: var(--primary-soft); font: inherit; font-weight: 750; cursor: pointer; }
.attachment-list { display: grid; }
.attachment-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 20px; align-items: center; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.attachment-row:last-child { border-bottom: 0; }
.attachment-row:hover { background: #fbfcfd; }
.attachment-row__icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 9px; color: var(--info); background: var(--info-soft); }
.attachment-row__icon svg { width: 17px; height: 17px; }
.attachment-row__copy,
.attachment-row__meta { display: grid; min-width: 0; }
.attachment-row__copy strong { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row__copy small,
.attachment-row__meta { color: var(--muted); font-size: 9px; }
.attachment-row__meta { justify-items: end; }
.attachment-row__meta time { color: var(--muted-light); }
.attachment-row__arrow { width: 15px; height: 15px; color: var(--muted-light); }

.license-form-header { align-items: flex-start; }
.license-form-card { max-width: 980px; }
.license-form-card > .form-alert { margin: 18px 20px 0; }
.cycle-form-notice { display: flex; max-width: 980px; align-items: center; gap: 11px; margin: -4px 0 16px; padding: 12px 15px; border: 1px solid #c9e2ef; border-radius: 10px; color: #2e6780; background: #f1f9fc; }
.cycle-form-notice > svg { width: 20px; height: 20px; flex: 0 0 20px; }
.cycle-form-notice p { display: grid; margin: 0; }
.cycle-form-notice strong { font-size: 11px; }
.cycle-form-notice span { font-size: 9px; }
.cycle-form-section { display: grid; grid-template-columns: 180px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.cycle-form-section__title { display: flex; align-items: flex-start; gap: 9px; padding: 22px 0 22px 20px; }
.cycle-form-section__title > span { display: inline-flex; width: 26px; height: 26px; flex: 0 0 26px; align-items: center; justify-content: center; border-radius: 7px; color: var(--primary-dark); background: var(--primary-soft); font-size: 8px; font-weight: 850; }
.cycle-form-section__title > div { display: grid; gap: 2px; }
.cycle-form-section__title strong { color: var(--ink); font-size: 10px; }
.cycle-form-section__title small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.form-grid--embedded { padding-left: 15px; }
.cycle-current-toggle { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); cursor: pointer; }
.cycle-current-toggle > span { display: grid; }
.cycle-current-toggle strong { color: var(--ink-soft); font-size: 10px; }
.cycle-current-toggle small { color: var(--muted); font-size: 9px; }

@media (max-width: 1180px) {
    .license-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .license-detail-layout { grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); }
    .attachment-composer { grid-template-columns: 1fr 1fr; }
    .attachment-composer .button { justify-self: start; }
}

@media (max-width: 980px) {
    .license-detail-layout { grid-template-columns: 1fr; }
    .license-detail-layout__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .license-detail-layout__side .activity-card { grid-row: span 2; }
}

@media (max-width: 760px) {
    .license-hero { align-items: stretch; flex-direction: column; padding: 18px; }
    .license-hero__identity { align-items: flex-start; }
    .license-hero__mark { width: 52px; height: 52px; flex-basis: 52px; border-radius: 14px; }
    .license-kpis { grid-template-columns: 1fr 1fr; }
    .period-progress { grid-template-columns: 1fr; gap: 8px; }
    .period-progress__step { grid-template-columns: 18px 1fr auto; align-items: center; justify-items: start; gap: 6px; text-align: left; }
    .period-progress__step i { margin: 0; }
    .period-progress__line { width: 2px; height: 16px; margin: -8px 0 -8px 5px; }
    .current-period__workflow { align-items: stretch; flex-direction: column; }
    .workflow-status-form--license { min-width: 0; }
    .period-facts { justify-content: flex-start; }
    .cycle-row__top { align-items: flex-start; flex-direction: column; }
    .license-detail-layout__side { grid-template-columns: 1fr; }
    .license-detail-layout__side .activity-card { grid-row: auto; }
    .attachment-composer { grid-template-columns: 1fr; }
    .attachment-row { grid-template-columns: 38px minmax(0, 1fr) 18px; }
    .attachment-row__meta { display: none; }
    .cycle-form-section { grid-template-columns: 1fr; }
    .cycle-form-section__title { padding-bottom: 0; }
    .form-grid--embedded { padding-left: 20px; }
}

@media (max-width: 480px) {
    .license-kpis { grid-template-columns: 1fr; }
    .license-hero__identity { display: grid; grid-template-columns: 44px minmax(0, 1fr); }
    .license-hero__mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; }
    .license-hero h1 { font-size: 19px; }
    .current-period { padding: 17px; }
    .period-facts { display: grid; grid-template-columns: 1fr 1fr; }
    .cycle-row { grid-template-columns: 12px minmax(0, 1fr) 30px; padding-inline: 14px; }
    .cycle-row__facts { display: grid; grid-template-columns: 1fr 1fr; }
}
