/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-main: #0d1117;
    --bg-card: #161b22;
    --border: #21262d;
    --border-light: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-tertiary: #484f58;
    --accent: #E8A838;
    --color-leader: #E8A838;
    --color-tech1: #38A3E8;
    --color-tech2: #6BE838;
    --color-new: #E838A3;
    --priority-high: #E84438;
    --priority-normal: #E8A838;
    --priority-low: #6BE838;
    --radius: 6px;
    --radius-sm: 4px;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.4;
    min-height: 100vh;
}

/* ===== HEADER ===== */
#app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(to right, #161b22, #0d1117);
    border-bottom: 1px solid var(--border);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hw-badge {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}
.header-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}
.header-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    font-family: inherit;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary:hover { background: #1a1d23; }
.btn-danger {
    background: transparent;
    color: var(--priority-high);
    border: 1px solid rgba(232, 68, 56, 0.19);
    font-family: inherit;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}
.btn-danger:hover { background: rgba(232, 68, 56, 0.1); }

/* ===== SECTION HEADERS ===== */
.section-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 10px 0;
}

section {
    padding: 16px 20px;
}

/* ===== TEAM STATUS ===== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    border-left: 3px solid var(--accent);
    position: relative;
    overflow: hidden;
}
.team-card.placeholder {
    opacity: 0.5;
}
.team-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.team-name {
    font-size: 13px;
    font-weight: 700;
}
.team-role {
    font-size: 10px;
    color: var(--text-secondary);
}
.team-card-top .status-badge {
    margin-left: auto;
}
.status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: inherit;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.status-in-progress    { background: #1a1a2a; border: 1px solid #2d2d4a; color: #38a3e8; }
.status-waiting-parts  { background: #2a2a1a; border: 1px solid #4a4a2d; color: #e8a838; }
.status-waiting-client { background: #2a1a2a; border: 1px solid #4a2d4a; color: #e838a3; }
.status-done           { background: #1a2a1a; border: 1px solid #2d4a2d; color: #6be838; }

.team-status-line {
    margin-bottom: 6px;
}
.team-task {
    font-size: 11px;
    color: var(--text-secondary);
}
.team-task-loc {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.team-no-task {
    font-size: 11px;
    color: var(--text-tertiary);
}
.team-placeholder-text {
    font-size: 9px;
    font-style: italic;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* ===== FILTERS BAR ===== */
#filters-bar { padding-top: 0; }
.filters-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.filters-left, .filters-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.view-toggle {
    display: flex;
    gap: 0;
}
.btn-toggle {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    font-family: inherit;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-toggle:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-toggle:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.btn-toggle.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.nav-buttons { display: flex; gap: 4px; }
.btn-nav {
    padding: 6px 10px;
    font-size: 11px;
}
.filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    cursor: pointer;
}
.filter-checkbox input {
    accent-color: var(--accent);
}

/* ===== WEEKLY VIEW ===== */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.week-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    min-height: 140px;
}
.week-day.today {
    background: #1a1d23;
    border-color: var(--accent);
    border-top: 2px solid var(--accent);
}
.week-day-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.week-day.today .week-day-header { color: var(--accent); }
.btn-add-day {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-tertiary);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    opacity: 0;
    font-family: inherit;
}
.week-day:hover .btn-add-day { opacity: 1; }
.btn-add-day:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}
.badge-today {
    font-size: 8px;
    background: var(--accent);
    color: #000;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 800;
}
.week-task-card {
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.week-task-card:hover { background: #1a1d23; }
.week-task-card.completed { opacity: 0.4; }
.week-task-card.completed .wtc-title { text-decoration: line-through; }
.wtc-row1 {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
}
.wtc-row2 {
    font-size: 9px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.priority-dot.high   { background: var(--priority-high); box-shadow: 0 0 6px var(--priority-high); }
.priority-dot.normal { background: var(--priority-normal); box-shadow: 0 0 6px var(--priority-normal); }
.priority-dot.low    { background: var(--priority-low); box-shadow: 0 0 6px var(--priority-low); }
.wtc-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}
.week-empty {
    color: var(--border-light);
    font-size: 9px;
    text-align: center;
    padding-top: 40px;
}

/* ===== MONTHLY VIEW ===== */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.month-day-label {
    font-size: 9px;
    color: var(--text-tertiary);
    font-weight: 700;
    text-align: center;
    padding: 4px;
}
.month-day {
    background: var(--bg-card);
    min-height: 60px;
    padding: 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.month-day.other-month {
    background: var(--bg-main);
    opacity: 0.3;
}
.month-day.today {
    background: #1a1d23;
    border-color: var(--accent);
}
.month-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}
.month-day-num {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
}
.month-day.today .month-day-num { color: var(--accent); }
.btn-add-day-month {
    background: none;
    border: none;
    color: var(--text-tertiary);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    opacity: 0;
    padding: 0;
    font-family: inherit;
}
.month-day:hover .btn-add-day-month { opacity: 1; }
.btn-add-day-month:hover {
    background: var(--accent);
    color: #000;
}
.month-task-bar {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.month-more {
    font-size: 8px;
    color: var(--text-tertiary);
}

/* ===== TASK LIST ===== */
.task-list-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}
.task-list-head, .task-row {
    display: grid;
    grid-template-columns: 28px 2.5fr 0.8fr 0.8fr 0.9fr 0.9fr 60px 32px;
    align-items: center;
    padding: 8px 12px;
}
.task-list-head {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
}
.task-row {
    border-bottom: 1px solid rgba(33, 38, 45, 0.5);
    padding: 10px 12px;
    transition: background 0.15s;
}
.task-row:hover { background: #1a1d23; }
.task-row.completed { opacity: 0.4; }
.task-row .col-task { cursor: pointer; min-width: 0; overflow: hidden; }

.col-check input {
    accent-color: var(--accent);
    cursor: pointer;
}
.col-task-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}
.task-row.completed .col-task-title { text-decoration: line-through; }
.col-task-notes {
    font-size: 9px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    margin-top: 2px;
}
.col-person {
    font-size: 10px;
    font-weight: 700;
}
.col-city {
    font-size: 10px;
    color: var(--text-secondary);
}
.col-date {
    font-size: 10px;
    color: var(--text-secondary);
}
.col-date-end {
    font-size: 9px;
    color: var(--text-tertiary);
}
.col-status select {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
}
.col-cal a {
    font-size: 9px;
    color: var(--color-tech1);
    font-weight: 700;
    text-decoration: none;
}
.col-cal a:hover { text-decoration: underline; }
.col-del button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.col-del button:hover { color: var(--priority-high); }
.task-list-empty {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 30px;
}

/* ===== MAP PLACEHOLDER ===== */
.map-box {
    border: 2px dashed var(--border-light);
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.map-title {
    font-size: 10px;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.map-sub {
    font-size: 9px;
    color: var(--border-light);
    margin-top: 4px;
}

/* ===== FOOTER ===== */
#app-footer {
    border-top: 1px solid var(--border);
    padding: 12px;
    text-align: center;
    font-size: 9px;
    color: var(--border-light);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-container {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 18px;
    text-transform: uppercase;
}
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 8px 10px;
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus {
    outline: none;
    border-color: var(--accent);
}
.form-textarea {
    min-height: 60px;
    resize: vertical;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.status-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.status-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.15s;
}
.status-btn[data-status="in_progress"].active    { background: #1a1a2a; border-color: #2d2d4a; color: #38a3e8; }
.status-btn[data-status="waiting_parts"].active  { background: #2a2a1a; border-color: #4a4a2d; color: #e8a838; }
.status-btn[data-status="waiting_client"].active { background: #2a1a2a; border-color: #4a2d4a; color: #e838a3; }
.status-btn[data-status="done"].active           { background: #1a2a1a; border-color: #2d4a2d; color: #6be838; }

.modal-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.modal-footer-right {
    display: flex;
    gap: 8px;
}

.hidden { display: none !important; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 20px;
}
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
}
.login-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.login-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.login-error {
    background: rgba(232, 68, 56, 0.15);
    border: 1px solid rgba(232, 68, 56, 0.3);
    color: #E84438;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.login-banned {
    background: rgba(232, 68, 56, 0.25);
    border-color: rgba(232, 68, 56, 0.5);
    padding: 12px;
    font-size: 12px;
    text-align: center;
}
.login-btn {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    font-size: 12px;
}
.login-footer {
    margin-top: 24px;
    font-size: 9px;
    color: var(--border-light);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ===== HEADER USER INFO ===== */
.user-info {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-logout, .btn-admin, .btn-kb {
    font-size: 9px;
    padding: 5px 10px;
    text-decoration: none;
}

/* Hamburger — hidden on desktop */
.btn-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 18px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}
.btn-hamburger:hover { background: #1a1d23; }

/* Mobile menu wrapper — transparent on desktop */
.mobile-menu { display: contents; }

/* ===== ADMIN TABLE ===== */
.admin-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 10px;
}
.admin-head, .admin-row {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 80px 80px 60px;
    align-items: center;
    padding: 8px 12px;
}
.admin-head {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
}
.admin-row {
    border-bottom: 1px solid rgba(33, 38, 45, 0.5);
    font-size: 11px;
    transition: background 0.15s;
}
.admin-row:hover { background: #1a1d23; }
.color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

/* ===== KNOWLEDGE BASE TABLE ===== */
.kb-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 10px;
}
.kb-head, .kb-row {
    display: grid;
    grid-template-columns: 1fr 2fr 40px;
    align-items: center;
    padding: 8px 12px;
}
.kb-head {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
}
.kb-row {
    border-bottom: 1px solid rgba(33, 38, 45, 0.5);
    font-size: 11px;
    transition: background 0.15s;
    min-width: 0;
}
.kb-row > div {
    min-width: 0;
    overflow: hidden;
}
.kb-row:hover { background: #1a1d23; }
.kb-row a {
    color: var(--color-tech1);
    text-decoration: none;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.kb-row a:hover { text-decoration: underline; }
.kb-empty {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .week-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .week-grid { grid-template-columns: repeat(2, 1fr); }
    .filters-container { flex-direction: column; align-items: flex-start; }
    .task-list-head, .task-row {
        grid-template-columns: 28px 2fr 1fr 1fr 1fr 1fr 60px 30px;
        font-size: 9px;
    }
}

/* ===== MOBILE (max 520px) ===== */
@media (max-width: 520px) {
    section { padding: 12px 10px; }

    /* --- HEADER --- */
    #app-header {
        flex-wrap: nowrap;
        padding: 10px 12px;
        gap: 8px;
        position: relative;
    }
    .header-left { gap: 8px; }
    .hw-badge { width: 28px; height: 28px; font-size: 11px; }
    .header-title { font-size: 13px; }
    .header-subtitle { display: none; }

    /* --- HAMBURGER MENU --- */
    .btn-hamburger { display: flex; align-items: center; justify-content: center; }
    .header-right {
        gap: 6px;
        flex-wrap: nowrap;
        align-items: center;
    }
    .header-right .user-info { font-size: 10px; }
    .mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(to right, #161b22, #0d1117);
        border-bottom: 1px solid var(--border);
        padding: 8px 12px;
        flex-direction: column;
        gap: 6px;
        z-index: 100;
    }
    .header-right.menu-open .mobile-menu {
        display: flex;
    }
    .mobile-menu .btn-primary,
    .mobile-menu .btn-secondary {
        width: 100%;
        text-align: center;
        font-size: 10px;
        padding: 8px 10px;
    }

    /* --- TEAM STATUS --- */
    .team-grid { grid-template-columns: 1fr; gap: 8px; }
    .team-card { padding: 10px; }
    .team-card-top { flex-wrap: wrap; gap: 4px; }
    .team-name { font-size: 12px; }
    .status-badge { font-size: 9px; padding: 2px 8px; }

    /* --- FILTERS --- */
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 10px;
        gap: 8px;
    }
    .filters-left, .filters-right {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .filters-right { justify-content: flex-start; }
    .filter-select { flex: 1; min-width: 0; font-size: 9px; padding: 5px 6px; }
    .btn-toggle { padding: 5px 10px; font-size: 9px; }
    .btn-nav { padding: 5px 8px; font-size: 10px; }

    /* --- WEEKLY VIEW --- */
    .week-grid { grid-template-columns: 1fr; gap: 6px; }
    .week-day { min-height: auto; padding: 8px; }
    .week-day-header { font-size: 10px; }
    .wtc-title { max-width: 200px; }
    .week-empty { padding-top: 12px; padding-bottom: 12px; }

    /* --- MONTHLY VIEW --- */
    #monthly-view { overflow-x: auto; }
    .month-grid { gap: 2px; min-width: 500px; }
    .month-day { min-height: 44px; padding: 3px; }
    .month-day-num { font-size: 8px; }
    .month-day-label { font-size: 8px; padding: 2px; }
    .month-task-bar { font-size: 7px; padding: 1px 2px; }

    /* --- TASK LIST: card layout on mobile --- */
    .task-list-head { display: none; }
    .task-row {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        padding: 10px;
        align-items: center;
        position: relative;
    }
    .task-row .col-check { order: 1; }
    .task-row .col-task {
        order: 2;
        flex: 1 1 calc(100% - 70px);
        min-width: 0;
    }
    .task-row .col-del {
        order: 3;
        margin-left: auto;
    }
    .task-row .col-person {
        order: 4;
        font-size: 10px;
    }
    .task-row .col-city {
        order: 5;
        font-size: 10px;
    }
    .task-row .col-date {
        order: 6;
        font-size: 10px;
    }
    .task-row .col-status {
        order: 7;
    }
    .task-row .col-status select { font-size: 9px; width: auto; }
    .task-row .col-cal {
        order: 8;
    }
    .col-task-notes { max-width: 100%; }

    /* --- MODALS --- */
    .modal-container { padding: 16px; width: 95%; }
    .modal-title { font-size: 12px; margin-bottom: 14px; }
    .form-row-2 { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .form-input { font-size: 12px; padding: 7px 8px; }
    .status-buttons { gap: 4px; }
    .status-btn { font-size: 9px; padding: 5px 8px; }
    .modal-footer { flex-wrap: wrap; gap: 8px; }

    /* --- ADMIN TABLE: card layout --- */
    .admin-head { display: none; }
    .admin-row {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 10px;
        padding: 10px 12px;
        align-items: center;
    }
    .admin-row > div:nth-child(1) { order: 1; }
    .admin-row > div:nth-child(2) { order: 2; flex: 1; }
    .admin-row > div:nth-child(7) { order: 3; margin-left: auto; }
    .admin-row > div:nth-child(3) { order: 4; font-size: 10px; }
    .admin-row > div:nth-child(4) { order: 5; font-size: 10px; }
    .admin-row > div:nth-child(5) { order: 6; font-size: 10px; }
    .admin-row > div:nth-child(6) { order: 7; font-size: 10px; }

    /* --- MAP --- */
    .map-box { padding: 16px 10px; }
    .map-title { font-size: 9px; }
    .map-sub { font-size: 8px; }

    /* --- FOOTER --- */
    #app-footer { font-size: 8px; padding: 10px; }

    /* --- LOGIN --- */
    .login-box { padding: 20px 16px; }
}
