/* Стили для современной системы авторизации */
.auth-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    background: #f5f7fa;
    padding: 0;
    margin: 0;
    z-index: 1000;
    overflow: hidden;
}

.flowing-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.flowing-line svg {
    width: 100%;
    height: 100%;
}

.star-1 {
    position: absolute;
    top: 18%;
    left: 9%;
    color: #4a8fe7;
    font-size: 20px;
    pointer-events: none;
    z-index: 1;
}

.star-2 {
    position: absolute;
    top: 35%;
    right: 8%;
    color: #4a8fe7;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.circle-1 {
    position: absolute;
    top: 32%;
    left: 18%;
    width: 6px;
    height: 6px;
    border: 2px solid #4a8fe7;
    border-radius: 50%;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

.circle-2 {
    position: absolute;
    top: 31%;
    right: 9%;
    width: 8px;
    height: 8px;
    border: 2px solid #4a8fe7;
    border-radius: 50%;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

.filled-circle {
    position: absolute;
    bottom: 35%;
    left: 15%;
    width: 12px;
    height: 12px;
    background: #4a8fe7;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Когда секция авторизации активна */
.auth-section[style*="flex"] {
    display: flex !important;
}

.auth-container {
    background: rgba(255, 255, 255, 0.98);
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    max-width: 420px;
    width: 90%;
    border: 1px solid #e0e0e0;
    transform: translateY(-5vh);
    position: relative;
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}
.auth-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2px;
}

.logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.logo-icon {
    font-size: 32px;
    margin-right: 10px;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    color: #222222;
}

.auth-subtitle {
    font-size: 16px;
    color: #222222;
    margin-bottom: 0px;
    margin-top: -8px;
}

.auth-description {
    font-size: 14px;
    color: #757575;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.auth-btn {
    background: #2291FF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(34, 145, 255, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.read-btn {
    background: #1261AE;
    box-shadow: 0 8px 24px rgba(18, 97, 174, 0.25);
}

.edit-btn {
    background: #2291FF;
    box-shadow: 0 8px 24px rgba(34, 145, 255, 0.25);
}

.auth-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.auth-btn:hover::before {
    left: 100%;
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.btn-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-subtitle {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

.btn-icon {
    font-size: 24px;
    margin-right: 10px;
}

/* Стили для SVG иконок - делаем их белыми */
.icon-img {
    width: 20px;
    height: 20px;
    filter: invert(1) brightness(2);
}

.btn-arrow {
    font-size: 20px;
    margin-left: 10px;
}

.auth-footer {
    text-align: center;
    font-size: 12px;
    color: #999;
}

.password-modal {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0;
    z-index: 10000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
}

/* Когда модальное окно пароля активно */
.password-modal[style*="block"] {
    display: flex !important;
}

.password-modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    margin: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.8);
    position: relative;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(34, 145, 255, 0.3);
}

.password-modal-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.password-icon {
    font-size: 80px;
    margin-bottom: 20px;
    filter: none;
    animation: pulse 2s infinite;
}

.password-modal-header h2 {
    color: #222222;
    margin: 15px 0 8px 0;
    font-size: 26px;
    font-weight: 600;
}

.password-modal-header p {
    color: #757575;
    font-size: 15px;
    margin: 0;
    line-height: 1.4;
}

.modern-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: none;
    font-weight: normal;
}

.modern-close:hover {
    background: transparent;
    color: #000;
    transform: none;
    box-shadow: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.password-input-container {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    border: 2px solid rgba(34, 145, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.password-input-container:focus-within {
    border-color: #2291FF;
    box-shadow: 0 0 0 3px rgba(34, 145, 255, 0.1);
    transform: translateY(-1px);
}

.password-input-container input {
    border: none;
    padding: 16px 18px;
    flex: 1;
    font-size: 16px;
    background: transparent;
    color: #222222;
    font-weight: 500;
}

.password-input-container input:focus {
    outline: none;
}

.password-input-container input::placeholder {
    color: #757575;
    font-weight: 400;
}

.input-icon {
    background: linear-gradient(135deg, #2291FF, #1261AE);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.input-icon .icon-img {
    filter: invert(1) brightness(2);
    width: 18px;
    height: 18px;
}

.password-error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: none;
    text-align: center;
    font-weight: 500;
}

.password-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.password-btn {
    border: none;
    border-radius: 12px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 120px;
}

.password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.password-btn:focus {
    outline: none;
}

.cancel-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
}

.confirm-btn {
    background: linear-gradient(135deg, #2291FF, #1261AE);
    color: white;
}

.confirm-btn:hover {
    background: linear-gradient(135deg, #1261AE, #0a4d8a);
}

.auth-section h2 {
    margin-bottom: 30px;
    font-size: 24px;
    text-align: center;
}

.auth-section button {
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
}

.auth-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Информация о режиме доступа */
.access-info {
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
    font-size: 16px;
}

/* Стили для режима только чтения */
.plan-table.readonly {
    opacity: 0.9;
}

.plan-table.readonly .actions-column {
    display: none;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #222222;
}

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

/* Стили для контейнера кнопки печати */
.print-button-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    padding: 12px;
}

.print-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.print-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.print-btn .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
}




.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-buttons.always-visible {
    display: flex !important;
}

.header-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.header-buttons .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
}

.header-buttons .icon-img {
    width: 16px;
    height: 16px;
}

/* Стили для кнопки настроек в хедере */
.header-buttons .settings-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    transition: opacity 0.2s ease;
    margin: 0;
    top: 20px;
    right: 75px; /* Позиционируем слева от кнопки "Выход" */
    z-index: 200;
}

.header-buttons .settings-btn:hover {
    opacity: 0.7;
}

.header-buttons .settings-btn .settings-icon {
    width: 20px;
    height: 20px;
    filter: none; /* Оставляем иконку черной */
}

/* Выпадающее меню настроек в хедере */
.header-buttons .settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.header-buttons .settings-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-buttons .settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
    justify-content: flex-start; /* Выравниваем содержимое по левому краю */
}

.header-buttons .settings-item:hover {
    background-color: #f5f5f5;
}

.header-buttons .settings-item:first-child {
    border-radius: 8px 8px 0 0;
}

.header-buttons .settings-item:last-child {
    border-radius: 0 0 8px 8px;
}

.header-buttons .settings-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-right: 10px; /* Фиксированный отступ справа от иконки */
}

/* Дополнительные стили для точного выравнивания */
.header-buttons .settings-item span,
.header-buttons .settings-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Убираем любые отступы, которые могут сдвигать элементы */
.header-buttons .settings-dropdown {
    padding: 0;
    overflow: hidden;
}

.plan-table-container {
    margin-bottom: 16px;
}

.plan-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.plan-table th, .plan-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
}

.plan-table th {
    background-color: #f2f2f2;
    text-align: left;
}

.plan-table td {
    text-align: left;
}

.office-cell {
    background-color: #f8f8f8;
    font-weight: bold;
    text-align: center;
    vertical-align: middle;
    border-right: 2px solid #000;
}

.section-header {
    background-color: #666666 !important;
    color: white !important;
    text-align: center !important;
    font-weight: bold;
    padding: 8px;
    vertical-align: middle;
}

.load-unload-header {
    border: 1px solid #000;
}

.btn {
    padding: 8px 16px;
    font-size: 16px;
    border-radius: 8px;
}
.btn-primary {
    background-color: #1F87EF;
    color: white;
    border: none;
    cursor: pointer;
}
.btn-secondary {
    background-color: #1C7EDF;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-info {
    background-color: #1874CF;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-success:hover {
    background-color: #218838;
}

.btn:hover {
    opacity: 0.8;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 24px;
    border: 1px solid #888;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 16px;
    margin-bottom: 24px;
    position: relative;
}

.modal-header h2 {
    color: #222222;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #222222;
    font-weight: 600;
    font-size: 14px;
}

.form-group select, .form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    color: #222222;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-group select:focus, .form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #2291FF;
    box-shadow: 0 0 0 3px rgba(34, 145, 255, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
}

.form-buttons .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.form-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.icon {
    margin-right: 8px;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.large-modal {
    width: 90%;
    max-width: 1000px;
}

.history-controls {
    margin-bottom: 16px;
    text-align: center;
}

.history-controls .btn {
    margin: 0 8px;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.history-date {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.history-meta {
    font-size: 12px;
    color: #757575;
    display: flex;
    gap: 16px;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
}

.history-preview {
    font-size: 14px;
    color: #757575;
    line-height: 1.4;
}

.no-history {
    text-align: center;
    padding: 32px;
    color: #757575;
    font-style: italic;
}

.custom-address-field {
    transition: all 0.3s ease;
}

.custom-address-field input {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.custom-address-field input:focus {
    border-color: #4CAF50;
    outline: none;
}

/* Стили для современного календаря */
.modern-date-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    min-width: 220px;
    margin-top: 8px;
}

.modern-date-picker:hover {
    border-color: #2291FF;
    box-shadow: 0 4px 16px rgba(34, 145, 255, 0.15);
    transform: translateY(-1px);
}

.current-date {
    font-size: 16px;
    font-weight: 500;
    color: #222222;
    flex: 1;
}

.calendar-icon {
    width: 20px;
    height: 20px;
    margin-left: 12px;
    filter: invert(0.4);
    transition: all 0.3s ease;
}

.modern-date-picker:hover .calendar-icon {
    filter: invert(0);
    transform: scale(1.1);
}

/* Выпадающий календарь */
.calendar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 16px;
    animation: slideDown 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-nav {
    background: #f8f9fa;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #2291FF;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: #2291FF;
    color: white;
    transform: scale(1.1);
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #222222;
    min-width: 140px;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    padding: 8px 4px;
    text-transform: uppercase;
}

.calendar-weekdays span.weekend {
    color: #e74c3c;
    font-weight: 600;
}

.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}

.calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-date:hover {
    background: #e3f2fd;
    transform: scale(1.05);
}

.calendar-date.other-month {
    color: #cccccc;
}

.calendar-date.weekend {
    color: #e74c3c !important;
    font-weight: 600;
}

.calendar-date.holiday {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.calendar-date.selected {
    background: linear-gradient(135deg, #2291FF, #1261AE);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(34, 145, 255, 0.3);
}

/* Разделение между месяцами */
.calendar-date.month-separator {
    border-top: 2px solid #f0f0f0;
}

.calendar-footer {
    display: flex;
    justify-content: center;
    padding-top: 12px;
    border-top: 2px solid #f0f0f0;
}

.today-button {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.today-button:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* Стили для селектора даты */
.date-selector {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

/* Адаптивность календаря */
@media (max-width: 768px) {
    .modal-content {
        margin: 1% auto;
        width: 95%;
        max-width: none;
        padding: 16px;
        max-height: 98vh;
    }
    
    .modal-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .form-buttons {
        margin-top: 20px;
        padding-top: 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .form-buttons .btn {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .modern-date-picker {
        min-width: 200px;
        padding: 10px 12px;
    }
    
    .calendar-dropdown {
        padding: 12px;
    }
    
    .calendar-month-year {
        font-size: 16px;
        min-width: 120px;
    }
    
    .calendar-nav {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .modal-content {
        padding: 12px;
    }
    
    .form-group textarea {
        min-height: 60px;
    }
}

/* Стили для кнопок действий в таблице */
.actions-column {
    text-align: center;
    min-width: 80px;
    padding: 8px !important;
    vertical-align: middle;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* Стили для иконок действий в таблице */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border: none;
    background: none !important;
    cursor: pointer;
    transition: transform 0.1s ease;
    padding: 2px;
    margin: 0;
    outline: none;
    box-shadow: none !important;
}

.action-btn:hover {
    background: none !important;
    transform: scale(1.1);
    box-shadow: none !important;
    outline: none;
}

.action-btn:focus {
    background: none !important;
    outline: none;
    box-shadow: none !important;
}

.action-btn:active {
    background: none !important;
    box-shadow: none !important;
}

/* Полная очистка стилей кнопок действий */
.action-btn,
.action-btn:hover,
.action-btn:focus,
.action-btn:active,
.action-btn:visited {
    background-color: transparent !important;
    background-image: none !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.action-icon {
    width: 18px;
    height: 18px;
    transition: filter 0.2s ease;
    /* По умолчанию иконки чёрные */
    filter: none;
    display: block;
}

/* При наведении иконка редактирования становится синей */
.edit-btn:hover .action-icon {
    filter: invert(41%) sepia(100%) saturate(1347%) hue-rotate(200deg) brightness(98%) contrast(101%);
}

/* При наведении иконка корзины становится красной */
.delete-btn:hover .action-icon {
    filter: invert(20%) sepia(100%) saturate(7482%) hue-rotate(0deg) brightness(97%) contrast(89%);
}

/* Стиль для режима только чтения */
.read-only-text {
    color: #666;
    font-size: 12px;
    font-style: italic;
    display: block;
    text-align: center;
}


/* === СТИЛИ ДЛЯ УПРАВЛЕНИЯ ОФИСАМИ === */
.office-controls, .field-controls {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.add-office-form, .add-field-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    border: 2px solid #e9ecef;
}

.office-list, .field-list {
    margin-top: 24px;
}

.office-list h3, .field-list h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.office-items, .field-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.office-item, .field-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.office-item:hover, .field-item:hover {
    background: #f8f9fa;
    border-color: #2291FF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.office-info, .field-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.office-code, .field-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.office-address, .field-details {
    color: #666;
    font-size: 14px;
}

.office-actions, .field-actions {
    display: flex;
    gap: 8px;
}

.delete-office-btn, .delete-field-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.delete-office-btn:hover, .delete-field-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.required-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.optional-badge {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

/* Стили для кнопки выхода */
.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #3D3D3D;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    z-index: 100;
}

.logout-btn:hover {
    color: #2a2a2a;
    text-decoration: underline;
    opacity: 0.7;
    background: rgba(61, 61, 61, 0.1);
}

/* Классы для управления видимостью при печати */
.screen-only {
    display: inline;
}

.print-only {
    display: none;
}

/* Стили для печати */
@media print {
    /* Показываем print-only и скрываем screen-only элементы */
    .screen-only {
        display: none !important;
    }
    
    .print-only {
        display: inline !important;
    }
    
    body {
        font-size: 12px;
        margin: 0;
        padding: 0;
    }
    
    /* Скрываем только кнопки действий, header, кнопку печати, кнопку выхода, кнопку настроек и выпадающее меню */
    .header, .header-buttons, .actions-column, .access-info, .print-button-container, .logout-btn, .settings-btn, .settings-dropdown {
        display: none !important;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 5px;
    }
    
    /* Стили для заголовка печати */
    .date-selector {
        margin: 0 0 5px 0;
        padding: 0;
        font-weight: bold;
        font-size: 14px;
        text-align: center;
    }
    
    .date-selector label {
        display: none;
    }
    
    /* Скрываем современный календарь при печати */
    .modern-date-picker,
    .calendar-dropdown {
        display: none !important;
    }
    
    /* Скрываем обычное поле даты при печати */
    .date-selector input {
        display: none !important;
    }
    
    /* Элемент для отображения заголовка при печати */
    .print-date-title {
        display: block !important;
        font-weight: bold !important;
        font-size: 18px !important;
        text-align: left !important;
        margin-bottom: 10px !important;
        margin-top: 0 !important;
    }
    
    .plan-table-container {
        margin: 0;
        padding: 0;
    }
    
    /* СТИЛИ ДЛЯ ТАБЛИЦЫ ПРИ ПЕЧАТИ */
    .plan-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 0 !important;
        page-break-inside: auto !important;
        margin-top: 5px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: white !important;
    }
    
    .plan-table th, .plan-table td {
        border: 1px solid #000 !important;
        padding: 3px !important;
        font-size: 9px !important;
        word-wrap: break-word !important;
        line-height: 1.2 !important;
        transition: none !important;
    }
    
    .plan-table th {
        background-color: #f2f2f2 !important;
        color: #000 !important;
        font-weight: bold !important;
        text-align: left !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        font-size: 9px !important;
        padding: 3px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .plan-table td {
        background: white !important;
        border-bottom: 1px solid #000 !important;
    }
    
    .plan-table tbody tr:hover {
        background: none !important;
    }
    
    /* ВАЖНО: Офисные ячейки остаются видимыми */
    .office-cell {
        background-color: #f8f8f8 !important;
        color: #000 !important;
        font-weight: bold !important;
        text-align: center !important;
        vertical-align: middle !important;
        border-right: 2px solid #000 !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        display: table-cell !important;
    }
    
    /* ВАЖНО: Заголовки секций Загрузка/Выгрузка остаются видимыми и серыми */
    .plan-table .section-header {
        background-color: #666666 !important;
        color: white !important;
        text-align: center !important;
        font-weight: bold !important;
        padding: 3px !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        font-size: 9px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        display: table-cell !important;
        border-bottom: 1px solid #000 !important;
        vertical-align: middle !important;
    }
    
    /* Оптимизация ширины колонок */
    .office-column {
        width: 8%;
    }
    
    .direction-column {
        width: 12%;
    }
    
    .person-column {
        width: 15%;
    }
    
    .item-column {
        width: 25%;
    }
    
    .quantity-column {
        width: 6%;
    }
    
    .note-column {
        width: 20%;
    }
    
    .signature-column {
        width: 14%;
    }
    
    .modal {
        display: none !important;
    }
    
    /* Настройки страницы */
    @page {
        size: A4;
        margin: 0.5cm;
    }
    
    /* Убираем отступы у заголовков */
    h1 {
        display: none !important;
    }
}
