body {
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    margin: 0;
    padding: 30px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
}

a {
    color: #2563eb;
    text-decoration: none;
}

.btn {
    display: inline-block;
    background: #1f2937;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: 0.2s;
}

.btn:hover {
    background: #111827;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: #111827;
    color: white;
}

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

input, select, textarea {
    width: 100%;
    max-width: 700px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.message {
    border: 1px solid #d1d5db;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #f9fafb;
}

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.priority-low {
    color: #166534;
    font-weight: bold;
}

.priority-high {
    color: #b45309;
    font-weight: bold;
}

.priority-urgent {
    color: #dc2626;
    font-weight: bold;
}

.status-new {
    color: #2563eb;
    font-weight: bold;
}

.status-work {
    color: #b45309;
    font-weight: bold;
}

.status-clarify {
    color: #7c3aed;
    font-weight: bold;
}

.status-done {
    color: #15803d;
    font-weight: bold;
}

.deadline-ok {
    color: #15803d;
    font-weight: bold;
}

.deadline-today {
    color: #b45309;
    font-weight: bold;
}

.deadline-overdue {
    color: #dc2626;
    font-weight: bold;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.request-title {
    margin-bottom: 8px;
}

.request-number {
    color: #6b7280;
    font-size: 16px;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.info-card {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 14px;
}

.info-label {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 6px;
}

.info-value {
    font-weight: 700;
    font-size: 16px;
}

.description-box {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 18px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.section-title {
    margin-top: 30px;
    margin-bottom: 12px;
    font-size: 22px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}

.badge-priority-normal {
    background: #dcfce7;
    color: #166534;
}

.badge-priority-high {
    background: #fef3c7;
    color: #92400e;
}

.badge-priority-urgent {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-status-work {
    background: #fef3c7;
    color: #92400e;
}

.badge-status-clarify {
    background: #ede9fe;
    color: #6d28d9;
}

.badge-status-done {
    background: #dcfce7;
    color: #166534;
}

.action-card {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 14px;

    padding: 20px;
    min-height: auto;
}
.question-box {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 14px;

    padding: 20px;
    font-size: 18px;
    margin-bottom: 24px;

    line-height: 1.6;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {

    .actions-grid {
        grid-template-columns: 1fr;
    }

}
.action-card {
    padding: 20px;
}

.action-card form {
    margin-bottom: 0;
}

.action-card.compact {
    min-height: auto;
}

.alert-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #111827;
    transition: 0.2s;
}

.alert-link:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.alert-danger {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}
.status-clarify {
    color: #7c3aed;
    font-weight: 700;
}

.category-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.category-payments {
    background: #dcfce7;
    color: #166534;
}

.category-wounded {
    background: #fee2e2;
    color: #991b1b;
}

.category-vlk {
    background: #dbeafe;
    color: #1d4ed8;
}

.category-legal {
    background: #ede9fe;
    color: #6d28d9;
}

.category-captivity {
    background: #ffedd5;
    color: #9a3412;
}

.category-missing {
    background: #fef9c3;
    color: #854d0e;
}

.category-other {
    background: #f3f4f6;
    color: #374151;
}

.table-wrapper {

    width: 100%;

    overflow-x: auto;

    display: block;

}

.table-wrapper table {

    min-width: 1200px;

}

.stat-card {
    min-width: 110px;
    border-left: 6px solid #d1d5db;
}

.stat-total {
    background: #eef4ff;
    border-left-color: #2563eb;
}

.stat-new {
    background: #fff8db;
    border-left-color: #f59e0b;
}

.stat-work {
    background: #ecfeff;
    border-left-color: #06b6d4;
}

.stat-done {
    background: #ecfdf5;
    border-left-color: #16a34a;
}

.stat-overdue {
    background: #fef2f2;
    border-left-color: #dc2626;
}

.category-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.category-payments {
    background: #dcfce7;
    color: #166534;
}

.category-wounded {
    background: #fee2e2;
    color: #991b1b;
}

.category-vlk {
    background: #dbeafe;
    color: #1d4ed8;
}

.category-legal {
    background: #ede9fe;
    color: #6d28d9;
}

.category-captivity {
    background: #ffedd5;
    color: #9a3412;
}

.category-missing {
    background: #fef9c3;
    color: #854d0e;
}

.category-other {
    background: #f3f4f6;
    color: #374151;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 18px 0 22px;
}

.tabs a {
    padding: 9px 14px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #d1d5db;
}

.tabs a.active {
    background: #111827;
    color: white;
    border-color: #111827;
}

.request-number-big {
    color: #6b7280;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.request-meta {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 26px;
}

.request-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.meta-value {
    font-size: 18px;
    font-weight: 700;
}

.meta-item {
    border-right: 1px solid #e5e7eb;
    padding-right: 12px;
}

.meta-item:last-child {
    border-right: none;
}

.meta-label {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 5px;
    font-weight: 700;
}

.meta-value {
    font-size: 16px;
    font-weight: 800;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-card {
    background: white;
    border-left: 4px solid #1d4ed8;
    border-radius: 12px;
    padding: 16px;
}

.chat-card-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.chat-author {
    font-weight: 800;
}

.chat-date {
    color: #6b7280;
    font-size: 13px;
}

.chat-text {
    line-height: 1.6;
}

.reply-box textarea {
    width: 100%;
    min-height: 120px;
}

.chat-card {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 14px;

    padding: 16px 18px;
    margin-bottom: 12px;

    transition: 0.2s;
}

.chat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}

.action-card.compact {
    padding: 22px;
}

.action-card.compact form {
    margin-bottom: 0;
}

.request-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.request-actions {
    display: flex !important;
    align-items: stretch;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.request-title-block {
    display: block;
    width: 100%;
    max-width: 100%;
}

.request-main-title {
    font-size: 38px;
    line-height: 1.15;
    margin: 0;
    max-width: 100%;
    word-break: break-word;
}

.request-actions .btn,
.request-actions button.btn {
    min-width: 150px;
    height: 42px;
    padding: 0 20px;
}

.request-actions input {
    width: 280px;
    height: 42px;
}

.request-actions form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.request-actions .btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 150px;
    height: 50px;

    padding: 0 20px !important;

    line-height: 1;
}

.request-actions button.btn,
.request-actions a.btn {
    box-sizing: border-box;
}

.request-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.request-actions form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.request-actions input {
    width: 260px;
    height: 50px;
}

.request-actions .btn {
    height: 50px;
    min-width: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 20px;
}

.question-box {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;

    font-size: 20px;
    line-height: 1.8;
}

.reply-box textarea,
.action-card textarea {
    min-height: 180px;
}

/* ===== REQUEST VIEW FINAL POLISH ===== */

.request-main-title {
    font-size: 38px !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    max-width: 100% !important;
    word-break: break-word;
}

.request-top {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px;
    margin-bottom: 24px;
}

.request-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.request-actions form {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
}

.request-actions .btn,
.request-actions button.btn,
.request-actions a.btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 170px !important;
    height: 50px !important;

    padding: 0 20px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.request-actions input {
    width: 280px !important;
    height: 50px !important;
    box-sizing: border-box !important;
}

.request-meta {
    padding: 20px !important;
    margin-bottom: 24px !important;
}

.request-meta-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
}

.meta-value {
    font-size: 18px !important;
    font-weight: 700 !important;
}

.question-box,
.description-box {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 24px !important;
    font-size: 20px !important;
    line-height: 1.8 !important;
    margin-bottom: 24px !important;
}

.reply-box textarea,
.action-card textarea {
    min-height: 160px !important;
}

.action-card {
    padding: 22px !important;
}

.last-activity {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-left: 5px solid #2563eb;
    border-radius: 12px;
    padding: 14px 18px;
    margin: -8px 0 24px;
    font-size: 15px;
    color: #111827;
}

.request-overdue {
    border-color: #fecaca !important;
    background: #fff7f7 !important;
}

.request-overdue::before {
    content: "⚠ Прострочено";
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.search-panel {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 18px;
    margin: 22px 0 28px;
}

.search-main {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.search-main input {
    flex: 1;
    max-width: none;
    height: 46px;
}

.search-main .btn {
    min-width: 130px;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.search-filters select,
.search-filters .btn {
    height: 44px;
}

.btn-light {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #d1d5db;
}

.btn-light:hover {
    background: #e5e7eb;
}

/* ===== CHAT AVATARS ===== */

.chat-card {
    display: flex !important;
    gap: 16px !important;
    align-items: flex-start !important;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-weight: 800;
    font-size: 18px;

    flex-shrink: 0;
}

.chat-body {
    flex: 1;
}

.chat-department {
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
}

/* кольори підрозділів */
.avatar-цвс {
    background: #2563eb;
}

.avatar-фес {
    background: #16a34a;
}

.avatar-юридична-служба {
    background: #7c3aed;
}

.avatar-стройова-служба {
    background: #b45309;
}

.avatar-командування {
    background: #dc2626;
}

.avatar-default {
    background: #111827;
}

.request-overdue {
    background: #fef2f2 !important;
}

.request-overdue:hover {
    background: #fee2e2 !important;
}

.request-overdue td {
    border-color: #fecaca;
}

.request-overdue-row td {
    background: #fef2f2 !important;
}

.request-overdue-row:hover td {
    background: #fee2e2 !important;
}

.create-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-card,
.form-section {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 20px;
}

.form-section {
    margin-bottom: 22px;
}

.form-card label,
.form-section label {
    display: block;
    font-weight: 800;
    margin-bottom: 10px;
}

.form-card input,
.form-card select,
.form-section input,
.form-section select,
.form-section textarea {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.form-section textarea {
    min-height: 180px;
}

.form-hint {
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.submit-row {
    margin-top: 24px;
}

.btn-create {
    min-width: 190px;
    height: 52px;
    font-size: 16px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .create-grid {
        grid-template-columns: 1fr;
    }
}

select[multiple] {
    min-height: 130px;
}

.department-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.department-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.department-item input {
    width: auto;
}

/* FIX department checkboxes */
.department-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

.department-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;

    width: fit-content !important;
    max-width: 100% !important;

    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.department-item input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;

    margin: 0 !important;
    padding: 0 !important;

    flex: 0 0 18px !important;
}

/* ===== IOS INPUT ZOOM FIX ===== */
input,
select,
textarea {
    font-size: 16px !important;
}

/* ===== MOBILE TAP FIX ===== */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

button,
.btn,
a,
input,
select,
textarea,
.mobile-request-card,
.action-card,
.form-card,
.message {
    touch-action: manipulation;
}

input,
select,
textarea {
    scroll-margin-top: 120px;
}

.request-view-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.close-request-form {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0;
}

/* ===== MOBILE FINAL ===== */

.mobile-requests {
    display: none;
}
.dashboard-actions {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin: 16px 0;
}

.dashboard-actions .btn {
    width: auto;
}

@media (max-width: 768px) {
        .dashboard-actions .btn {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 10px 12px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px !important;
        line-height: 1.2 !important;
        border-radius: 12px !important;
        box-sizing: border-box;
        text-align: center;
    }

    body {
        padding: 0 !important;
        font-size: 16px;
        overflow-x: hidden;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        border-radius: 0 !important;
        box-sizing: border-box;
    }

    h1,
    .request-main-title {
        font-size: 32px !important;
        line-height: 1.15 !important;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    textarea {
        width: 100% !important;
        resize: vertical;
    }

    .create-grid,
    .actions-grid,
    .request-meta-grid,
    .search-filters {
        grid-template-columns: 1fr !important;
    }

    .table-wrapper {
        display: none !important;
    }

    .mobile-requests {
        display: flex !important;
        flex-direction: column;
        gap: 14px;
        margin-top: 18px;
    }

    .mobile-request-card {
        background: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    }

    .mobile-overdue {
        background: #fff7f7;
        border-color: #fecaca;
    }

    .mobile-request-top,
    .mobile-request-footer {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
    }

    .mobile-request-title {
        font-size: 18px;
        font-weight: 800;
        line-height: 1.3;
        margin: 10px 0;
    }

    .mobile-request-meta {
        color: #6b7280;
        font-size: 14px;
        margin-bottom: 6px;
    }

    .mobile-request-footer .btn {
        width: auto !important;
        min-width: 110px !important;
        padding: 10px 14px !important;
        font-size: 15px !important;
    }

    .request-actions,
    .request-view-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        margin-bottom: 18px !important;
    }

    .request-actions .btn,
    .request-view-actions .btn,
    .request-actions button,
    .request-view-actions button {
        width: 100% !important;
        min-width: 0 !important;
        height: 50px !important;
        padding: 12px 14px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }

    .close-request-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .close-request-form input {
        width: 100% !important;
        height: 48px !important;
    }

    .search-panel {
        padding: 14px !important;
    }

    .search-main {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .search-main input,
    .search-main .btn,
    .search-filters select,
    .search-filters .btn {
        width: 100% !important;
        max-width: none !important;
    }

    .tabs {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
    }

    .tabs a {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 15px !important;
        padding: 10px 14px !important;
    }

    .action-card,
    .form-card,
    .form-section {
        padding: 16px !important;
    }

    .question-box,
    .description-box {
        font-size: 18px !important;
        padding: 16px !important;
    }

    .resolution-form,
    .message-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .resolution-textarea,
    .message-textarea {
        width: 100% !important;
        min-height: 140px;
    }

    .resolution-form .btn,
    .message-form .btn {
        width: 100% !important;
    }
    .container > .request-actions {
        grid-template-columns: 1fr 1fr 1fr !important;
    }

    .dashboard-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .dashboard-actions .btn{
        width:auto !important;
        height:56px;
        padding:10px 12px;
        font-size:20px;
        font-weight:700;
    }
    .search-filters .btn,
    .search-filters .btn-secondary{
        height:52px !important;
        padding:12px !important;
    }
    .search-filters .btn-light,
    .search-filters .btn {
        height: 48px !important;
        min-height: 48px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

}

/* ===== SEARCH FILTERS FIX ===== */

.search-filters {
    align-items: stretch;
}

.search-filters select,
.search-filters .btn-light {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    box-sizing: border-box !important;
}

.search-filters .btn-light {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 14px !important;
    margin: 0 !important;

    font-size: 16px !important;
    line-height: 1 !important;
    text-align: center !important;
}

@media (max-width:768px) {
    .search-filters {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .search-filters select,
    .search-filters .btn-light {
        width: 100% !important;
    }
}

/* FIX RESET BUTTON */
.search-filters a.btn-light {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;

    padding: 0 16px !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 8px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* FIX MESSAGE FORM */
.message-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    align-items: flex-start !important;
}

.message-form textarea,
.message-textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.message-form .btn {
    width: auto !important;
    min-width: 190px !important;
}

/* FINAL FIX: message form */
.action-card form.message-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
}

.action-card form.message-form textarea.message-textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 180px !important;
    box-sizing: border-box !important;
    display: block !important;
}

.action-card form.message-form button.btn {
    width: auto !important;
    min-width: 220px !important;
    align-self: flex-start !important;
}

.password-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-form input {
    width: 180px;
    min-width: 180px;
}

.password-form .btn {
    width: auto;
    white-space: nowrap;
}

.users-table {
    width: 100%;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7) {
    width: 260px;
}

.settings-form,
.settings-inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-form input,
.settings-inline-form input {
    max-width: 400px;
}

.settings-inline-form .btn,
.settings-form .btn {
    width: auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .settings-form,
    .settings-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-form input,
    .settings-inline-form input,
    .settings-form .btn,
    .settings-inline-form .btn {
        width: 100%;
        max-width: none;
    }
}

input,
select,
textarea {
    box-sizing: border-box;
    max-width: 100%;
}

input[type="date"] {
    width: 100%;
    min-width: 0;
    display: block;
}

@media print {
    body {
        background: #ffffff;
        color: #000000;
        padding: 0;
    }

    .btn,
    header,
    nav,
    .navbar,
    .no-print {
        display: none !important;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: avoid;
    }

    th,
    td {
        border: 1px solid #000;
        padding: 6px;
        font-size: 12px;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    .message {
        border: 1px solid #000;
        background: #ffffff;
        color: #000000;
        padding: 8px;
        margin-bottom: 8px;
    }
}

.report-cards {
    display: none;
}

@media (max-width: 768px) {
    .reports-table {
        display: none;
    }

    .report-cards {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin: 16px 0 24px;
    }

    .report-card {
        background: #ffffff;
        border: 1px solid #d1d5db;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    }

    .report-card h4 {
        margin: 0 0 12px;
        font-size: 18px;
        font-weight: 800;
    }

    .report-card p {
        margin: 6px 0;
        font-size: 14px;
        color: #374151;
    }
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.report-toolbar {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 18px;
    margin: 20px 0 24px;
}

.report-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.report-toolbar-row:last-child {
    margin-bottom: 0;
}

.report-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.report-filter-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.report-filter-form input {
    width: 100%;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.report-kpi-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.report-kpi-label {
    color: #64748b;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}

.report-kpi-value {
    font-size: 38px;
    line-height: 1;
    font-weight: 900;
    color: #0f172a;
}

.report-kpi-success {
    border-left: 6px solid #16a34a;
}

.report-kpi-work {
    border-left: 6px solid #0891b2;
}

.report-kpi-danger {
    border-left: 6px solid #dc2626;
}

@media (max-width: 900px) {
    .report-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-filter-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .report-toolbar {
        padding: 14px;
        border-radius: 18px;
    }

    .report-toolbar-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .report-toolbar-row .btn {
        width: 100%;
        min-height: 48px;
        padding: 12px;
        font-size: 15px;
        text-align: center;
    }

    .report-toolbar-row .btn:first-child {
        grid-column: 1 / -1;
    }

    .report-filter-form {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .report-filter-form label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .report-filter-form input[type="date"] {
        height: 46px;
        font-size: 15px;
    }

    .report-filter-form button,
    .report-filter-form .btn {
        width: 100%;
        min-height: 46px;
    }

    .report-filter-form button {
        grid-column: 1 / 2;
    }

    .report-filter-form .btn {
        grid-column: 2 / 3;
    }
}

@media (max-width: 600px) {
    .desktop-only {
        display: none !important;
    }
}

.report-periods,
.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.report-back-btn {
    margin-bottom: 14px;
}


input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    min-height: 48px;
}

.report-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.filters-card {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.filters-card input {
    width: 100%;
}

.filters-card label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
    color: #0f172a;
}

@media (max-width: 768px) {
    .filters-card {
        grid-template-columns: 1fr;
    }
}