/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #4a3f6b;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    min-width: 0;
}

/* ПК/десктоп: блоки шире (мобильная версия без изменений) */
@media (min-width: 993px) {
    .container {
        max-width: 1600px;
        padding: 0 24px;
    }
}

header {
    background: #5a4f7a;
    color: #fff;
    padding: 0.75rem 20px;
    width: 100%;
}

header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

header h1 {
    text-align: center;
    margin: 0;
}

main {
    padding: 1rem 0;
    flex: 1;
    min-height: calc(100vh - 160px);
    background-color: #e8e4f2;
    width: 100%;
    min-width: 0;
}

footer {
    background: #5a4f7a;
    color: #fff;
    text-align: center;
    padding: 0.5rem 0;
    width: 100%;
    margin-top: auto;
}

/* Обёртка таблицы: на десктопе — горизонтальная прокрутка при необходимости, на мобильном — без прокрутки (карточки) */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Область с таблицей — не шире блока */
.collapsible-body {
    max-width: 100%;
    min-width: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Таблицы в виде таблицы только на десктопе (ширина > 992px); на смартфонах/планшетах — карточки */
@media (min-width: 993px) {
    table {
        min-width: max-content;
    }
}

th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

input[type="text"], input[type="date"], input[type="time"], input[type="password"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px; /* Увеличено для мобильных устройств (предотвращает зум) */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input:focus, select:focus {
    border-color: #454c73;
    outline: none;
    box-shadow: 0 0 0 2px rgba(69, 76, 115, 0.1);
}

button {
    background-color: #6b5b95;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

button:hover {
    background-color: #5a4f7a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

/* Auth forms */
.auth-form {
    background-color: #5a4f7a;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.auth-form h2 {
    margin-bottom: 10px;
    color: #fff;
}

.auth-form input {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.2);
}

.auth-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.auth-form button {
    width: 100%;
    padding: 10px;
    background-color: #6b5b95;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.auth-form button:hover {
    background-color: #5a4f7a;
}

.auth-form p {
    text-align: center;
    margin-top: 10px;
}

.auth-form a {
    color: #a0aec0;
    text-decoration: none;
}

.auth-form a:hover {
    text-decoration: underline;
    color: #fff;
}

.auth-form .login-hint {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 6px;
}

.auth-form .small-link {
    font-size: 0.85em;
}

#user-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.offline-sync-indicator {
    width: 100%;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
}
.offline-sync-indicator.offline {
    background: rgba(255, 193, 7, 0.25);
    color: #fff3cd;
    border: 1px solid rgba(255, 193, 7, 0.5);
}
.offline-sync-indicator.pending {
    background: rgba(23, 162, 184, 0.25);
    color: #b8e6ec;
    border: 1px solid rgba(23, 162, 184, 0.5);
}
.offline-sync-indicator.syncing {
    background: rgba(40, 167, 69, 0.3);
    color: #b8e6b8;
    border: 1px solid rgba(40, 167, 69, 0.5);
}
.offline-sync-indicator.synced {
    background: rgba(40, 167, 69, 0.2);
    color: #d8ffe0;
    border: 1px solid rgba(40, 167, 69, 0.45);
}
.offline-sync-indicator.error {
    background: rgba(220, 53, 69, 0.25);
    color: #ffd7dc;
    border: 1px solid rgba(220, 53, 69, 0.5);
}

.sync-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.sync-status-badge.pending {
    background: #e7f3ff;
    color: #0b5cab;
    border: 1px solid #b8dcff;
}
.sync-status-badge.syncing {
    background: #fff5d6;
    color: #8a6a00;
    border: 1px solid #f0d98f;
}
.sync-status-badge.synced {
    background: #e5f7ea;
    color: #1f7a36;
    border: 1px solid #b9e4c6;
}

#user-fio {
    font-weight: bold;
    color: #fff;
}

/* Анимация сворачивания/разворачивания */
.collapsible-body {
    max-height: 9999px; /* достаточно для отображения всех таблиц админки */
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
    opacity: 1;
    margin-top: 6px;
    margin-bottom: 6px;
}

.collapsible-body.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.collapse-btn {
    background-color: #6b5b95;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.collapse-btn:hover {
    background-color: #5a4f7a;
}

.collapse-btn::before {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.collapse-btn.collapsed::before,
.collapse-btn:not(.expanded)::before {
    transform: rotate(-90deg);
}

.collapse-btn.expanded::before {
    transform: rotate(0deg);
}

/* Контейнеры для сообщений */
.message-container {
    margin-top: 10px;
    padding: 0;
    min-height: 36px;
}

.message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Стили для карточек */
.mode-card, .section-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 100%;
    min-width: 0;
}

.mode-header, .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-header h2, .section-header h2, .section-header h3 {
    margin: 0;
    color: #2d3748;
}

/* Блок заголовка и фильтра периода (От/До) — слева */
.section-header-period {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Заголовок на всю ширину, «От»/«До» — строкой ниже */
.section-header-period h3 {
    width: 100%;
}

/* Блок «История простоев за период» — первая строка: панель (toggle + свернуть), вторая: От/До */
.admin-details-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
}

.admin-details-header h3 {
    margin: 0;
}

/* Строка 1: переключатель слева, кнопка «Свернуть» справа */
.admin-details-row1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-details-row1 .downtime-view-toggle-wrap {
    width: auto;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.admin-details-row1 .downtime-view-toggle {
    flex: none;
    min-width: 200px;
    max-width: 320px;
}

.admin-details-row1 .collapse-btn {
    flex: 0 0 auto;
}

/* Строка 2: даты От/До — слева, как раньше */
.admin-details-row2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Обёртка переключателя «Показать: Завершённые | Активные | Все» */
.downtime-view-toggle-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 10px 0;
    flex-wrap: wrap;
}

.downtime-view-toggle-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

/* Переключатель режимов истории простоев (Завершённые / Активные / Все) */
.downtime-view-toggle {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.downtime-view-toggle .toggle-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #4a5568;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.downtime-view-toggle .toggle-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #2d3748;
}

.downtime-view-toggle .toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.downtime-view-toggle .toggle-btn:active {
    transform: scale(0.98);
}

/* Переключатель в блоке «История простоев» (Активные / Завершённые / Все) */
.history-view-toggle-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 10px 0;
    flex-wrap: wrap;
}

.history-view-toggle-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.history-view-toggle {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.history-view-toggle .history-toggle-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: #4a5568;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.history-view-toggle .history-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #2d3748;
}

.history-view-toggle .history-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.history-view-toggle .history-toggle-btn:active {
    transform: scale(0.98);
}

/* Бейджи статуса в таблице (активный / завершён) */
.downtime-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.downtime-status-badge.status-active {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.25) 0%, rgba(56, 161, 105, 0.3) 100%);
    color: #276749;
}

.downtime-status-badge.status-completed {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #553c9a;
}

.pagination-info {
    margin: 0 6px;
    font-size: 0.9em;
    color: #4a5568;
}

/* Таймер */
.timer-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timer-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.timer-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.timer-icon {
    font-size: 32px;
    line-height: 1;
}

.timer-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.timer-label {
    font-weight: 600;
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-value {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Админ-панель */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-badge {
    background: #6b5b95;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
}

.sub-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    max-width: 100%;
    min-width: 0;
}

.sub-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2d3748;
}

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

#add-user-form {
    background: #fff;
    border: 1px solid #e2e8f0;
}

/* Пустые таблицы */
.empty-table-message {
    text-align: center;
    padding: 16px 20px;
    color: #718096;
    font-style: italic;
}

.loading-message {
    text-align: center;
    padding: 16px 20px;
    color: #454c73;
    font-weight: 500;
    position: relative;
}

.loading-message::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-weight: 500;
    margin: 10px 0;
}

button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    pointer-events: none;
}

button:disabled:hover {
    background-color: #6b5b95 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Стили для кнопок действий */
.action-btn {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
    background-color: #6b5b95;
    color: white;
}

.action-btn:hover {
    background-color: #5a4f7a;
}

.end-btn {
    background-color: #6b5b95;
}

.end-btn:hover {
    background-color: #5a4f7a;
}

.cancel-btn {
    background-color: #6b5b95;
}

.cancel-btn:hover {
    background-color: #5a4f7a;
}

/* Мобильные и планшеты: до 992px — без горизонтальной прокрутки, значения под ключами */
@media (max-width: 992px) {
    .container {
        padding: 0 12px;
        max-width: 100%;
    }

    .header-logo {
        height: 40px;
    }

    header h1 {
        font-size: 1.2rem;
        word-wrap: break-word;
    }

    .mode-card, .section-card {
        padding: 12px;
        max-width: 100%;
    }

    .mode-header, .section-header {
        gap: 8px;
    }

    .section-header label,
    .section-header .date-input,
    .section-header .collapse-btn {
        min-width: 0;
    }

    .section-header .date-input {
        max-width: 160px;
    }

    .section-header h2 {
        width: 100%;
    }

    /* История за период: кнопка «Свернуть» не на всю ширину, даты — компактно */
    .admin-details-row1 .collapse-btn {
        width: auto;
        min-width: 0;
    }

    .admin-details-row1 .downtime-view-toggle {
        min-width: 0;
        max-width: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    
    input[type="text"], input[type="date"], input[type="time"], input[type="password"], select {
        padding: 12px;
        font-size: 16px;
        max-width: 100%;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    button {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
        width: 100%;
        margin-top: 8px;
    }
    
    .action-btn {
        min-height: 44px;
        font-size: 16px;
        min-width: 0;
    }
    
    .message {
        font-size: 14px;
        padding: 10px 12px;
    }

    /* Таблицы — только карточки: ключ сверху, значение снизу (никакой прокрутки вправо) */
    .table-wrapper {
        overflow-x: hidden;
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
    
    table {
        display: block;
        width: 100%;
        font-size: 14px;
        min-width: 0 !important;
    }

    thead {
        display: none;
    }

    tbody, tr {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px;
        background: white;
    }

    td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0;
        border: none;
        gap: 4px;
        width: 100%;
        max-width: 100%;
        word-break: break-word;
    }

    td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #4a5568;
        font-size: 0.85em;
    }

    td input, td select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    td button,
    .cell-actions,
    .cell-action-buttons {
        width: 100%;
        max-width: 100%;
        margin-top: 4px;
    }

    td[colspan] {
        display: block;
    }

    td[colspan]:before {
        display: none;
    }

    .timer-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-badge {
        width: 100%;
        text-align: center;
    }

    #user-info {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    main, main .container {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .timer-value {
        font-size: 20px;
    }
    
    .timer-icon-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .timer-icon {
        font-size: 28px;
    }

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

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .header-logo {
        height: 35px;
    }

    tr {
        padding: 10px;
    }
}

/* Загрузка */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Модальные окна: анимация развёртывания от кнопки */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}
.modal-overlay.modal-visible {
    opacity: 1;
}
.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-width: 280px;
    max-width: min(90vw, 400px);
    width: calc(100% - 24px);
    transform-origin: center center;
    margin: 12px;
}
.modal-content.modal-content-animate-in {
    animation: modalExpand 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes modalExpand {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.modal-content-wide {
    min-width: 280px;
    max-width: min(95vw, 420px);
}
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}
.modal-form label {
    margin-top: 10px;
}
.modal-form label:first-child {
    margin-top: 0;
}
.modal-actions-between {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.modal-actions-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 992px) {
    .modal-content {
        padding: 16px;
        margin: 10px;
    }
    .modal-actions-between {
        flex-direction: column;
    }
    .modal-actions-right {
        width: 100%;
        justify-content: stretch;
    }
    .modal-actions-right button {
        flex: 1;
    }
    .danger-btn {
        width: 100%;
    }
}
.danger-btn {
    background-color: #c53030;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.danger-btn:hover {
    background-color: #9b2c2c;
}
.modal-content h3 {
    margin: 0 0 12px 0;
    color: #2d3748;
}
.modal-user-info {
    margin: 0 0 16px 0;
    color: #718096;
    font-size: 14px;
}
.modal-content label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2d3748;
}
.modal-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 16px;
    box-sizing: border-box;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Кнопки в ячейке «Действие» */
.cell-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Статус заявки: кнопки и текст */
.cell-status {
    white-space: normal;
}
.status-btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #f0f0f0;
    color: #333;
}
.status-btn.status-pending:hover {
    background: #e0e8f0;
    border-color: #667eea;
}
.status-btn.status-in-progress {
    background: #e6f3ff;
    border-color: #4a90d9;
    color: #1a5a9e;
}
.status-btn.status-in-progress:hover {
    background: #cce5ff;
}
.status-done {
    font-weight: 600;
    color: #2d7a3e;
}
.status-comment {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.cell-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 992px) {
    .cell-action-buttons {
        width: 100%;
    }
    .cell-action-buttons .action-btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Выпадающий список подсказок гос. номера (автодополнение из БД: по одному символу — подсказки, по двум — актуальный список) */
.license-autocomplete-dropdown {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 220px;
    overflow-y: auto;
    min-width: 120px;
}
.license-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 1px solid #eee;
}
.license-autocomplete-item:last-child {
    border-bottom: none;
}
.license-autocomplete-item:hover,
.license-autocomplete-item.active {
    background: #e8e4f2;
    color: #333;
}