* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px;
    max-width: 700px;
    width: 100%;
    margin: 20px;
}

h1 {
    color: #2e7d32;
    font-size: 28px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 {
    color: #1b5e20;
    margin-bottom: 20px;
    font-size: 22px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    background: #43a047;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-decoration: none !important;
}

a {
    text-decoration: none !important;
}

a:link,
a:visited,
a:hover,
a:active {
    text-decoration: none !important;
}

.btn:hover {
    background: #2e7d32;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.3);
}

.btn-danger {
    background: #e53935;
    color: white;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-secondary {
    background: #f9cfac;
    color: #5d4037;
}

.btn-secondary:hover {
    background: #ccaa8e;
    color: #3e2723;
}

.btn-sm {
    padding: 8px 16px;
    width: auto;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.menu-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.menu-row .btn {
    flex: 1;
    min-width: 120px;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    border: 2px solid #43a047;
    color: #1b5e20;
}

.alert-error {
    background: #ffebee;
    border: 2px solid #e53935;
    color: #b71c1c;
}

.alert-info {
    background: #e3f2fd;
    border: 2px solid #1e88e5;
    color: #0d47a1;
}

.login-box {
    text-align: center;
}

.login-box .logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-box h1 {
    justify-content: center;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-user-block .user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header-user-block .btn-sm {
    flex-shrink: 0;
}

.user-info {
    font-size: 14px;
    color: #666;
}

.admin-badge {
    background: #e53935;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

.user-badge {
    background: #43a047;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-green {
    background: #c8e6c9;
    color: #1b5e20;
}

.badge-yellow {
    background: #fff9c4;
    color: #f57f17;
}

.badge-orange {
    background: #ffe0b2;
    color: #e65100;
}

.badge-red {
    background: #ffcdd2;
    color: #b71c1c;
}

.badge-dark {
    background: #212121;
    color: white;
}

.search-box {
    margin: 15px 0 20px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-count {
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
    white-space: nowrap;
    margin-left: auto;
}

.table-wrap {
    overflow-x: auto;
    margin: 10px 0;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    -webkit-overflow-scrolling: touch;
    background: white;
}

.table-wrap table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.table-wrap th {
    background: #2e7d32;
    color: white;
    padding: 10px 6px;
    text-align: left;
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 1px solid #4a8c4e;
}

.table-wrap th:last-child {
    border-right: none;
}

.table-wrap td {
    padding: 8px 6px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    border-right: 1px solid #f0f0f0;
}

.table-wrap td:last-child {
    border-right: none;
}

.table-wrap th:nth-child(1),
.table-wrap td:nth-child(1) {
    width: 35px;
    min-width: 35px;
    max-width: 35px;
}

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.table-wrap th:nth-child(3),
.table-wrap td:nth-child(3) {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
}

.table-wrap th:nth-child(4),
.table-wrap td:nth-child(4) {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
}

.table-wrap th:nth-child(5),
.table-wrap td:nth-child(5) {
    width: 160px;
    min-width: 130px;
    max-width: 200px;
}

.table-wrap th:nth-child(6),
.table-wrap td:nth-child(6) {
    width: 100px;
    min-width: 80px;
    max-width: 120px;
}

.table-wrap th:nth-child(7),
.table-wrap td:nth-child(7) {
    width: 100px;
    min-width: 80px;
    max-width: 120px;
}

.table-wrap th:nth-child(8),
.table-wrap td:nth-child(8) {
    width: auto;
    min-width: 120px;
}

.table-wrap th:nth-child(9),
.table-wrap td:nth-child(9) {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    text-align: center;
}

.table-wrap th:nth-child(10),
.table-wrap td:nth-child(10) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
}

.table-wrap tr:hover {
    background: #f5f5f5;
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

.photo-thumb {
    max-width: 45px;
    max-height: 45px;
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #e0e0e0;
    display: block;
    margin: 0 auto;
}

.photo-thumb:hover {
    transform: scale(1.1);
    border-color: #43a047;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.modal.show {
    display: flex;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.modal-close:hover {
    color: #e53935;
}

.btn-admin {
    background: #1976d2;
    color: white;
}

.btn-admin:hover {
    background: #1565c0;
    box-shadow: 0 5px 15px rgba(25, 118, 210, 0.3);
}

.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    text-decoration: none !important;
    transition: all 0.2s;
    margin: 0 2px;
    cursor: pointer;
}

.btn-edit {
    background: #e3f2fd;
    color: #0d47a1;
}

.btn-edit:hover {
    background: #bbdefb;
    transform: scale(1.1);
}

.btn-delete {
    background: #ffebee;
    color: #b71c1c;
}

.btn-delete:hover {
    background: #ffcdd2;
    transform: scale(1.1);
}

.user-card {
    background: #f9fafb;
    border: 2px solid #e8f5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-cell {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    font-size: 12px;
    padding: 6px 4px;
    vertical-align: top;
}

.comment-text {
    background: #fff9e6;
    border-left: 2px solid #f9cfac;
    padding: 4px 6px;
    border-radius: 5px;
    margin-bottom: 4px;
    line-height: 1.25;
    font-size: 11px;
    word-wrap: break-word;
}

.comment-form textarea {
    width: 100%;
    padding: 3px 5px;
    font-size: 11px;
    border-radius: 5px;
    margin-bottom: 3px;
    min-height: 24px;
    height: 24px;
    resize: vertical;
    line-height: 1.2;
    border-width: 1px;
}

.comment-form .btn-sm {
    width: 100%;
    padding: 3px 6px;
    font-size: 11px;
    min-height: 22px;
    border-radius: 5px;
    font-weight: 500;
    line-height: 1;
}

.table-wrap th:nth-child(11),
.table-wrap td:nth-child(11) {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    text-align: center;
}

.group-filter {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 220px;
    max-width: 100%;
    color: #333;
}

.group-filter:focus {
    outline: none;
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

.search-box .btn-sm {
    width: auto;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.date-filter-group {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 14px;
    height: 46px;
    box-sizing: border-box;
    transition: all 0.3s;
    vertical-align: middle;
}

.date-filter-group:focus-within {
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

.date-filter-group .date-filter-label {
    display: inline-block;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    line-height: 1;
}

.date-filter-group .date-filter {
    border: none;
    background: transparent;
    padding: 4px 2px;
    font-size: 14px;
    height: auto;
    width: 125px;
    min-width: 0;
    box-shadow: none;
    color: #333;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.date-filter-group .date-filter:focus {
    outline: none;
    box-shadow: none;
}

.table-wrap th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.table-wrap th.sortable:hover {
    background: #1b5e20;
}

.table-wrap th.sortable span {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.85;
}

#usersTable {
    min-width: 900px;
}

#usersTable th:nth-child(1),
#usersTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: center;
}

#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
    width: auto;
    min-width: 130px;
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) {
    width: 130px;
    min-width: 130px;
}

#usersTable th:nth-child(4),
#usersTable td:nth-child(4) {
    width: 140px;
    min-width: 130px;
    text-align: center;
}

#usersTable th:nth-child(5),
#usersTable td:nth-child(5) {
    width: auto;
    min-width: 150px;
}

#usersTable th:nth-child(6),
#usersTable td:nth-child(6) {
    width: 80px;
    min-width: 70px;
    text-align: center;
}

#usersTable th:nth-child(7),
#usersTable td:nth-child(7) {
    width: 100px;
    min-width: 100px;
    text-align: center;
}

#usersTable tr:hover {
    background: #f5f5f5;
}

#dirTable {
    min-width: 500px;
}

#dirTable th:nth-child(1),
#dirTable td:nth-child(1) {
    width: 60px;
    text-align: center;
}

#dirTable th:last-child,
#dirTable td:last-child {
    width: 100px;
    text-align: center;
}

.password-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 13px;
}

.password-hidden {
    letter-spacing: 2px;
    user-select: all;
}

.btn-show-pass {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}

.btn-show-pass:hover {
    background: #e8f5e9;
}

.comment-meta {
    font-size: 10px;
    color: #888;
    margin-top: 3px;
    font-style: italic;
    text-align: right;
    line-height: 1.2;
}

@media (min-width: 900px) and (max-width: 1024px) {
    body {
        align-items: center;
        justify-content: center;
        padding: 20px;
        min-height: 100vh;
    }

    body:has(.login-box) {
        align-items: center;
    }

    .container {
        max-width: 700px;
        padding: 30px 35px;
    }

    .container:has(.table-wrap) {
        max-width: 98vw;
        padding: 25px;
    }

    .container:has(.table-wrap) .table-wrap {
        overflow-x: visible;
    }

    .container:has(.table-wrap) .table-wrap table {
        min-width: 100%;
        table-layout: auto;
        font-size: 12px;
    }

    .container:has(.table-wrap) .table-wrap th,
    .container:has(.table-wrap) .table-wrap td {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 8px 5px;
        font-size: 12px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(1),
    .container:has(.table-wrap) .table-wrap td:nth-child(1) {
        min-width: 30px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(2),
    .container:has(.table-wrap) .table-wrap td:nth-child(2) {
        min-width: 75px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(3),
    .container:has(.table-wrap) .table-wrap td:nth-child(3) {
        min-width: 50px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(4),
    .container:has(.table-wrap) .table-wrap td:nth-child(4) {
        min-width: 50px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(5),
    .container:has(.table-wrap) .table-wrap td:nth-child(5) {
        min-width: 120px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(6),
    .container:has(.table-wrap) .table-wrap td:nth-child(6) {
        min-width: 80px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(7),
    .container:has(.table-wrap) .table-wrap td:nth-child(7) {
        min-width: 80px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(8),
    .container:has(.table-wrap) .table-wrap td:nth-child(8) {
        min-width: 120px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(9),
    .container:has(.table-wrap) .table-wrap td:nth-child(9) {
        min-width: 50px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(10),
    .container:has(.table-wrap) .table-wrap td:nth-child(10) {
        min-width: 70px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(11),
    .container:has(.table-wrap) .table-wrap td:nth-child(11) {
        min-width: 140px;
    }

    .container:has(.table-wrap) .photo-thumb {
        max-width: 40px;
        max-height: 40px;
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 1025px) {
    body {
        align-items: flex-start;
        padding: 30px 20px;
    }

    body:has(.login-box) {
        align-items: center;
    }

    .container {
        max-width: 650px;
        padding: 35px 40px;
    }

    .container:has(.table-wrap) {
        max-width: 1400px;
        padding: 30px 35px;
    }

    .container:has(.table-wrap) .table-wrap {
        overflow-x: visible;
    }

    .container:has(.table-wrap) .table-wrap table {
        min-width: 100%;
        table-layout: auto;
        font-size: 13px;
    }

    .container:has(.table-wrap) .table-wrap th,
    .container:has(.table-wrap) .table-wrap td {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 12px 8px;
        font-size: 13px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(1),
    .container:has(.table-wrap) .table-wrap td:nth-child(1) {
        min-width: 35px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(2),
    .container:has(.table-wrap) .table-wrap td:nth-child(2) {
        min-width: 85px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(3),
    .container:has(.table-wrap) .table-wrap td:nth-child(3) {
        min-width: 55px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(4),
    .container:has(.table-wrap) .table-wrap td:nth-child(4) {
        min-width: 55px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(5),
    .container:has(.table-wrap) .table-wrap td:nth-child(5) {
        min-width: 150px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(6),
    .container:has(.table-wrap) .table-wrap td:nth-child(6) {
        min-width: 90px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(7),
    .container:has(.table-wrap) .table-wrap td:nth-child(7) {
        min-width: 90px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(8),
    .container:has(.table-wrap) .table-wrap td:nth-child(8) {
        min-width: 130px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(9),
    .container:has(.table-wrap) .table-wrap td:nth-child(9) {
        min-width: 55px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(10),
    .container:has(.table-wrap) .table-wrap td:nth-child(10) {
        min-width: 80px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(11),
    .container:has(.table-wrap) .table-wrap td:nth-child(11) {
        min-width: 150px;
    }

    .container:has(.table-wrap) .photo-thumb {
        max-width: 50px;
        max-height: 50px;
        width: 50px;
        height: 50px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 650px;
    }

    .container:has(.table-wrap) {
        max-width: 1300px;
    }

    .container:has(.table-wrap) .table-wrap table {
        font-size: 14px;
    }

    .container:has(.table-wrap) .table-wrap th,
    .container:has(.table-wrap) .table-wrap td {
        padding: 13px 9px;
        font-size: 14px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(5),
    .container:has(.table-wrap) .table-wrap td:nth-child(5) {
        min-width: 170px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(8),
    .container:has(.table-wrap) .table-wrap td:nth-child(8) {
        min-width: 160px;
    }
}

@media (min-width: 1441px) {
    .container {
        max-width: 700px;
    }

    .container:has(.table-wrap) {
        max-width: 1400px;
    }

    .container:has(.table-wrap) .table-wrap table {
        font-size: 15px;
    }

    .container:has(.table-wrap) .table-wrap th,
    .container:has(.table-wrap) .table-wrap td {
        padding: 14px 10px;
        font-size: 15px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(5),
    .container:has(.table-wrap) .table-wrap td:nth-child(5) {
        min-width: 190px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(8),
    .container:has(.table-wrap) .table-wrap td:nth-child(8) {
        min-width: 180px;
    }

    .container:has(.table-wrap) .photo-thumb {
        max-width: 55px;
        max-height: 55px;
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 768px) {
    body {
        align-items: center;
        padding: 10px 0;
        min-height: 100vh;
    }

    .container {
        padding: 20px 15px;
        margin: 10px;
        border-radius: 14px;
        max-width: 100%;
    }

    h1 {
        font-size: 20px;
        justify-content: center;
        text-align: center;
    }

    h2 {
        font-size: 17px;
        text-align: center;
    }

    .header-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        margin-bottom: 15px;
        flex-wrap: nowrap;
    }

    .header-actions h1 {
        display: none;
    }

    .header-user-block {
        flex-shrink: 0;
        justify-content: flex-end;
    }

    .header-user-block .btn-sm {
        width: auto;
        padding: 12px 15px !important;
        font-size: 13px !important;
        min-height: 40px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .btn-admin {
        width: auto !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-height: 40px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .btn-danger.btn-sm {
        padding: 12px 16px !important;
        font-size: 16px !important;
        min-height: 40px;
        white-space: nowrap;
    }

    .login-box {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 80vh;
        width: 100%;
        text-align: center;
    }

    .login-box form {
        width: 100%;
        max-width: 100%;
        text-align: left;
    }

    .login-box h1 {
        justify-content: center;
        text-align: center;
        font-size: 20px;
    }

    .login-box .logo {
        font-size: 48px;
        text-align: center;
    }

    .login-box p {
        text-align: center;
    }

    .login-box .btn {
        padding: 16px 20px !important;
        font-size: 17px !important;
        min-height: 54px;
    }

    .menu-row {
        flex-direction: column;
        gap: 8px;
    }

    .menu-row .btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        min-width: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        padding: 11px;
    }

    textarea {
        min-height: 90px;
    }

    .btn {
        padding: 13px 18px;
        font-size: 15px;
    }

    .btn-sm {
        padding: 8px 14px;
        font-size: 13px;
    }

    .search-box {
        margin: 10px 0 15px 0;
    }

    .search-box input[type="text"] {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 50px;
    }

    .search-count {
        font-size: 13px;
        width: 100%;
        text-align: center;
        margin-left: 0;
    }

    .group-filter {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px;
        width: 100%;
        min-width: 0;
    }

    .search-box .btn-sm {
        width: 100%;
        padding: 12px;
        font-size: 15px;
        min-height: 48px;
    }

    .date-filter-group {
        width: 100%;
        height: auto;
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 6px 10px;
    }

    .date-filter-group .date-filter {
        width: 100%;
        padding: 8px 4px;
        font-size: 15px;
    }

    .date-filter-group .date-filter-label {
        font-size: 15px;
    }

    .table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
        margin: 10px 0;
        border-radius: 0;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        margin-bottom: 14px;
        padding: 14px 16px;
        border: 1px solid #e8f5e9;
        position: relative;
    }

    .table-wrap tr:hover {
        background: #fff;
    }

    .table-wrap td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        border-right: none;
        font-size: 16px;
        line-height: 1.5;
        text-align: right;
        min-height: auto;
        max-width: none;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .table-wrap td:last-child {
        border-bottom: none;
    }

    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #2e7d32;
        text-align: left;
        flex-shrink: 0;
        font-size: 15px;
        padding-right: 8px;
    }

    .table-wrap th:nth-child(n),
    .table-wrap td:nth-child(n) {
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .table-wrap td:nth-child(1) {
        position: absolute;
        top: 12px;
        right: 14px;
        background: #e8f5e9;
        color: #2e7d32;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 700;
        border: none;
        display: block;
        width: auto;
        text-align: center;
    }

    .table-wrap td:nth-child(1)::before {
        content: 'ID ';
        font-weight: 600;
    }

    .table-wrap td:nth-child(2) {
        font-weight: 700;
        font-size: 20px;
        color: #1b5e20;
        border-bottom: 2px solid #e8f5e9;
        padding-bottom: 12px;
        padding-right: 75px;
        justify-content: flex-start;
    }

    .table-wrap td:nth-child(2)::before {
        content: '📅 ';
        color: #1b5e20;
        font-size: 20px;
    }

    .table-wrap td:nth-child(3)::before {
        content: '🕐 Время:';
    }

    .table-wrap td:nth-child(4)::before {
        content: '🏛️ Место:';
    }

    .table-wrap td:nth-child(5)::before {
        content: '⚠️ Связано с:';
    }

    .table-wrap td:nth-child(6)::before {
        content: '👨‍⚕️ Сотрудник:';
    }

    .table-wrap td:nth-child(7)::before {
        content: '💼 Должность:';
    }

    .table-wrap td:nth-child(8)::before {
        content: '📝 Описание:';
    }

    .table-wrap td:nth-child(9)::before {
        content: '📷 Фото:';
    }

    .table-wrap td:nth-child(10)::before {
        content: '💬 Комментарий:';
    }

    .table-wrap td:nth-child(11)::before {
        content: '';
    }

    .table-wrap td:nth-child(8) {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .table-wrap td:nth-child(8)::before {
        margin-bottom: 6px;
    }

    .table-wrap td:nth-child(9) {
        flex-direction: column;
        align-items: flex-start;
    }

    .photo-thumb {
        max-width: 90px;
        max-height: 90px;
        width: 90px;
        height: 90px;
        border-radius: 10px;
        margin-top: 8px;
    }

    .table-wrap td:nth-child(10) {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .table-wrap td:nth-child(10)::before {
        margin-bottom: 6px;
    }

    .comment-cell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .comment-form textarea {
        font-size: 14px;
        padding: 8px;
        height: auto;
        min-height: 60px;
    }

    .comment-form .btn-sm {
        padding: 10px;
        font-size: 14px;
        min-height: 40px;
    }

    .comment-text {
        font-size: 14px;
        padding: 8px 10px;
    }

    .comment-meta {
        font-size: 12px;
        margin-top: 5px;
        text-align: left;
    }

    .table-wrap td:nth-child(11) {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
        padding-top: 14px;
        border-top: 1px solid #e8f5e9;
        border-bottom: none;
    }

    .btn-action {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 12px;
    }

    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }

    .modal img {
        max-width: 95%;
        max-height: 80%;
    }

    .alert {
        padding: 14px;
        font-size: 16px;
    }

    .table-wrap th.sortable {
        display: none;
    }

    .container:has(#usersTable) {
        max-width: 100%;
        padding: 20px 15px;
    }

    .container:has(#usersTable) .table-wrap {
        overflow-x: auto;
        border: 1px solid #e0e0e0;
        background: #fff;
    }

    .container:has(#usersTable) .table-wrap table {
        min-width: 700px;
        display: table;
        table-layout: auto;
    }

    .container:has(#usersTable) .table-wrap thead {
        display: table-header-group;
    }

    .container:has(#usersTable) .table-wrap tbody {
        display: table-row-group;
    }

    .container:has(#usersTable) .table-wrap tr {
        display: table-row;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
        padding: 0;
        border: none;
    }

    .container:has(#usersTable) .table-wrap th {
        display: table-cell;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 8px 6px;
        font-size: 12px;
    }

    .container:has(#usersTable) .table-wrap td {
        display: table-cell;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 8px 6px;
        font-size: 13px;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
        border-right: 1px solid #f0f0f0;
    }

    .container:has(#usersTable) .table-wrap td::before {
        content: none !important;
    }

    .container:has(#usersTable) .table-wrap td:nth-child(1) {
        position: static;
        background: transparent;
        color: inherit;
        padding: 8px 6px;
        border-radius: 0;
        font-size: 13px;
        font-weight: 400;
        width: auto !important;
        text-align: center;
    }

    .container:has(#usersTable) .table-wrap td:nth-child(1)::before {
        content: none !important;
    }

    .container:has(#usersTable) .table-wrap .badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .container:has(#usersTable) .table-wrap .btn-action {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .container:has(#usersTable) .table-wrap .actions-cell {
        padding: 6px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px 0;
    }

    .container {
        padding: 20px 12px;
        margin: 15px;
        border-radius: 12px;
    }

    h1 {
        font-size: 17px;
        gap: 6px;
    }

    h2 {
        font-size: 15px;
    }

    label {
        font-size: 13px;
    }

    input,
    select,
    textarea {
        padding: 10px;
        font-size: 16px;
        border-radius: 8px;
    }

    .btn {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 8px;
    }

    .btn-sm {
        padding: 7px 13px;
        font-size: 13px;
    }

    .search-box input[type="text"] {
        padding: 12px 14px;
        font-size: 16px;
        min-height: 48px;
    }

    .search-count {
        font-size: 12px;
    }

    .table-wrap tr {
        padding: 12px 14px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .table-wrap td {
        font-size: 15px;
        padding: 9px 0;
        gap: 10px;
    }

    .table-wrap td::before {
        font-size: 14px;
    }

    .table-wrap td:nth-child(1) {
        font-size: 13px;
        padding: 4px 10px;
        top: 10px;
        right: 12px;
    }

    .table-wrap td:nth-child(2) {
        font-size: 18px;
        padding-right: 70px;
    }

    .table-wrap td:nth-child(2)::before {
        font-size: 18px;
    }

    .photo-thumb {
        max-width: 80px;
        max-height: 80px;
        width: 80px;
        height: 80px;
    }

    .btn-action {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .modal-close {
        font-size: 28px;
    }

    .alert {
        padding: 12px;
        font-size: 15px;
    }

    .login-box .logo {
        font-size: 40px;
    }

    .login-box h1 {
        font-size: 20px;
    }

    .login-box {
        min-height: 60vh;
    }

    .btn-admin {
        width: auto !important;
        padding: 12px 18px !important;
        font-size: 14px !important;
        min-height: 44px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .btn-danger.btn-sm {
        width: auto !important;
        padding: 12px 18px !important;
        font-size: 14px !important;
        min-height: 44px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .header-user-block .btn-sm {
        width: auto;
        padding: 12px 18px !important;
        font-size: 14px !important;
        min-height: 44px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .login-box .btn {
        padding: 16px 22px !important;
        font-size: 16px !important;
        min-height: 52px;
        border-radius: 10px;
    }

    .container:has(#usersTable) .table-wrap table {
        min-width: 600px;
        font-size: 12px;
    }

    .container:has(#usersTable) .table-wrap th,
    .container:has(#usersTable) .table-wrap td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .container:has(#usersTable) .table-wrap .btn-action {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .container:has(#usersTable) .table-wrap .badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 12px 10px;
    }

    h1 {
        font-size: 15px;
    }

    h2 {
        font-size: 14px;
    }

    .btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .table-wrap tr {
        padding: 10px 12px;
        margin-bottom: 10px;
        border-radius: 10px;
    }

    .table-wrap td {
        font-size: 14px;
        padding: 8px 0;
        gap: 8px;
    }

    .table-wrap td::before {
        font-size: 13px;
    }

    .table-wrap td:nth-child(1) {
        font-size: 12px;
        padding: 3px 8px;
        top: 8px;
        right: 10px;
    }

    .table-wrap td:nth-child(2) {
        font-size: 16px;
        padding-right: 60px;
    }

    .table-wrap td:nth-child(2)::before {
        font-size: 16px;
    }

    .photo-thumb {
        max-width: 70px;
        max-height: 70px;
        width: 70px;
        height: 70px;
    }

    .btn-action {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (min-width: 1921px) {
    body {
        padding: 40px 30px;
    }

    .container {
        max-width: 800px;
        padding: 45px 55px;
        border-radius: 24px;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 26px;
    }

    label {
        font-size: 15px;
    }

    input,
    select,
    textarea {
        padding: 14px;
        font-size: 16px;
        border-radius: 12px;
    }

    textarea {
        min-height: 120px;
    }

    .btn {
        padding: 16px 32px;
        font-size: 17px;
        border-radius: 12px;
    }

    .btn-sm {
        padding: 10px 20px;
        font-size: 15px;
    }

    .menu-row .btn {
        padding: 16px;
        font-size: 17px;
    }

    .search-box input[type="text"] {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 54px;
        border-radius: 12px;
    }

    .search-count {
        font-size: 15px;
    }

    .container:has(.table-wrap) {
        max-width: 1700px;
        padding: 45px 55px;
    }

    .container:has(.table-wrap) .table-wrap table {
        font-size: 16px;
    }

    .container:has(.table-wrap) .table-wrap th {
        font-size: 15px;
        padding: 16px 12px;
    }

    .container:has(.table-wrap) .table-wrap td {
        padding: 16px 12px;
        font-size: 16px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(1),
    .container:has(.table-wrap) .table-wrap td:nth-child(1) {
        min-width: 50px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(2),
    .container:has(.table-wrap) .table-wrap td:nth-child(2) {
        min-width: 120px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(3),
    .container:has(.table-wrap) .table-wrap td:nth-child(3) {
        min-width: 80px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(4),
    .container:has(.table-wrap) .table-wrap td:nth-child(4) {
        min-width: 100px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(5),
    .container:has(.table-wrap) .table-wrap td:nth-child(5) {
        min-width: 240px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(6),
    .container:has(.table-wrap) .table-wrap td:nth-child(6) {
        min-width: 160px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(7),
    .container:has(.table-wrap) .table-wrap td:nth-child(7) {
        min-width: 160px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(8),
    .container:has(.table-wrap) .table-wrap td:nth-child(8) {
        min-width: 240px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(9),
    .container:has(.table-wrap) .table-wrap td:nth-child(9) {
        min-width: 90px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(10),
    .container:has(.table-wrap) .table-wrap td:nth-child(10) {
        min-width: 130px;
    }

    .container:has(.table-wrap) .table-wrap th:nth-child(11),
    .container:has(.table-wrap) .table-wrap td:nth-child(11) {
        min-width: 220px;
    }

    .container:has(.table-wrap) .photo-thumb {
        max-width: 70px;
        max-height: 70px;
        width: 70px;
        height: 70px;
    }

    .btn-action {
        width: 44px;
        height: 44px;
        font-size: 20px;
        border-radius: 10px;
    }
}

@media (min-width: 2560px) {
    .container {
        max-width: 900px;
        padding: 50px 65px;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    input,
    select,
    textarea {
        padding: 16px;
        font-size: 17px;
    }

    .btn {
        padding: 18px 36px;
        font-size: 18px;
    }

    .container:has(.table-wrap) {
        max-width: 1900px;
        padding: 50px 65px;
    }

    .container:has(.table-wrap) .table-wrap table {
        font-size: 17px;
    }

    .container:has(.table-wrap) .table-wrap th {
        font-size: 16px;
        padding: 18px 14px;
    }

    .container:has(.table-wrap) .table-wrap td {
        padding: 18px 14px;
        font-size: 17px;
    }

    .container:has(.table-wrap) .photo-thumb {
        max-width: 80px;
        max-height: 80px;
        width: 80px;
        height: 80px;
    }

    .btn-action {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
}