* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --danger: #ff453a;
    --warning: #ffd60a;
    --success: #32d74b;
    --info: #64d2ff;
    --bg: #0b0b0f;
    --surface: #141419;
    --surface-2: #1c1c23;
    --surface-3: #24242d;
    --text: #f5f5f7;
    --text-muted: #c7c7cc;
    --text-subtle: #8e8e93;
    --border: #2c2c34;
    --shadow-1: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-2: 0 16px 48px rgba(0,0,0,0.45);
    --ring: 0 0 0 3px rgba(10,132,255,0.35);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100%;
}

.container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 20px 24px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1f1f27 0%, #15151c 100%);
    color: var(--text);
    padding: 30px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--border);
}

.header > div {
    flex-wrap: wrap;
}

.header h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    width: 28px;
    height: 28px;
    display: inline-block;
}

.header p {
    opacity: 0.85;
    font-size: 13px;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface-2);
    padding: 18px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-1);
    color: var(--text);
    border: 1px solid var(--border);
}

.stat-card.working { border-left-color: var(--success); }
.stat-card.suspicious { border-left-color: var(--warning); }
.stat-card.completed { border-left-color: var(--info); }

.stat-label {
    font-size: 12px;
    color: var(--text-subtle);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.stat-percent {
    font-size: 12px;
    color: var(--text-subtle);
    margin-top: 5px;
}

/* Workers cards */
.workers-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.worker-card {
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--shadow-1);
}

.worker-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.worker-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.worker-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-3);
    display: grid;
    place-items: center;
    color: var(--accent);
    border: 1px solid var(--border);
}

.worker-avatar svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.worker-name {
    font-weight: 600;
    color: var(--text);
}

.worker-meta {
    font-size: 12px;
    color: var(--text-subtle);
}

.worker-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.worker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 11px;
    color: var(--text-muted);
}

.worker-badge svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.worker-badge.is-on {
    color: var(--success);
    border-color: rgba(50,215,75,0.4);
    background: rgba(50,215,75,0.08);
}

.worker-badge.is-off {
    color: var(--text-subtle);
}

.worker-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.worker-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.worker-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-3);
    display: grid;
    place-items: center;
    color: var(--accent);
}

.worker-stat-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.worker-stat-label {
    font-size: 11px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.worker-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Controls */
.controls {
    background: var(--surface-2);
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow-1);
    border: 1px solid var(--border);
}

.controls .btn,
.controls .filter-btn {
    min-height: 36px;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--surface);
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--text-subtle);
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    white-space: nowrap;
    color: var(--text-muted);
}

.filter-btn:hover {
    background: var(--surface-3);
    border-color: #3a3a46;
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn {
    padding: 9px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 6px 16px rgba(10,132,255,0.25);
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:focus-visible,
.filter-btn:focus-visible,
.search-box input:focus-visible,
.admin-tools-input:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
.task-actions textarea:focus-visible,
.quick-replies select:focus-visible,
.profile-note-form textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #ff6b63;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #4ade80;
}

/* Table */
.table-wrapper {
    background: var(--surface-2);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    overflow-x: auto;
    border: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

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

thead {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
    vertical-align: top;
}

.notes-cell {
    max-width: 420px;
    width: 34%;
    word-break: break-word;
    overflow: hidden;
}

tr:hover {
    background: var(--surface-3);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge.in-work {
    background: rgba(50,215,75,0.16);
    color: #a7f3b5;
}

.badge.completed {
    background: rgba(10,132,255,0.16);
    color: #9cc9ff;
}

.badge.suspicious {
    background: rgba(255,214,10,0.18);
    color: #ffe98a;
}

.badge.pending {
    background: rgba(191,90,242,0.18);
    color: #e9c4ff;
}

.badge.uncertain {
    background: rgba(100,210,255,0.18);
    color: #b5e7ff;
}

/* Notes */
.note {
    font-size: 12px;
    color: var(--text-subtle);
    font-style: italic;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.note-wrap {
    display: block;
    max-width: 100%;
    overflow: hidden;
}

.note-block {
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
}

.note-block + .note-block {
    margin-top: 8px;
}

.note-label {
    font-size: 11px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.note-text {
    display: block;
    max-height: 3.6em;
    overflow: hidden;
    max-width: 100%;
}

.note-text.expanded {
    max-height: none;
}

.note-toggle.hidden {
    display: none;
}

.note-measure {
    position: absolute;
    visibility: hidden;
    height: auto;
    max-height: none;
    display: block;
    -webkit-line-clamp: initial;
    -webkit-box-orient: initial;
    white-space: normal;
    overflow: visible;
}

.note[title] {
    cursor: help;
    border-bottom: 1px dotted var(--border);
}

/* Link */
a.user-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

a.user-link:hover {
    text-decoration: underline;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-subtle);
    display: none;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 12px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 4px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    min-width: 28px;
    height: 28px;
    color: var(--text-muted);
}

.pagination button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination button:hover:not(.active) {
    background: var(--surface-3);
}

/* Table actions */
.actions-col {
    width: 80px;
}

.actions-cell {
    text-align: center;
}

.row-high-risk td {
    background: rgba(255,69,58,0.08);
}

.row-high-risk td:first-child {
    box-shadow: inset 3px 0 0 rgba(255,69,58,0.5);
}

.action-btn {
    padding: 4px 8px;
    font-size: 12px;
}

.action-btn-danger {
    color: var(--danger);
}

.muted {
    color: var(--text-subtle);
}

/* Admin tools */
.admin-tools {
    align-items: flex-start;
}

.admin-tools-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-tools-label {
    font-size: 12px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.admin-tools-input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--surface);
    color: var(--text);
    font-size: 13px;
    min-width: 160px;
}

/* Settings panel — весь блок настроек */
.controls.settings-panel {
    display: block;
    padding: 24px;
    gap: 0;
    max-width: 720px;
}

.settings-panel .settings-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.settings-panel .settings-section:first-child {
    padding-top: 0;
}

.settings-panel .settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-panel .task-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-subtle);
    margin-bottom: 14px;
}

.settings-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.settings-option-input {
    width: auto;
    min-width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}

.settings-option-label {
    flex: 1;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
    font-weight: 400;
}

.settings-panel .profile-notes {
    margin-bottom: 16px;
    gap: 10px;
}

.settings-panel .profile-note-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-panel .profile-note-form textarea {
    margin-bottom: 0;
}

.settings-panel .profile-note-form .btn {
    align-self: flex-start;
}

.api-code {
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface-2);
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border);
}

.task-controls {
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #1a1a22 0%, #14141b 100%);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.task-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.task-id {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-subtle);
}

.task-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-compact-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.task-compact-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.task-compact-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.task-compact-note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    max-height: 140px;
    overflow: auto;
}

.task-compact-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-subtle);
    margin-bottom: 4px;
}

.task-compact-value {
    font-size: 13px;
    color: var(--text);
}

.task-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-subtle);
    margin-bottom: 6px;
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-actions textarea {
    min-height: 70px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    padding: 12px;
    font-size: 13px;
}

.user-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 6px;
}

.user-settings-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
}

.user-settings-link:hover {
    background: var(--surface-3);
}

.user-settings-link:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.quick-replies {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quick-replies select {
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    padding: 6px 10px;
    font-size: 12px;
    min-width: 220px;
}

.task-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.user-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.profile-btn {
    font-size: 11px;
    padding: 4px 8px;
}

.modal-profile {
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
}

.modal-profile .modal-body {
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    padding-right: 6px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

.profile-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-subtle);
    margin-bottom: 6px;
}

.profile-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.profile-section {
    margin-bottom: 18px;
}

.profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.profile-notes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.profile-note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.profile-note-meta {
    font-size: 11px;
    color: var(--text-subtle);
    margin-bottom: 6px;
}

.profile-note-text {
    font-size: 13px;
    color: var(--text);
    white-space: pre-wrap;
}

.profile-note-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.profile-avatar-card {
    align-items: center;
    text-align: center;
}

.profile-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-note-form textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    padding: 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

.profile-note-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 10px;
}

.task-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.task-btn-danger {
    background: rgba(255,69,58,0.2);
    color: #ffb3ad;
}

.task-btn-danger:hover {
    background: rgba(255,69,58,0.35);
}

.task-btn-success {
    background: rgba(50,215,75,0.2);
    color: #b7f5c7;
}

.task-btn-success:hover {
    background: rgba(50,215,75,0.35);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.modal-body {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: var(--surface);
    color: var(--text);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-subtle);
}

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

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}


/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 16px 18px;
    }

    .header {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 20px 14px;
    }

    .header p {
        font-size: 12px;
    }

    #userBar {
        width: 100%;
        text-align: left !important;
    }

    .user-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .filter-group {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    table {
        font-size: 12px;
        table-layout: auto;
    }

    th, td {
        padding: 8px 10px;
    }

    .task-compact-row {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .task-compact-notes {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        overflow-x: visible;
    }

    table {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

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

    tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface-2);
        margin-bottom: 12px;
        overflow: hidden;
    }

    tbody tr:last-child {
        margin-bottom: 0;
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
        width: 100%;
        text-align: left;
    }

    tbody td:last-child {
        border-bottom: none;
    }

    tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--text-subtle);
        min-width: 110px;
        flex-shrink: 0;
    }

    .notes-cell {
        max-width: none;
        width: 100%;
    }

    .actions-cell {
        text-align: left;
    }

    .row-high-risk td:first-child {
        box-shadow: none;
    }
}

@media (max-width: 560px) {
    .container {
        padding: 12px;
    }

    .header h1 {
        font-size: 20px;
    }

    .app-title {
        gap: 8px;
    }

    .app-logo {
        width: 24px;
        height: 24px;
    }

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

    .controls {
        padding: 14px;
    }

    .filter-group {
        gap: 8px;
    }

    .controls .btn,
    .controls .filter-btn,
    .controls .search-box input {
        width: 100%;
    }

    .quick-replies {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-replies select,
    .quick-replies .filter-btn {
        width: 100%;
    }

    .task-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 420px) {
    .header {
        padding: 16px 12px;
    }

    .header h1 {
        font-size: 18px;
    }

    .stat-value {
        font-size: 20px;
    }

    .modal-content {
        padding: 18px;
    }

    .modal-profile {
        max-height: 90vh;
    }
}
