:root {
    --navy: #1B2559;
    --navy2: #232E68;
    --ice: #EEF2FC;
    --ice2: #DCE4F7;
    --accent: #00C9A7;
    --accent-dark: #00a88c;
    --red: #C0392B;
    --text: #1B2559;
    --muted: #5C6690;
    --white: #FFFFFF;
    --radius: 12px;
    --shadow: 0 4px 14px rgba(27, 37, 89, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--ice);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }

/* ---------- TOPBAR ---------- */
.topbar {
    background: var(--navy);
    padding: 0 24px;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.brand {
    font-weight: 800;
    font-size: 20px;
    color: var(--white);
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.brand-accent { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 20px; flex: 1; }
.nav-links a { color: #C7CEEF; font-size: 14px; font-weight: 600; }
.nav-links a:hover { color: var(--white); }
.btn-nav-primary {
    background: var(--accent);
    color: var(--navy) !important;
    padding: 8px 14px;
    border-radius: 8px;
}
.user-box { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-name { color: var(--white); font-size: 14px; font-weight: 600; }
.role-pill {
    background: var(--navy2);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.role-pill-toggle { cursor: pointer; user-select: none; }
.btn.danger-delete-btn { display: none; }
body.danger-unlocked .btn.danger-delete-btn { display: inline-block; width: 100%; }
body.danger-unlocked .role-pill-toggle { background: #E24B4A; color: #fff; }
.logout-link { color: #8891C2; font-size: 13px; }
.logout-link:hover { color: var(--white); }

/* ---------- PAGE ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-head h1 { font-size: 26px; margin: 0; }

/* ---------- FLASH ---------- */
.flash-wrap { margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.flash-success { background: #DFF7EF; color: #0A7A5C; }
.flash-error { background: #FBE4E1; color: #9B2C1D; }

/* ---------- LOGIN ---------- */
.login-screen {
    min-height: calc(100vh - 40px);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: var(--white); border-radius: 16px; box-shadow: var(--shadow);
    padding: 40px; width: 100%; max-width: 380px; text-align: center;
}
.login-logo { font-size: 24px; font-weight: 800; color: var(--navy); }
.login-sub { color: var(--muted); font-size: 13px; margin: 8px 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.login-form label { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 10px; }
.login-form input {
    padding: 11px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-size: 14px; width: 100%;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-block; padding: 10px 18px; border-radius: 8px; font-weight: 700;
    font-size: 14px; border: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--ice2); color: var(--navy); }
.btn-secondary:hover { background: #cbd6f2; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid #D9DEEE; }
.btn-approve { background: #17A673; color: var(--white); }
.btn-reject { background: var(--red); color: var(--white); }
.btn-block { width: 100%; margin-top: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- FILTERS ---------- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.chip {
    padding: 7px 14px; border-radius: 20px; background: var(--white);
    font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow);
}
.chip-active { background: var(--navy); color: var(--white); }

.filter-form {
    display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; align-items: center;
}
.filter-form select, .filter-form input {
    padding: 9px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-size: 13px; background: var(--white);
}

/* ---------- CARDS GRID (заявки) ---------- */
.cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.request-card {
    background: var(--white); border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow); display: block; position: relative;
}
.request-card:hover { box-shadow: 0 8px 22px rgba(27,37,89,0.14); }
.request-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.request-type { font-weight: 700; font-size: 14px; }
.request-card-date, .request-card-car, .request-card-shop { font-size: 13px; color: var(--muted); margin-top: 4px; }
.request-card-id { font-size: 11px; color: #A9B0D0; margin-top: 10px; }

/* ---------- BADGES ---------- */
.badge {
    font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.badge-new { background: #FFF1D6; color: #A9711A; }
.badge-approved { background: #DFF7EF; color: #0A7A5C; }
.badge-rejected { background: #FBE4E1; color: #9B2C1D; }
.badge-progress { background: #E6F1FB; color: #185FA5; }

/* ---------- EMPTY STATE ---------- */
.empty-state {
    background: var(--white); border-radius: var(--radius); padding: 50px 20px;
    text-align: center; color: var(--muted); box-shadow: var(--shadow);
}

/* ---------- FORM CARD ---------- */
.form-card {
    background: var(--white); border-radius: var(--radius); padding: 28px;
    box-shadow: var(--shadow); max-width: 560px; display: flex; flex-direction: column; gap: 4px;
}
.form-card label { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 14px; }
.form-card input, .form-card select, .form-card textarea {
    padding: 10px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 4px; }

/* ---------- DETAIL ---------- */
.detail-card {
    background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px;
}
.detail-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; font-size: 14px; margin-bottom: 12px; }
.detail-desc p { margin: 6px 0 0; font-size: 14px; }
.muted { color: var(--muted); font-size: 12px; }
.info-line { margin-top: 14px; font-size: 13px; color: var(--muted); background: var(--ice); padding: 10px 14px; border-radius: 8px; }

.decision-bar { display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.reject-form { display: flex; gap: 8px; align-items: center; }
.reject-form input { padding: 9px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-size: 13px; }

/* ---------- TABLE (admin) ---------- */
.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.requests-table { width: 100%; border-collapse: collapse; }
.requests-table th {
    text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase;
    padding: 14px 16px; border-bottom: 1px solid #EEF1FA; letter-spacing: 0.4px;
}
.requests-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #F3F5FB; }
.requests-table tr:hover { background: var(--ice); cursor: pointer; }
.requests-table tr:last-child td { border-bottom: none; }

/* ---------- COMMENTS ---------- */
.comments-block { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.comments-title { font-size: 15px; margin: 0 0 14px; }
.comments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment { padding: 12px 14px; border-radius: 10px; background: var(--ice); }
.comment-shop { border-left: 3px solid var(--navy); }
.comment-admin { border-left: 3px solid var(--accent); }
.comment-security { border-left: 3px solid #E0A100; }
.comment-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.comment-author { font-weight: 700; font-size: 13px; }
.comment-role-tag { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.comment-time { font-size: 11px; color: #A9B0D0; margin-left: auto; }
.comment-text { font-size: 13.5px; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; }
.comment-form textarea { flex: 1; padding: 10px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical; }
.comment-form .file-attach-box {
    flex-direction: row; align-items: center; gap: 8px; padding: 0 16px;
    margin: 0; height: 40px; flex-shrink: 0;
}
.comment-form .file-attach-box .file-attach-icon { font-size: 17px; }
.comment-form .file-attach-box .file-attach-sub { display: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
    .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; row-gap: 6px; }
    .brand { font-size: 17px; }
    .role-pill { font-size: 11px; padding: 4px 8px; }
    .nav-links {
        order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; white-space: nowrap;
        -webkit-overflow-scrolling: touch; gap: 16px; padding-bottom: 2px;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .requests-table { font-size: 12px; }
}

/* ---------- ОТКЛОНЁННЫЕ ЗАЯВКИ У ОХРАНЫ ---------- */
.section-title-rejected {
    font-size: 15px;
    color: #9B2C1D;
    margin: 32px 0 14px;
    font-weight: 700;
}
.request-card-rejected {
    border: 1.5px solid #F3C9C2;
    background: #FDF3F1;
    opacity: 0.9;
    cursor: default;
}
.request-card-rejected:hover {
    box-shadow: var(--shadow);
}

/* ---------- ФОТО ЗАЯВКИ ---------- */
.photos-block { margin-top: 18px; }
.photos-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px; margin-top: 8px; max-width: 420px;
}
.photo-thumb {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px;
    border: 1px solid #E3E8F5; display: block;
}

/* ---------- ФОРМА ДАННЫХ МАШИНЫ (охрана) ---------- */
.car-form { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.car-form label { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 12px; }
.car-form input[type="text"] {
    padding: 10px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-size: 14px; width: 100%;
}
.car-form input[type="file"] { margin-top: 6px; font-size: 13px; }
.car-form .btn { margin-top: 16px; align-self: flex-start; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) {
    .form-row-2 { grid-template-columns: 1fr; }
}

/* ---------- СРОК ДЕЙСТВИЯ ЗАЯВКИ ---------- */
.validity-box {
    margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 13px; overflow: hidden;
}
.validity-ok { background: #EEF2FC; color: var(--muted); }
.validity-warn { background: #FFF1D6; color: #8A5A00; }
.validity-expired { background: #FBE4E1; color: #9B2C1D; }
.validity-box strong { display: block; margin-bottom: 4px; font-size: 13px; }
.extend-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.extend-form input { padding: 7px 10px; border: 1px solid #D9DEEE; border-radius: 6px; font-size: 13px; min-width: 0; max-width: 100%; flex: 1; }

.validity-tag {
    font-size: 11px; font-weight: 700; margin-top: 8px; padding: 3px 8px;
    border-radius: 12px; display: inline-block; background: #FFF1D6; color: #8A5A00;
}

/* ---------- ДИНАМИЧЕСКИЕ СЕКЦИИ ФОРМЫ (высотные работы) ---------- */
.conditional-section { display: none; margin-top: 6px; }
.height-notice {
    background: #FFF1D6; color: #8A5A00; padding: 10px 14px; border-radius: 8px;
    font-size: 12.5px; margin-top: 14px; margin-bottom: 4px; line-height: 1.4;
}
.worker-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.worker-row input { flex: 1; padding: 10px 12px; border: 1px solid #D9DEEE; border-radius: 8px; font-size: 14px; }
.btn-remove-row {
    background: #FBE4E1; color: #9B2C1D; border: none; border-radius: 8px;
    width: 36px; height: 36px; font-size: 14px; cursor: pointer; flex-shrink: 0;
}
.btn-remove-row:hover { background: #F3C9C2; }
.btn-add-row { margin-top: 10px; }

/* ---------- СПИСКИ РАБОТНИКОВ И ДОКУМЕНТОВ (просмотр) ---------- */
.workers-block, .documents-block { margin-top: 18px; }
.workers-list, .documents-list { list-style: none; padding: 0; margin: 8px 0 0; }
.workers-list li {
    padding: 8px 12px; background: var(--ice); border-radius: 8px; font-size: 13.5px; margin-bottom: 6px;
}
.documents-list li { margin-bottom: 6px; }
.documents-list a {
    display: inline-block; padding: 8px 12px; background: var(--ice); border-radius: 8px;
    font-size: 13.5px; color: var(--navy); font-weight: 600;
}
.documents-list a:hover { background: var(--ice2); }

/* ---------- КОНТАКТНОЕ ЛИЦО ПО ЗАЯВКЕ ---------- */
.contact-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid #EEF1FA; }
.contact-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-top: 0 !important; }

/* ---------- КАРТОЧКА ВИЗИТА (охрана: приход/уход по дням) ---------- */
.visit-card {
    background: var(--ice); border-radius: 10px; padding: 14px 16px; margin-top: 12px;
}
.visit-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.visit-date { font-weight: 700; font-size: 13.5px; }
.visit-card-body { font-size: 13.5px; }
.visit-card-body .muted { display: block; margin-top: 4px; font-size: 12px; }
.visit-card .photos-grid { margin-top: 10px; max-width: 320px; }

/* ---------- КОЛОКОЛЬЧИК УВЕДОМЛЕНИЙ (шапка) ---------- */
.bell-link {
    position: relative; font-size: 18px; text-decoration: none; margin-right: 4px;
    display: inline-flex; align-items: center;
}
.bell-badge {
    position: absolute; top: -6px; right: -10px; background: #E5484D; color: #fff;
    font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 5px;
    min-width: 16px; text-align: center; line-height: 1.4; display: inline-flex;
    align-items: center; justify-content: center;
}

/* ---------- ЗНАЧОК НЕПРОЧИТАННОГО НА КАРТОЧКЕ/СТРОКЕ ЗАЯВКИ ---------- */
.notif-badge {
    background: #E5484D; color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 10px; padding: 2px 7px; min-width: 18px; text-align: center;
    display: inline-block;
}
.notif-badge-inline { margin-left: 6px; vertical-align: middle; }

/* ---------- СТРАНИЦА "ВСЕ УВЕДОМЛЕНИЯ" ---------- */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
    display: flex; align-items: flex-start; gap: 12px; background: var(--white);
    border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
    position: relative;
}
.notif-item.notif-unread { background: #EEFBF7; border-left: 3px solid var(--accent); }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-body { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.notif-message { font-size: 14px; color: var(--text); }
.notif-time { font-size: 12px; color: var(--muted); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 4px; flex-shrink: 0; }

/* ---------- МОБИЛЬНАЯ АДАПТАЦИЯ (телефоны) ---------- */
@media (max-width: 640px) {
    /* Не даём iOS увеличивать масштаб при фокусе на поле ввода */
    input, select, textarea, button { font-size: 16px; }

    .page { padding: 16px 12px 60px; }
    .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-head h1 { font-size: 21px; }

    .form-card, .detail-card, .comments-block, .login-card { padding: 16px; }

    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-form select, .filter-form input, .filter-form .btn { width: 100%; }

    .requests-table th, .requests-table td { padding: 10px 12px; font-size: 12.5px; }
    .requests-table { min-width: 620px; }

    .detail-grid { grid-template-columns: 1fr; gap: 10px; }
    .cards-grid { grid-template-columns: 1fr; }

    .decision-bar { flex-direction: column; align-items: stretch; }
    .decision-bar form { width: 100%; }
    .decision-bar .btn { width: 100%; }
    .reject-form { flex-direction: column; align-items: stretch; }
    .reject-form input, .reject-form .btn { width: 100%; }
    .extend-form { flex-direction: column; align-items: stretch; }
    .extend-form input, .extend-form .btn { width: 100%; }

    .comment-form { flex-direction: column; align-items: stretch; }
    .comment-form .file-attach-box {
        flex-direction: column; height: auto; padding: 13px; gap: 2px;
    }
    .comment-form .file-attach-box .file-attach-icon { font-size: 23px; }
    .comment-form .file-attach-box .file-attach-sub { display: block; }
    .comment-form .btn { width: 100%; }
    .comment-head { flex-wrap: wrap; }
    .comment-time { margin-left: 0; width: 100%; }

    .worker-row input { font-size: 16px; }
    .btn-remove-row { width: 40px; height: 40px; }

    .user-box { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .user-name { display: none; }

    .notif-item { padding: 12px; gap: 10px; }
    .notif-message { font-size: 13.5px; }

    .visit-card { padding: 12px; }
    .form-row-2 { grid-template-columns: 1fr; }
}

/* ---------- ПРОГРЕСС ЗАГРУЗКИ ФАЙЛА ---------- */
.upload-progress {
    margin-top: 8px; padding: 10px 12px; background: var(--ice); border-radius: 8px;
    border: 1px solid #D9DEEE;
}
.upload-progress-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.upload-filename { font-size: 12px; color: var(--muted); }
.upload-bar-track { height: 6px; border-radius: 4px; background: #D9DEEE; overflow: hidden; }
.upload-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width .15s linear; }
.upload-status-row { display: flex; justify-content: space-between; margin-top: 6px; }
.upload-status-label { font-size: 12px; color: var(--muted); }
.upload-status-pct { font-size: 12px; font-weight: 700; color: var(--navy); }
.upload-progress-error .upload-bar-fill { background: #E5484D; }
.upload-progress-error .upload-status-label { color: #9B2C1D; }

/* ---------- БАННЕР БЛОКИРОВКИ (СТОП-ЛИСТ) ---------- */
.sanction-banner {
    background: #FBE4E1; color: #9B2C1D; padding: 12px 16px; border-radius: 10px;
    font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
}
.sanction-banner-sm {
    background: #FBE4E1; color: #9B2C1D; padding: 6px 10px; border-radius: 8px;
    font-size: 11.5px; font-weight: 700; margin-top: 8px; display: inline-block;
}

/* ---------- ФИЛЬТРЫ ПО ТИПУ ЗАЯВКИ (охрана) ---------- */
.type-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.type-filter-chip {
    font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 20px;
    background: var(--white); color: var(--navy); border: 1px solid #D9DEEE;
}
.type-filter-chip.type-filter-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- ПАНЕЛЬ СТАТУСОВ ДЕБАРКАДЕРОВ (видна всей охране) ---------- */
.dock-status-box {
    background: var(--white); border: 1.5px solid var(--navy); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.dock-status-title { font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.dock-status-panel { display: flex; flex-wrap: wrap; gap: 8px; }
.dock-status-pill {
    font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px;
    display: inline-block;
}
.dock-status-active { background: #E4F7EF; color: #0F7A4E; }
.dock-status-closed, .dock-status-repair { background: #FBE4E1; color: #9B2C1D; }
.dock-status-paused { background: #FFF1D6; color: #8A5A00; }

/* ---------- ВАРИАНТ Б: ВСЯ КАРТОЧКА/СТРОКА ЗАЛИТА КРАСНЫМ ---------- */
.request-card-blocked {
    background: #FBE4E1 !important; border-color: #F3C9C2 !important;
}
.request-card-blocked .request-type,
.request-card-blocked .request-card-shop,
.request-card-blocked .request-card-date,
.request-card-blocked .request-card-car,
.request-card-blocked .request-card-id {
    color: #7A2020 !important;
}
.sanction-banner-full {
    color: #7A1F1F; font-size: 12.5px; font-weight: 700; margin-top: 8px;
}
tr.row-blocked { background: #FBE4E1 !important; }
tr.row-blocked td { color: #7A2020 !important; }
.sanction-row-tag { color: #7A1F1F; font-size: 11px; font-weight: 700; margin-top: 4px; }

/* ---------- ВЛОЖЕНИЯ В КОММЕНТАРИЯХ (фото, видео, документы) ---------- */
.comment-attach-label {
    display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px;
    cursor: pointer;
}
.comment-attach-label input[type="file"] { display: block; margin-top: 6px; font-size: 12px; }
.comment-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.comment-attach-thumb {
    width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid #D9DEEE;
}
.comment-attach-video { width: 200px; max-width: 100%; border-radius: 8px; }
.comment-attach-doc {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px;
    background: var(--ice); padding: 6px 10px; border-radius: 8px; color: var(--navy);
}

/* ---------- ВЫБОР ТИПА ПОСТА ОХРАНЫ (дебаркадер / торговый зал) ---------- */
.post-type-picker { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.post-type-option {
    text-align: left; background: var(--white); border: 1.5px solid #D9DEEE; border-radius: 10px;
    padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.post-type-option strong { font-size: 14px; color: var(--navy); }
.post-type-option .muted { font-size: 12px; line-height: 1.4; }
.post-type-option.post-type-active { border-color: var(--navy); background: var(--ice); }

/* ---------- ПРАВИЛА ВИДИМОСТИ ТИПА ПОСТА ОХРАНЫ ---------- */
.rule-row {
    border: 1px solid #D9DEEE; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.rule-row-label { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.rule-row-options { display: flex; flex-wrap: wrap; gap: 12px; }
.rule-option { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.rule-option input { margin: 0; }

/* ---------- ЗНАЧОК НЕПРОЧИТАННОГО НА КНОПКЕ «ОБРАЩЕНИЯ» ---------- */
.nav-link-badged { position: relative; }
.nav-badge {
    position: absolute; top: -5px; right: -12px; background: #E24B4A; color: #fff;
    font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
    box-shadow: 0 0 0 2px var(--navy);
}
.appeal-corner-badge {
    position: absolute; top: -7px; right: -7px; background: #E24B4A; color: #fff;
    font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; padding: 0 5px;
    box-shadow: 0 0 0 2px #fff; z-index: 2;
}

/* ---------- ПРИВАТНЫЕ ЗАМЕТКИ ОХРАНЫ И АДМИНИСТРАЦИИ (не видит магазин) ---------- */
.private-notes-block { border: 1.5px dashed #9B2C1D; margin-top: 16px; }

/* ---------- ВЛОЖЕНИЯ (единая кнопка по всей системе — комментарии, заявки, фото охраны) ---------- */
.file-attach-box {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--navy); border-radius: 9px; padding: 13px;
    cursor: pointer; margin: 8px 0 4px; text-align: center; position: relative;
}
.file-attach-box input[type="file"] {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.file-attach-icon { font-size: 23px; line-height: 1; }
.file-attach-title { font-size: 13px; color: #fff; font-weight: 700; }
.file-attach-sub { font-size: 11px; color: #AEB8E0; }
.file-attach-box.file-attach-has-preview {
    flex-direction: row; align-items: center; text-align: left; gap: 10px; padding: 10px 12px;
}
.file-attach-preview { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; }
.file-attach-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.file-attach-doc-icon {
    width: 44px; height: 44px; border-radius: 6px; background: #2A3670;
    display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.file-attach-preview-info { min-width: 0; }
.file-attach-preview-name { font-size: 12.5px; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-attach-preview-sub { font-size: 11px; color: #AEB8E0; }

/* ---------- ВКЛАДКИ РАЗДЕЛА "ОХРАНА" (Дебаркадеры / Типы постов / Учётные записи) ---------- */
.security-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.security-tab {
    background: var(--ice); color: var(--navy); font-size: 13px; font-weight: 700;
    padding: 9px 16px; border-radius: 8px; text-decoration: none;
}
.security-tab-active { background: var(--navy); color: #fff; }

/* ---------- СЕКЦИИ ФОРМ С РАЗДЕЛИТЕЛЯМИ (единый стиль карточек настроек) ---------- */
.form-section { border-top: 1px solid var(--ice); padding-top: 12px; margin-top: 12px; }
.form-section:first-of-type { border-top: none; margin-top: 14px; padding-top: 0; }
.form-section-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; margin-bottom: 6px; text-transform: uppercase; }
.form-section-row { display: flex; gap: 10px; }
.form-section-row select, .form-section-row input { flex: 1; min-width: 0; }
.form-section-row .btn { flex-shrink: 0; }
