/* =========================
   LIGHT MODE (DEFAULT)
========================= */

body {
    background: #ffffff;
    color: #000;
    font-family: Arial, sans-serif;
}

h1, h2, h3, h4 {
    margin: 10px 0;
}

/* NAV */
nav {
    background: #f0f0f0;
    padding: 10px;
    display: flex;
    align-items: center;
    position: relative;
}

/* hamburger hidden on desktop */
.nav-toggle {
    display: none;
}

/* CENTER the nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

nav a {
    color: #000;
    text-decoration: none;
}

nav a:hover {
    color: #333;
}

/* keep theme toggle far right */
nav > button:last-child {
    margin-left: auto;
}


/* =========================
   DARK MODE
========================= */

body.dark {
    background: #1e1e1e;
    color: #ddd;
}

body.dark nav {
    background: #2b2b2b;
}

body.dark nav a {
    color: #ddd;
}

body.dark nav a:hover {
    color: #fff;
}


/* =========================
   THEME TRANSITION
========================= */

body,
nav,
table th,
td,
select,
input,
textarea,
button,
a {
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.15s ease;
}


/* =========================
   PAGE TITLE POLISH
========================= */

.page-title {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
    position: relative;
}

/* subtle fade divider */
.page-title::after {
    content: "";
    display: block;
    width: 120px;
    height: 2px;
    margin: 10px auto 0 auto;
    background: linear-gradient(
        to right,
        transparent,
        rgba(0,0,0,0.25),
        transparent
    );
}

body.dark .page-title::after {
    background: linear-gradient(
        to right,
        transparent,
        rgba(255,255,255,0.25),
        transparent
    );
}

/* =========================
   CATEGORY PATH HEADING
========================= */

.category-path-heading {
    text-align: center;
}

/* =========================
   TASKLIST FILTER BAR
========================= */

.tasklist-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 16px 0;
}

.tasklist-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.08);
}

.tasklist-filter-btn:hover {
    background: #e8e8e8;
}

.tasklist-filter-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    box-shadow: 0 3px 10px rgba(0,123,255,0.2);
}

body.dark .tasklist-filter-btn {
    background: #2b2b2b;
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.08);
}

body.dark .tasklist-filter-btn:hover {
    background: #343434;
}

body.dark .tasklist-filter-btn.active {
    background: #4a90e2;
    color: #fff;
    border-color: #4a90e2;
    box-shadow: 0 3px 12px rgba(74,144,226,0.25);
}

/* =========================
   MOBILE QUICK ADD BUTTON
========================= */

.mobile-quick-add {
    display: none;
}


/* =========================
   TABLE WRAPPER
========================= */

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 80vh;
    max-width: 100%;
}


/* =========================
   TABLE
========================= */

table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

td, th {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

body.dark td,
body.dark th {
    border-bottom: 1px solid #333;
}


/* =========================
   HEADER
========================= */

table th {
    background: #f5f5f5;
    color: #000;
    position: sticky;
    top: 0;
    z-index: 20;
}

body.dark table th {
    background: #2b2b2b;
    color: #ccc;
}


/* =========================
   HOVER
========================= */

tr:hover td {
    background: #f0f4ff !important;
}

body.dark tr:hover td {
    background: #252a35 !important;
}


/* =========================
   TASK / NOTES
========================= */

.task-col {
    white-space: nowrap;
}

.notes-col {
    width: 420px;
    min-width: 420px;
    max-width: 420px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}


/* =========================
   INPUTS
========================= */

select,
input,
textarea {
    width: 100%;
}

body.dark select,
body.dark input,
body.dark textarea {
    background: #2b2b2b;
    color: #ddd;
}


/* =========================
   BUTTONS
========================= */

button {
    background: #007bff;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
}

button:hover {
    background: #0056b3;
}


/* =========================
   COLUMN DIVIDERS
========================= */

table th {
    border-right: 1px solid rgba(0,0,0,0.08);
}

table td {
    border-right: 1px solid rgba(0,0,0,0.06);
}

body.dark table th {
    border-right: 1px solid rgba(255,255,255,0.08);
}

body.dark table td {
    border-right: 1px solid rgba(255,255,255,0.06);
}

table th:last-child,
table td:last-child {
    border-right: none;
}

/* =========================
   TASK FORM (RESTORE LOOK)
========================= */

.task-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.task-form {
    width: 600px;
    max-width: 90%;
    margin-top: 20px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
}

body.dark .task-form {
    background: #2b2b2b;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.task-form input,
.task-form select,
.task-form textarea {
    margin-bottom: 10px;
}

.task-form label {
    font-size: 12px;
    color: #666;
}

body.dark .task-form label {
    color: #aaa;
}

/* =========================
   DASHBOARD MODERN POLISH
========================= */

.dashboard-container {
    padding: 20px;
}

.dashboard-section {
    margin-bottom: 25px;
}

.dashboard-section h2 {
    font-size: 18px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.dashboard-card {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.dark .dashboard-card {
    background: #2b2b2b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

body.dark .dashboard-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}

.dashboard-card .title {
    font-weight: bold;
    margin-bottom: 4px;
}

.dashboard-card .meta {
    font-size: 12px;
    opacity: 0.7;
}

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

.dashboard-card .value {
    font-size: 26px;
    font-weight: bold;
    margin-top: 5px;
}

/* =========================
   ATTACHMENTS
========================= */

.attachment-panel {
    background: rgba(0,0,0,0.035);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 12px;
}

body.dark .attachment-panel {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.attachment-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.attachment-panel-title {
    font-size: 14px;
    font-weight: 600;
}

.attachment-panel-count {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #007bff;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

body.dark .attachment-panel-count {
    background: #4a90e2;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.04);
}

body.dark .attachment-item {
    background: rgba(255,255,255,0.06);
}

.attachment-link {
    color: inherit;
    text-decoration: none;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.attachment-link:hover {
    text-decoration: underline;
}

.attachment-file-icon {
    flex: 0 0 auto;
    font-size: 16px;
}

.attachment-file-name {
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.attachment-delete-btn {
    min-width: 36px;
    max-width: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.attachment-empty {
    font-size: 14px;
    opacity: 0.7;
}

.polished-attachment-empty {
    padding: 8px 2px 2px 2px;
}

.attachment-eye-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.attachment-count-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(18%, -18%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e04f4f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    pointer-events: none;
}

body.dark .attachment-count-badge {
    background: #ff6b6b;
    color: #fff;
}

/* =========================
   ATTACHMENT VIEWER MODAL
========================= */

body.modal-open {
    overflow: hidden;
}

.attachment-modal-source {
    display: none;
}

.attachment-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
}

.attachment-viewer-modal.open {
    display: block;
}

.attachment-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
}

.attachment-viewer-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(560px, calc(100vw - 24px));
    max-height: min(80vh, 720px);
    transform: translate(-50%, -50%);
    background: #ffffff;
    color: #000;
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.dark .attachment-viewer-panel {
    background: #242424;
    color: #ddd;
    box-shadow: 0 24px 54px rgba(0,0,0,0.5);
}

.attachment-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.dark .attachment-viewer-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.attachment-viewer-title-wrap {
    min-width: 0;
}

.attachment-viewer-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-bottom: 4px;
}

.attachment-viewer-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.attachment-viewer-header-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.attachment-viewer-count {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #007bff;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

body.dark .attachment-viewer-count {
    background: #4a90e2;
}

.attachment-viewer-close {
    min-width: 38px;
    max-width: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.attachment-viewer-list {
    padding: 14px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-modal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0,0,0,0.04);
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.05);
}

.attachment-modal-item:hover {
    background: rgba(0,0,0,0.06);
}

body.dark .attachment-modal-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
}

body.dark .attachment-modal-item:hover {
    background: rgba(255,255,255,0.08);
}

.attachment-modal-file-icon {
    flex: 0 0 auto;
    font-size: 16px;
}

.attachment-modal-file-name {
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.attachment-viewer-footer {
    padding: 12px 16px 16px 16px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

body.dark .attachment-viewer-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
}

.attachment-viewer-manage-btn {
    width: 100%;
}

.attachment-cell {
    position: relative;
}

.attachment-eye-trigger {
    position: relative;
    z-index: 1;
}

/* =========================
   MOBILE COLLAPSIBLE NAV
========================= */

@media (max-width: 768px) {
    nav {
        position: sticky;
        top: 0;
        z-index: 100;
        justify-content: space-between;
    }

    .nav-toggle {
        display: block;
        font-size: 18px;
        padding: 6px 10px;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #f0f0f0;
        z-index: 200;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.25s ease;
        padding: 0 10px;
        transform: none;
    }

    body.dark .nav-links {
        background: #2b2b2b;
    }

    .nav-links.open {
        max-height: 500px;
        padding: 10px;
    }

    .nav-links a {
        padding: 12px;
        border-radius: 6px;
        margin-right: 0;
    }
}

/* =========================
   CATEGORIES 3-COLUMN LAYOUT
========================= */

.categories-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.category-box {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    overflow: hidden;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
}

.category-box ul {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 0;
    list-style: none;
    padding-left: 0;
}

body.dark .category-box {
    background: #2b2b2b;
}

.category-box h2 {
    margin-bottom: 10px;
}

select, input {
    transition: background 0.2s ease;
}

.editable {
    cursor: pointer;
}

.editable:hover {
    background: rgba(0,0,0,0.05);
}

body.dark .editable:hover {
    background: rgba(255,255,255,0.08);
}

td.flash-green {
    background: #c8f7c5 !important;
}

/* =========================
   ICON BUTTONS (MODERN)
========================= */

.icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    margin-left: 6px;
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.1s ease;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.08);
}

body.dark .icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

.icon-btn:active {
    transform: scale(0.92);
}

/* =========================
   TASKLIST ICON ACTION BUTTONS
========================= */

.icon-action-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    max-width: 30px;
    min-height: 30px;
    max-height: 30px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    font-size: 13px;
    font-weight: normal;
    border-radius: 6px;
    border: none;
    vertical-align: middle;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    transform: translateY(0);
    transition: filter 0.15s ease, transform 0.1s ease, background-color 0.15s ease;
}

.icon-action-btn:hover {
    filter: brightness(0.92);
}

.icon-action-btn:active {
    transform: scale(0.96);
}

.view-cell a,
.action-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: 1;
    text-decoration: none;
}

/* =========================
   VIEW / EDIT / DELETE BUTTONS
========================= */

.view-btn {
    background: #28a745;
    color: #ffffff;
    border: none;
}

.view-btn:hover {
    background: #28a745;
}

.edit-btn {
    background: #4a90e2;
    color: #ffffff;
    border: none;
}

.edit-btn:hover {
    background: #4a90e2;
}

.delete-btn {
    background: #e04f4f;
    color: #ffffff;
    border: none;
}

.delete-btn:hover {
    background: #e04f4f;
}

/* =========================
   VIEW COLUMN TIGHTEN
========================= */

th:nth-child(4),
td:nth-child(4) {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    text-align: center;
    vertical-align: middle;
    padding-left: 4px;
    padding-right: 4px;
}

/* =========================
   ACTION COLUMN TIGHTEN
========================= */

th:nth-child(12),
td:nth-child(12) {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    text-align: center;
    vertical-align: middle;
    padding-left: 4px;
    padding-right: 4px;
}

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

.action-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

/* =========================
   STICKY ADD (CATEGORIES)
========================= */

.category-box form {
    position: sticky;
    bottom: 0;
    background: inherit;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

body.dark .category-box form {
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* =========================
   CLICKABLE CATEGORY ITEMS
========================= */

.category-box li {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.category-box li:hover {
    background: rgba(0,0,0,0.06);
}

body.dark .category-box li:hover {
    background: rgba(255,255,255,0.08);
}

.category-box li.active {
    background: #4a90e2;
    color: white;
}

.category-box li.active .icon-btn {
    color: white;
}

.category-box li {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease;
}

.category-box li .cat-name {
    flex: 1;
}

.category-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* =========================
   MOBILE TIGHTEN PASS
========================= */

@media (max-width: 768px) {

    /* =========================
       GLOBAL SPACING
    ========================= */

    body {
        padding: 0 6px 84px 6px;
    }

    .page-title {
        font-size: 22px;
        margin-top: 12px;
        margin-bottom: 6px;
    }

    /* =========================
       NAV IMPROVEMENTS
    ========================= */

    nav {
        padding: 8px;
    }

    .nav-toggle {
        font-size: 20px;
        padding: 8px 12px;
    }

    nav > button:last-child {
        padding: 8px 12px;
        font-size: 16px;
    }

    .nav-links a {
        padding: 14px;
        font-size: 16px;
    }

    /* =========================
       MOBILE QUICK ADD
    ========================= */

    .mobile-quick-add {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 14px;
        bottom: 14px;
        width: 58px;
        height: 58px;
        border-radius: 50%;
        background: #007bff;
        color: #fff;
        text-decoration: none;
        font-size: 30px;
        line-height: 1;
        z-index: 999;
        box-shadow: 0 10px 24px rgba(0,0,0,0.22);
    }

    body.dark .mobile-quick-add {
        background: #4a90e2;
        color: #fff;
        box-shadow: 0 10px 24px rgba(0,0,0,0.4);
    }

    .mobile-quick-add:active {
        transform: scale(0.94);
    }

    /* =========================
       TOUCH TARGETS
    ========================= */

    button {
        min-height: 42px;
        font-size: 14px;
    }

    select,
    input,
    textarea {
        min-height: 42px;
        font-size: 14px;
    }

    .icon-action-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        max-width: 36px;
        min-height: 36px;
        max-height: 36px;
        font-size: 14px;
    }

    /* =========================
       STRONGER TAP STATES
    ========================= */

    .nav-links a:active,
    .tasklist-filter-btn:active,
    .dashboard-card:active,
    .category-box li:active,
    .icon-btn:active,
    .icon-action-btn:active,
    button:active {
        transform: scale(0.98);
    }

    .nav-links a:active,
    .tasklist-filter-btn:active,
    .category-box li:active {
        background: rgba(0,123,255,0.12);
    }

    body.dark .nav-links a:active,
    body.dark .tasklist-filter-btn:active,
    body.dark .category-box li:active {
        background: rgba(74,144,226,0.18);
    }

    .dashboard-card:active {
        box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    }

    body.dark .dashboard-card:active {
        box-shadow: 0 1px 6px rgba(0,0,0,0.4);
    }

    /* =========================
       TASK FORM STACKING
    ========================= */

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

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

    .task-form {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        margin-top: 12px;
        border-radius: 10px;
    }

    .task-form label {
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
    }

    .task-form input,
    .task-form select,
    .task-form textarea {
        margin-bottom: 0;
    }

    .form-actions {
        margin-top: 12px;
    }

    .form-actions button {
        width: 100%;
    }

    /* =========================
       DASHBOARD MOBILE POLISH
    ========================= */

    .dashboard-container {
        padding: 10px 4px 16px 4px;
    }

    .dashboard-section {
        margin-bottom: 16px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dashboard-card {
        padding: 12px;
        margin-bottom: 0;
        border-radius: 10px;
    }

    .dashboard-card .title {
        font-size: 13px;
        line-height: 1.2;
    }

    .dashboard-card .value {
        font-size: 24px;
        line-height: 1.1;
        margin-top: 6px;
    }

    /* =========================
       FILTER BAR MOBILE
    ========================= */

    .tasklist-filter-bar {
        gap: 8px;
        margin: 10px 0 14px 0;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .tasklist-filter-btn {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* =========================
       ATTACHMENTS MOBILE
    ========================= */

    .attachment-panel {
        padding: 10px;
        border-radius: 10px;
    }

    .attachment-panel-header {
        margin-bottom: 8px;
    }

    .attachment-panel-title {
        font-size: 13px;
    }

    .attachment-panel-count {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .attachment-item {
        align-items: flex-start;
        padding: 10px;
        gap: 8px;
    }

    .attachment-link {
        align-items: flex-start;
    }

    .attachment-file-icon {
        margin-top: 1px;
    }

    .attachment-delete-btn {
        min-width: 42px;
        max-width: 42px;
        min-height: 42px;
        max-height: 42px;
        border-radius: 10px;
    }

    .attachment-count-badge {
        top: 0;
        right: 0;
        transform: translate(12%, -12%);
    }

    /* =========================
       CATEGORIES STACK
    ========================= */

    .categories-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-box {
        height: auto;
        max-height: none;
        padding: 12px;
    }

    .category-box h2 {
        margin-top: 0;
        margin-bottom: 8px;
    }

    .category-box ul {
        max-height: 250px;
        margin-bottom: 10px;
    }

    .category-box li {
        padding: 10px;
        font-size: 14px;
    }

    .category-actions {
        gap: 4px;
    }

    .category-box form {
        position: sticky;
        bottom: 0;
        padding-top: 10px;
        margin-top: 4px;
        background: inherit;
        box-shadow: 0 -8px 12px rgba(245,245,245,0.95);
    }

    body.dark .category-box form {
        box-shadow: 0 -8px 12px rgba(43,43,43,0.95);
    }

    .category-box form input {
        margin-bottom: 8px;
    }

    .category-box form button {
        width: 100%;
    }

    /* =========================
       CATEGORY PATH HEADING
    ========================= */

    .category-path-heading {
        font-size: 16px;
        margin-top: 12px;
        margin-bottom: 8px;
    }

    /* =========================
       TASKLIST MOBILE CARDS
    ========================= */

    .table-wrapper {
        max-height: none;
        overflow: visible;
    }

    table,
    tbody,
    td {
        display: block;
        width: 100%;
    }

    table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
        margin-bottom: 14px;
        background: transparent;
    }

    thead {
        display: none;
    }

    tbody tr.task-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
        position: relative;
        background: #f5f5f5;
        border: 1px solid rgba(0,0,0,0.08);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

    body.dark tbody tr.task-row {
        background: #2b2b2b;
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    }

    tbody tr.task-row:hover td {
        background: transparent !important;
    }

    tbody tr.task-row::after {
        content: attr(data-status-label);
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        padding: 4px 8px;
        border-radius: 999px;
        line-height: 1;
    }

    tbody tr.task-row.status-ok::after {
        background: rgba(0,123,255,0.12);
        color: #0056b3;
    }

    tbody tr.task-row.status-warning::after {
        background: rgba(255,193,7,0.18);
        color: #8a6200;
    }

    tbody tr.task-row.status-overdue::after {
        background: rgba(224,79,79,0.18);
        color: #b42318;
    }

    tbody tr.task-row.status-completed::after {
        background: rgba(40,167,69,0.16);
        color: #1f7a36;
    }

    body.dark tbody tr.task-row.status-ok::after {
        background: rgba(74,144,226,0.22);
        color: #8fc0ff;
    }

    body.dark tbody tr.task-row.status-warning::after {
        background: rgba(255,193,7,0.2);
        color: #ffd666;
    }

    body.dark tbody tr.task-row.status-overdue::after {
        background: rgba(224,79,79,0.22);
        color: #ff9b9b;
    }

    body.dark tbody tr.task-row.status-completed::after {
        background: rgba(40,167,69,0.22);
        color: #8de3a1;
    }

    td,
    th,
    th:nth-child(4),
    td:nth-child(4),
    th:nth-child(12),
    td:nth-child(12) {
        width: 100%;
        min-width: 0;
        max-width: none;
        border-right: none;
        text-align: left;
        padding: 0;
    }

    tbody td {
        border-bottom: none;
        margin-bottom: 0;
    }

    tbody td::before {
        display: block;
        font-size: 11px;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        opacity: 0.7;
        margin-bottom: 4px;
    }

    .date-entered-cell { grid-column: 1 / -1; padding-right: 88px; }
    .task-col { grid-column: 1 / -1; padding-right: 88px; }
    .notes-col { grid-column: 1 / -1; }
    .c1-col { grid-column: 1 / -1; }
    .c2-col { grid-column: 1 / -1; }
    .c3-col { grid-column: 1 / -1; }
    .soft-date-cell { grid-column: 1 / 2; }
    .warn-date-cell { grid-column: 2 / 3; }
    .hard-date-cell { grid-column: 1 / 2; }
    .done-date-cell { grid-column: 2 / 3; }
    .attachment-cell { grid-column: 1 / 2; }
    .action-cell { grid-column: 2 / 3; }

    .date-entered-cell::before { content: "Date"; }
    .task-col::before { content: "Task"; }
    .notes-col::before { content: "Notes"; }
    .attachment-cell::before { content: "View"; }
    .c1-col::before { content: "Category 1"; }
    .c2-col::before { content: "Category 2"; }
    .c3-col::before { content: "Category 3"; }
    .soft-date-cell::before { content: "Soft Due"; }
    .warn-date-cell::before { content: "Warning"; }
    .hard-date-cell::before { content: "Hard Due"; }
    .done-date-cell::before { content: "Completed"; }
    .action-cell::before { content: "Action"; }

    .task-col,
    .notes-col {
        width: 100%;
        min-width: 0;
        max-width: none;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .view-cell,
    .action-cell {
        text-align: left;
    }

    .attachment-cell .view-btn,
    .action-cell .icon-action-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        max-width: 42px;
        min-height: 42px;
        max-height: 42px;
        border-radius: 10px;
    }

    .attachment-cell a,
    .action-buttons a {
        display: inline-flex;
    }

    .attachment-cell {
        display: flex;
        flex-direction: column;
        justify-content: end;
    }

    .attachment-cell::before,
    .action-cell::before {
        margin-bottom: 6px;
    }

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

    .c1-col select,
    .c2-col select,
    .c3-col select,
    td input[type="date"],
    td textarea,
    td input[type="text"] {
        width: 100%;
        box-sizing: border-box;
    }

    td.editing {
        padding: 0;
    }

    /* =========================
       ATTACHMENT VIEWER MODAL MOBILE
    ========================= */

    .attachment-viewer-panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 24px);
        border-radius: 12px;
    }

    .attachment-viewer-header {
        padding: 12px;
        align-items: flex-start;
    }

    .attachment-viewer-title {
        font-size: 15px;
    }

    .attachment-viewer-header-right {
        gap: 8px;
    }

    .attachment-viewer-close {
        min-width: 42px;
        max-width: 42px;
        min-height: 42px;
        max-height: 42px;
        border-radius: 10px;
    }

    .attachment-viewer-list {
        padding: 12px;
        gap: 8px;
    }

    .attachment-modal-item {
        padding: 12px;
        align-items: flex-start;
    }

    .attachment-viewer-footer {
        padding: 10px 12px 12px 12px;
    }
}

/* =========================
   PWA / MOBILE APP FEEL PASS
   Additive only
========================= */

:root {
    --app-safe-bottom: env(safe-area-inset-bottom);
    --app-safe-left: env(safe-area-inset-left);
    --app-safe-right: env(safe-area-inset-right);
}

html {
    overscroll-behavior-y: none;
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

nav {
    user-select: none;
    -webkit-user-select: none;
}

button,
a,
select,
input,
textarea {
    touch-action: manipulation;
}

button,
.mobile-quick-add,
.tasklist-filter-btn,
.dashboard-card,
.category-box li,
.icon-action-btn,
.icon-btn {
    -webkit-user-select: none;
    user-select: none;
}

.table-wrapper,
.category-box ul,
.attachment-viewer-list,
.nav-links.open {
    -webkit-overflow-scrolling: touch;
}

@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }

    nav {
        padding-top: calc(8px + env(safe-area-inset-top));
    }
}

@media (max-width: 768px) {
    body {
        min-height: 100svh;
        padding-bottom: calc(92px + var(--app-safe-bottom));
    }

    nav {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 1px 10px rgba(0,0,0,0.08);
    }

    body.dark nav {
        box-shadow: 0 1px 12px rgba(0,0,0,0.35);
    }

    .nav-links {
        box-shadow: 0 10px 22px rgba(0,0,0,0.12);
    }

    body.dark .nav-links {
        box-shadow: 0 12px 24px rgba(0,0,0,0.45);
    }

    .mobile-quick-add {
        width: 62px;
        height: 62px;
        bottom: calc(16px + var(--app-safe-bottom));
        right: calc(16px + var(--app-safe-right));
    }

    .dashboard-card,
    tbody tr.task-row,
    .task-form,
    .category-box {
        box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    }

    body.dark .dashboard-card,
    body.dark tbody tr.task-row,
    body.dark .task-form,
    body.dark .category-box {
        box-shadow: 0 4px 16px rgba(0,0,0,0.36);
    }

    input,
    select,
    textarea {
        border-radius: 8px;
        border: 1px solid rgba(0,0,0,0.18);
        padding-left: 10px;
        padding-right: 10px;
    }

    body.dark input,
    body.dark select,
    body.dark textarea {
        border-color: rgba(255,255,255,0.16);
    }
}

/* =========================
   MOBILE APP POLISH STAGE C
   Additive only
========================= */

@media (max-width: 768px) {

    /* Keep app pages feeling less cramped on phones */
    .page-title {
        letter-spacing: -0.01em;
    }

    .page-title::after {
        width: 92px;
        margin-top: 8px;
    }

    /* Better mobile card rhythm */
    tbody tr.task-row {
        gap: 12px;
        padding: 14px;
        margin-bottom: 14px;
    }

    tbody td::before {
        margin-bottom: 5px;
    }

    .date-entered-cell,
    .task-col {
        padding-right: 94px;
    }

    .task-col {
        font-size: 16px;
        line-height: 1.35;
        font-weight: 600;
    }

    .notes-col {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Make category/date controls easier to use on phone */
    .c1-col select,
    .c2-col select,
    .c3-col select,
    td input[type="date"],
    td textarea,
    td input[type="text"] {
        min-height: 46px;
        font-size: 15px;
    }

    /* Better action alignment on mobile cards */
    .attachment-cell,
    .action-cell {
        justify-content: flex-end;
    }

    .action-buttons {
        align-items: center;
    }

    .attachment-cell .view-btn,
    .action-cell .icon-action-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        max-width: 46px;
        min-height: 46px;
        max-height: 46px;
    }

    /* Filter pills behave more like an app tab rail */
    .tasklist-filter-bar {
        position: sticky;
        top: 58px;
        z-index: 80;
        background: #ffffff;
        padding: 8px 2px 8px 2px;
        margin-top: 6px;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }

    body.dark .tasklist-filter-bar {
        background: #1e1e1e;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .tasklist-filter-btn {
        border-radius: 999px;
        min-height: 42px;
    }

    /* Dashboard cards feel more tappable */
    .dashboard-grid {
        gap: 12px;
    }

    .dashboard-card {
        min-height: 86px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Forms use the full mobile width cleanly */
    .task-container {
        display: block;
    }

    .task-form {
        box-sizing: border-box;
    }

    .task-form button[type="submit"] {
        min-height: 48px;
        font-size: 15px;
        font-weight: 600;
    }

    /* Category admin is easier to tap */
    .category-box li {
        min-height: 44px;
    }

    .category-box .icon-btn {
        min-width: 38px;
        min-height: 38px;
    }

    /* Modal content is easier to read on phones */
    .attachment-viewer-title {
        line-height: 1.3;
    }

    .attachment-modal-item {
        min-height: 46px;
    }
}

/* =========================
   MOBILE-FIRST VISUAL POLISH
   Requested prettier pass
========================= */

:root {
    --app-bg: #f6f8fb;
    --app-surface: #ffffff;
    --app-surface-soft: #f1f5f9;
    --app-text: #111827;
    --app-muted: #64748b;
    --app-border: rgba(15, 23, 42, 0.10);
    --app-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
    --app-shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.08);
    --app-primary: #2563eb;
    --app-primary-hover: #1d4ed8;
    --app-radius: 16px;
}

body.dark {
    --app-bg: #15171b;
    --app-surface: #24272d;
    --app-surface-soft: #1f2228;
    --app-text: #e5e7eb;
    --app-muted: #a1a1aa;
    --app-border: rgba(255, 255, 255, 0.10);
    --app-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
    --app-shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.30);
    --app-primary: #3b82f6;
    --app-primary-hover: #2563eb;
}

html {
    background: var(--app-bg);
}

body {
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 34rem),
        var(--app-bg);
    color: var(--app-text);
    margin: 0;
}

body.dark {
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.10), transparent 34rem),
        var(--app-bg);
    color: var(--app-text);
}

/* Navigation polish */
nav {
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 2px 18px rgba(15, 23, 42, 0.06);
}

body.dark nav {
    background: rgba(36, 39, 45, 0.88);
    border-bottom: 1px solid var(--app-border);
}

nav a {
    color: var(--app-text);
    font-weight: 500;
    border-radius: 999px;
    padding: 7px 10px;
}

nav a:hover {
    background: rgba(37, 99, 235, 0.10);
    color: var(--app-primary);
}

body.dark nav a {
    color: var(--app-text);
}

body.dark nav a:hover {
    background: rgba(59, 130, 246, 0.16);
    color: #bfdbfe;
}

nav > button:last-child,
.nav-toggle {
    border-radius: 10px;
    background: var(--app-primary);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

nav > button:last-child:hover,
.nav-toggle:hover {
    background: var(--app-primary-hover);
}

/* Page title polish */
.page-title {
    color: var(--app-text);
    font-size: clamp(24px, 6vw, 34px);
    letter-spacing: -0.03em;
    margin-top: 24px;
    margin-bottom: 18px;
}

.page-title::after {
    width: 110px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        transparent,
        var(--app-primary),
        transparent
    );
    opacity: 0.55;
}

/* Form/card polish */
.task-container,
.dashboard-container,
.categories-container {
    box-sizing: border-box;
}

.task-form {
    background: rgba(255, 255, 255, 0.90);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.dark .task-form {
    background: rgba(36, 39, 45, 0.92);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
}

.task-form label,
tbody td::before {
    color: var(--app-muted);
    font-weight: 700;
}

body.dark .task-form label {
    color: var(--app-muted);
}

input,
select,
textarea {
    background: #ffffff;
    color: var(--app-text);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 9px 10px;
    box-sizing: border-box;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.75);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

body.dark input,
body.dark select,
body.dark textarea {
    background: #1f2228;
    color: var(--app-text);
    border-color: var(--app-border);
}

body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
    border-color: rgba(59, 130, 246, 0.85);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

button {
    background: var(--app-primary);
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}

button:hover {
    background: var(--app-primary-hover);
}

.task-form button[type="submit"],
.form-actions button {
    border-radius: 12px;
}

/* Dashboard cards */
.dashboard-card,
.category-box,
tbody tr.task-row,
.attachment-panel,
.attachment-viewer-panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
}

body.dark .dashboard-card,
body.dark .category-box,
body.dark tbody tr.task-row,
body.dark .attachment-panel,
body.dark .attachment-viewer-panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-soft);
}

.dashboard-card {
    border-radius: var(--app-radius);
}

.dashboard-card .title {
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
}

.dashboard-card .value {
    color: var(--app-text);
}

/* Task list polish */
.tasklist-filter-btn {
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.tasklist-filter-btn:hover {
    background: var(--app-surface-soft);
}

.tasklist-filter-btn.active,
body.dark .tasklist-filter-btn.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #ffffff;
}

body.dark .tasklist-filter-btn {
    background: var(--app-surface);
    color: var(--app-text);
    border-color: var(--app-border);
}

table th {
    background: var(--app-surface-soft);
    color: var(--app-muted);
}

body.dark table th {
    background: var(--app-surface-soft);
    color: var(--app-muted);
}

/* Categories polish */
.category-box {
    border-radius: var(--app-radius);
}

.category-box li {
    border: 1px solid transparent;
}

.category-box li:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.10);
}

body.dark .category-box li:hover {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.12);
}

.category-box li.active {
    background: var(--app-primary);
    color: #ffffff;
}

/* Mobile-first refinements */
@media (max-width: 768px) {
    body {
        padding-left: 10px;
        padding-right: 10px;
    }

    nav {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: calc(10px + var(--app-safe-left));
        padding-right: calc(10px + var(--app-safe-right));
    }

    .nav-links {
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid var(--app-border);
    }

    body.dark .nav-links {
        background: rgba(36, 39, 45, 0.96);
    }

    .nav-links a {
        border-radius: 12px;
        padding: 14px 12px;
    }

    .nav-links form button {
        width: 100%;
        text-align: left;
        border-radius: 12px;
        padding: 14px 12px !important;
    }

    .page-title {
        margin-top: 18px;
        margin-bottom: 16px;
    }

    .task-form {
        padding: 16px;
        margin-top: 8px;
    }

    .task-form label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .task-form input,
    .task-form select,
    .task-form textarea {
        min-height: 46px;
        font-size: 15px;
    }

    .task-form textarea {
        min-height: 110px;
    }

    .task-form button[type="submit"],
    .form-actions button {
        width: 100%;
        min-height: 50px;
        margin-top: 4px;
    }

    tbody tr.task-row {
        border-radius: 18px;
    }

    .dashboard-card,
    .category-box,
    .attachment-panel,
    .attachment-viewer-panel {
        border-radius: 18px;
    }

    .dashboard-card {
        padding: 16px;
    }

    .dashboard-card .value {
        font-size: 28px;
    }

    .mobile-quick-add {
        background: var(--app-primary);
        box-shadow: 0 12px 28px rgba(37, 99, 235, 0.30);
    }

    .tasklist-filter-bar {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

/* Desktop polish without changing mobile-first behavior */
@media (min-width: 769px) {
    .task-form {
        width: 640px;
    }

    .dashboard-container {
        max-width: 1100px;
        margin: 0 auto;
    }

    .categories-container {
        padding: 0 18px;
    }
}

/* =========================
   TASK FORM GROUPED ROWS
   Category/date row polish
========================= */

.form-row {
    display: grid;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.form-row-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row-dates {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-row .form-group {
    min-width: 0;
    margin-bottom: 10px;
}

.form-row .form-group label {
    display: block;
}

.form-row .form-group select,
.form-row .form-group input {
    width: 100%;
}

/* Keep grouped rows desktop/tablet friendly, stack on phone */
@media (max-width: 768px) {
    .form-row,
    .form-row-categories,
    .form-row-dates {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .form-row .form-group {
        width: 100%;
        margin-bottom: 0;
    }
}

/* =========================
   TASK LIST MOBILE CARD POLISH
   App-style mobile pass
========================= */

@media (max-width: 768px) {

    .table-wrapper {
        padding-bottom: 10px;
    }

    tbody tr.task-row {
        grid-template-columns: 1fr 1fr;
        gap: 13px 12px;
        padding: 15px;
        border-radius: 20px;
        margin-bottom: 16px;
        overflow: hidden;
    }

    tbody tr.task-row::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: var(--app-primary);
        opacity: 0.75;
    }

    tbody tr.task-row.status-ok::before {
        background: var(--app-primary);
    }

    tbody tr.task-row.status-warning::before {
        background: #f59e0b;
    }

    tbody tr.task-row.status-overdue::before {
        background: #ef4444;
    }

    tbody tr.task-row.status-completed::before {
        background: #22c55e;
    }

    tbody tr.task-row::after {
        top: 13px;
        right: 13px;
        font-size: 10px;
        padding: 5px 9px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    }

    .date-entered-cell {
        grid-column: 1 / -1;
        order: 1;
        padding-right: 96px;
        font-size: 13px;
        color: var(--app-muted);
    }

    .task-col {
        grid-column: 1 / -1;
        order: 2;
        padding-right: 0;
        font-size: 17px;
        line-height: 1.35;
        font-weight: 700;
        color: var(--app-text);
    }

    .notes-col {
        grid-column: 1 / -1;
        order: 3;
        font-size: 14px;
        line-height: 1.45;
        color: var(--app-text);
        opacity: 0.92;
        padding: 10px;
        border-radius: 12px;
        background: rgba(15, 23, 42, 0.035);
    }

    body.dark .notes-col {
        background: rgba(255, 255, 255, 0.045);
    }

    .notes-col:empty,
    .notes-col:has(:empty) {
        background: transparent;
        padding: 0;
    }

    .c1-col {
        order: 4;
        grid-column: 1 / -1;
    }

    .c2-col {
        order: 5;
        grid-column: 1 / -1;
    }

    .c3-col {
        order: 6;
        grid-column: 1 / -1;
    }

    .soft-date-cell {
        order: 7;
        grid-column: 1 / 2;
    }

    .warn-date-cell {
        order: 8;
        grid-column: 2 / 3;
    }

    .hard-date-cell {
        order: 9;
        grid-column: 1 / 2;
    }

    .done-date-cell {
        order: 10;
        grid-column: 2 / 3;
    }

    .attachment-cell {
        order: 11;
        grid-column: 1 / 2;
        justify-content: flex-end;
        min-height: 72px;
    }

    .action-cell {
        order: 12;
        grid-column: 2 / 3;
        justify-content: flex-end;
        min-height: 72px;
    }

    tbody td::before {
        font-size: 10px;
        opacity: 0.68;
        margin-bottom: 6px;
    }

    .c1-col select,
    .c2-col select,
    .c3-col select,
    td input[type="date"] {
        min-height: 48px;
        border-radius: 12px;
        font-size: 15px;
    }

    .attachment-cell .view-btn,
    .action-cell .icon-action-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        border-radius: 14px;
        font-size: 16px;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-end;
        gap: 10px;
    }

    .attachment-count-badge {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
        transform: translate(10%, -18%);
    }

    td.editing {
        grid-column: 1 / -1;
    }

    td.editing input,
    td.editing textarea {
        min-height: 48px;
        border-radius: 12px;
    }

    td.editing textarea {
        min-height: 120px;
    }

    td.editing button {
        min-height: 44px;
        min-width: 92px;
        border-radius: 12px;
    }

    .category-path-heading {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 8px;
        color: var(--app-muted);
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.01em;
        margin: 16px 0 10px 0;
    }

    .category-path-heading::before,
    .category-path-heading::after {
        content: "";
        height: 1px;
        flex: 1;
        max-width: 52px;
        background: var(--app-border);
    }

    .tasklist-filter-bar {
        border-radius: 0 0 16px 16px;
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (min-width: 769px) {
    tbody tr.task-row {
        transition:
            background-color 0.18s ease,
            box-shadow 0.18s ease,
            transform 0.12s ease;
    }

    tbody tr.task-row:hover {
        transform: translateY(-1px);
    }

    .tasklist-filter-bar {
        margin-top: 6px;
    }
}

/* =========================
   CATEGORY ADD MODAL
   Mobile-first modal
========================= */

.category-add-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: none;
}

.category-add-modal.open {
    display: block;
}

.category-add-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.48);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.category-add-panel {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(100%, 520px);
    transform: translateX(-50%);
    background: var(--app-surface, #ffffff);
    color: var(--app-text, #000000);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: 0 -18px 42px rgba(0,0,0,0.24);
    overflow: hidden;
}

.category-add-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 12px 18px;
    border-bottom: 1px solid var(--app-border, rgba(0,0,0,0.10));
}

.category-add-kicker {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-muted, #666);
    margin-bottom: 4px;
}

.category-add-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.category-add-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-add-body {
    padding: 16px 18px 8px 18px;
}

.category-add-body label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted, #666);
    margin-bottom: 8px;
}

.category-add-body input {
    width: 100%;
    min-height: 50px;
    font-size: 17px;
    border-radius: 14px;
}

.category-add-error {
    min-height: 20px;
    margin-top: 8px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 700;
}

.category-add-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 18px calc(18px + var(--app-safe-bottom, 0px)) 18px;
}

.category-add-actions button {
    min-height: 48px;
    border-radius: 14px;
}

.category-add-cancel {
    background: var(--app-surface-soft, #f1f1f1);
    color: var(--app-text, #000000);
    box-shadow: none;
}

.category-add-cancel:hover {
    background: var(--app-surface-soft, #e9e9e9);
}

.category-add-save:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (min-width: 769px) {
    .category-add-panel {
        top: 50%;
        bottom: auto;
        width: min(520px, calc(100vw - 32px));
        transform: translate(-50%, -50%);
        border-radius: 22px;
        box-shadow: 0 24px 56px rgba(0,0,0,0.26);
    }

    .category-add-actions {
        padding-bottom: 18px;
    }
}

/* =========================
   LOGIN / ADMIN POLISH
   Mobile-first auth/admin pages
========================= */

.auth-page {
    min-height: calc(100svh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 10px 32px 10px;
    box-sizing: border-box;
}

.auth-card {
    width: min(100%, 430px);
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    border-radius: 24px;
    box-shadow: var(--app-shadow, 0 12px 32px rgba(0,0,0,0.12));
    padding: 22px;
    box-sizing: border-box;
}

.auth-header {
    text-align: left;
    margin-bottom: 18px;
}

.auth-kicker,
.admin-kicker {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-primary, #2563eb);
    margin-bottom: 6px;
}

.auth-header h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--app-text, #111827);
}

.auth-header p {
    margin: 10px 0 0 0;
    color: var(--app-muted, #64748b);
    font-size: 14px;
    line-height: 1.45;
}

.auth-error,
.admin-error {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-form label,
.admin-add-form label,
.admin-user-card .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted, #64748b);
    margin-bottom: 7px;
}

.auth-form input {
    min-height: 50px;
    font-size: 16px;
    border-radius: 14px;
}

.auth-submit {
    width: 100%;
    min-height: 52px;
    border-radius: 15px;
    font-size: 16px;
    margin-top: 4px;
}

/* Admin */
.admin-users-page {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 0 10px 32px 10px;
    box-sizing: border-box;
}

.admin-card {
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    border-radius: 22px;
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
    padding: 16px;
    margin-bottom: 16px;
}

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

.admin-card h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.03em;
    color: var(--app-text, #111827);
}

.admin-count {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary, #2563eb);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.admin-add-form {
    display: grid;
    gap: 12px;
}

.admin-add-form .form-group,
.admin-user-card .form-group {
    margin-bottom: 0;
}

.admin-add-form input[type="text"],
.admin-add-form input[type="password"],
.admin-user-card input[type="password"] {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
}

.admin-check-row {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
    color: var(--app-text, #111827) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.admin-check-row input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    accent-color: var(--app-primary, #2563eb);
}

.admin-add-form button,
.admin-save-btn {
    min-height: 48px;
    border-radius: 14px;
}

.admin-users-list {
    display: grid;
    gap: 12px;
}

.admin-user-card {
    background: var(--app-surface-soft, #f1f5f9);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 12px;
}

body.dark .admin-user-card {
    background: var(--app-surface-soft, #1f2228);
}

.admin-user-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-username {
    font-size: 17px;
    font-weight: 800;
    color: var(--app-text, #111827);
    word-break: break-word;
}

.admin-user-meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--app-muted, #64748b);
    font-weight: 700;
}

.admin-self-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #16a34a;
    font-size: 12px;
    font-weight: 900;
}

.admin-user-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--app-border, rgba(0,0,0,0.08));
}

body.dark .admin-user-controls {
    background: rgba(255,255,255,0.04);
}

@media (min-width: 769px) {
    .auth-page {
        min-height: calc(100vh - 76px);
    }

    .auth-card {
        padding: 28px;
    }

    .admin-add-form {
        grid-template-columns: 1fr 1fr auto auto;
        align-items: end;
    }

    .admin-add-form button {
        min-width: 130px;
    }

    .admin-users-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .auth-page {
        align-items: flex-start;
        padding-top: 20px;
    }

    .auth-card {
        border-radius: 22px;
        padding: 20px;
    }

    .auth-header h1 {
        font-size: 30px;
    }

    .admin-users-page {
        padding-left: 0;
        padding-right: 0;
    }

    .admin-card {
        border-radius: 20px;
        padding: 14px;
    }

    .admin-add-form button,
    .admin-save-btn {
        width: 100%;
    }
}

/* =========================
   TASK FORM SUBMIT FEEDBACK
   Mobile-first saving state
========================= */

.task-submit-btn {
    position: relative;
    overflow: hidden;
}

.task-submit-btn.is-saving,
.task-submit-btn:disabled {
    opacity: 0.82;
    cursor: wait;
}

.task-submit-btn.is-saving::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.55);
    border-top-color: #ffffff;
    display: inline-block;
    vertical-align: -3px;
    animation: task-submit-spin 0.75s linear infinite;
}

@keyframes task-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .task-submit-btn {
        font-size: 16px;
        font-weight: 800;
        letter-spacing: -0.01em;
    }
}

/* =========================
   TASKLIST EMPTY STATE
   Mobile-first empty filter/message
========================= */

.tasklist-empty-state {
    width: min(100%, 520px);
    margin: 24px auto;
    padding: 26px 20px;
    box-sizing: border-box;
    text-align: center;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    border-radius: 22px;
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
}

.tasklist-empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px auto;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: var(--app-primary, #2563eb);
    font-size: 28px;
    font-weight: 900;
}

.tasklist-empty-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--app-text, #111827);
    margin-bottom: 8px;
}

.tasklist-empty-text {
    color: var(--app-muted, #64748b);
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 18px;
}

.tasklist-empty-action {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary, #2563eb);
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.tasklist-empty-action:hover {
    background: var(--app-primary-hover, #1d4ed8);
    color: #ffffff;
}

@media (max-width: 768px) {
    .tasklist-empty-state {
        margin: 18px 0;
        padding: 24px 18px;
        border-radius: 20px;
    }

    .tasklist-empty-action {
        width: 100%;
        box-sizing: border-box;
        min-height: 50px;
    }
}

/* =========================
   APP CONFIRM MODAL
   Mobile-first destructive action modal
========================= */

.app-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
}

.app-confirm-modal.open {
    display: block;
}

.app-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.50);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.app-confirm-panel {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(100%, 520px);
    transform: translateX(-50%);
    background: var(--app-surface, #ffffff);
    color: var(--app-text, #111827);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: 0 -18px 42px rgba(0,0,0,0.24);
    overflow: hidden;
}

.app-confirm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 12px 18px;
    border-bottom: 1px solid var(--app-border, rgba(0,0,0,0.10));
}

.app-confirm-kicker {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #ef4444;
    margin-bottom: 5px;
}

.app-confirm-title {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.app-confirm-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-confirm-body {
    padding: 16px 18px;
    color: var(--app-muted, #64748b);
    font-size: 15px;
    line-height: 1.45;
}

.app-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 18px calc(18px + var(--app-safe-bottom, 0px)) 18px;
}

.app-confirm-actions button {
    min-height: 48px;
    border-radius: 14px;
}

.app-confirm-cancel {
    background: var(--app-surface-soft, #f1f5f9);
    color: var(--app-text, #111827);
    box-shadow: none;
}

.app-confirm-cancel:hover {
    background: var(--app-surface-soft, #e2e8f0);
}

.app-confirm-delete {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.24);
}

.app-confirm-delete:hover {
    background: #dc2626;
}

@media (min-width: 769px) {
    .app-confirm-panel {
        top: 50%;
        bottom: auto;
        width: min(520px, calc(100vw - 32px));
        transform: translate(-50%, -50%);
        border-radius: 22px;
        box-shadow: 0 24px 56px rgba(0,0,0,0.26);
    }

    .app-confirm-actions {
        padding-bottom: 18px;
    }
}

/* =========================
   APP TOAST
   Mobile-first feedback
========================= */

.app-toast-wrap {
    position: fixed;
    left: 50%;
    bottom: calc(18px + var(--app-safe-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1800;
    width: min(calc(100vw - 24px), 420px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.94);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 14px 36px rgba(0,0,0,0.28);
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast-success {
    background: rgba(22, 163, 74, 0.96);
}

.app-toast-error {
    background: rgba(220, 38, 38, 0.96);
}

body.dark .app-toast {
    box-shadow: 0 16px 38px rgba(0,0,0,0.46);
}

@media (min-width: 769px) {
    .app-toast-wrap {
        left: auto;
        right: 22px;
        bottom: 22px;
        transform: none;
        width: 360px;
    }

    .app-toast {
        text-align: left;
    }
}

/* =========================
   TASKLIST SEARCH
   Mobile-first client filter
========================= */

.tasklist-search-wrap {
    width: min(100%, 720px);
    margin: 0 auto 16px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.tasklist-search-label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-muted, #64748b);
    margin-bottom: 7px;
}

.tasklist-search-control {
    position: relative;
}

.tasklist-search-input {
    width: 100%;
    min-height: 48px;
    padding-right: 50px;
    border-radius: 16px;
    font-size: 15px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.tasklist-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 12px;
    background: var(--app-surface-soft, #f1f5f9);
    color: var(--app-text, #111827);
    box-shadow: none;
}

.tasklist-search-clear:hover {
    background: var(--app-surface-soft, #e2e8f0);
}

.tasklist-search-count {
    min-height: 18px;
    margin-top: 7px;
    font-size: 12px;
    color: var(--app-muted, #64748b);
    font-weight: 700;
}

.tasklist-no-search-results {
    display: none;
    width: min(100%, 520px);
    margin: 18px auto;
    padding: 24px 18px;
    box-sizing: border-box;
    text-align: center;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    border-radius: 22px;
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
}

.tasklist-no-search-results.open {
    display: block;
}

@media (max-width: 768px) {
    .tasklist-search-wrap {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 14px;
    }

    .tasklist-search-input {
        min-height: 50px;
        font-size: 16px;
        border-radius: 16px;
    }

    .tasklist-no-search-results {
        margin: 16px 0;
        border-radius: 20px;
    }
}

/* =========================
   TASKLIST SORT
   Mobile-first client sort
========================= */

.tasklist-sort-wrap {
    width: min(100%, 720px);
    margin: -6px auto 16px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.tasklist-sort-label {
    display: block;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-muted, #64748b);
    margin-bottom: 7px;
}

.tasklist-sort-select {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

#tasklistSortedBucket {
    width: 100%;
    min-width: 0;
}

@media (max-width: 768px) {
    .tasklist-sort-wrap {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 14px;
    }

    .tasklist-sort-select {
        min-height: 50px;
        font-size: 16px;
        border-radius: 16px;
    }

    #tasklistSortedBucket {
        display: block;
        background: transparent;
    }

    #tasklistSortedBucket tbody {
        display: block;
    }
}

@media (min-width: 769px) {
    .tasklist-search-wrap,
    .tasklist-sort-wrap {
        max-width: 720px;
    }
}

/* =========================
   TASK STATUS CHIPS
   Mobile-first scan polish
========================= */

tbody tr.task-row::after {
    font-weight: 900;
    letter-spacing: 0.055em;
    border: 1px solid rgba(255,255,255,0.35);
}

tbody tr.task-row.status-ok::after {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.20);
}

tbody tr.task-row.status-warning::after {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.22);
}

tbody tr.task-row.status-overdue::after {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.22);
}

tbody tr.task-row.status-completed::after {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.22);
}

body.dark tbody tr.task-row.status-ok::after {
    background: rgba(59, 130, 246, 0.24);
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.30);
}

body.dark tbody tr.task-row.status-warning::after {
    background: rgba(245, 158, 11, 0.24);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.32);
}

body.dark tbody tr.task-row.status-overdue::after {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.34);
}

body.dark tbody tr.task-row.status-completed::after {
    background: rgba(34, 197, 94, 0.23);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.30);
}

@media (max-width: 768px) {
    tbody tr.task-row {
        border-left: 0;
    }

    tbody tr.task-row::after {
        top: 14px;
        right: 14px;
        min-height: 26px;
        padding: 6px 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-radius: 999px;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    tbody tr.task-row.status-ok {
        box-shadow:
            inset 0 0 0 1px rgba(37, 99, 235, 0.06),
            0 4px 14px rgba(15,23,42,0.10);
    }

    tbody tr.task-row.status-warning {
        box-shadow:
            inset 0 0 0 1px rgba(245, 158, 11, 0.10),
            0 4px 14px rgba(15,23,42,0.10);
    }

    tbody tr.task-row.status-overdue {
        box-shadow:
            inset 0 0 0 1px rgba(239, 68, 68, 0.12),
            0 4px 14px rgba(15,23,42,0.10);
    }

    tbody tr.task-row.status-completed {
        box-shadow:
            inset 0 0 0 1px rgba(34, 197, 94, 0.10),
            0 4px 14px rgba(15,23,42,0.10);
    }

    body.dark tbody tr.task-row.status-ok,
    body.dark tbody tr.task-row.status-warning,
    body.dark tbody tr.task-row.status-overdue,
    body.dark tbody tr.task-row.status-completed {
        box-shadow:
            inset 0 0 0 1px rgba(255,255,255,0.04),
            0 4px 16px rgba(0,0,0,0.36);
    }

    .date-entered-cell::before {
        content: "Created";
    }

    .task-col {
        padding-top: 2px;
    }
}

@media (min-width: 769px) {
    tbody tr.task-row.status-ok td:first-child {
        border-left: 4px solid var(--app-primary, #2563eb);
    }

    tbody tr.task-row.status-warning td:first-child {
        border-left: 4px solid #f59e0b;
    }

    tbody tr.task-row.status-overdue td:first-child {
        border-left: 4px solid #ef4444;
    }

    tbody tr.task-row.status-completed td:first-child {
        border-left: 4px solid #22c55e;
    }
}

/* =========================
   DASHBOARD QUICK ACTIONS
   Mobile-first action cards
========================= */

.dashboard-quick-actions-section h2 {
    width: min(100%, 1100px);
    margin-left: auto;
    margin-right: auto;
    color: var(--app-muted, #64748b);
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-quick-actions {
    width: min(100%, 1100px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-action-card {
    min-height: 86px;
    padding: 14px;
    box-sizing: border-box;
    border-radius: 18px;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
    color: var(--app-text, #111827);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow, 0 12px 32px rgba(0,0,0,0.12));
}

.dashboard-action-card:active {
    transform: scale(0.98);
}

.dashboard-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: var(--app-primary, #2563eb);
    font-size: 20px;
    font-weight: 900;
}

.dashboard-action-text {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

body.dark .dashboard-action-card {
    background: var(--app-surface, #24272d);
    border-color: var(--app-border, rgba(255,255,255,0.10));
}

body.dark .dashboard-action-icon {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

@media (min-width: 769px) {
    .dashboard-quick-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 15px;
    }

    .dashboard-action-card {
        min-height: 104px;
        padding: 18px;
    }

    .dashboard-action-icon {
        width: 40px;
        height: 40px;
    }
}

/* =========================
   DASHBOARD RECENT TASKS
   Mobile-first recent cards
========================= */

.dashboard-section-header {
    width: min(100%, 1100px);
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-section-header h2 {
    margin: 0;
    color: var(--app-muted, #64748b);
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dashboard-section-link {
    color: var(--app-primary, #2563eb);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.dashboard-section-link:hover {
    text-decoration: underline;
}

.dashboard-recent-list {
    width: min(100%, 1100px);
    margin: 0 auto;
    display: grid;
    gap: 10px;
}

.dashboard-recent-card {
    position: relative;
    overflow: hidden;
    min-height: 74px;
    padding: 14px;
    box-sizing: border-box;
    border-radius: 18px;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
    color: var(--app-text, #111827);
    text-decoration: none;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.dashboard-recent-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--app-primary, #2563eb);
}

.dashboard-recent-card.status-warning::before {
    background: #f59e0b;
}

.dashboard-recent-card.status-overdue::before {
    background: #ef4444;
}

.dashboard-recent-card.status-completed::before {
    background: #22c55e;
}

.dashboard-recent-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--app-shadow, 0 12px 32px rgba(0,0,0,0.12));
}

.dashboard-recent-main {
    min-width: 0;
}

.dashboard-recent-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--app-text, #111827);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dashboard-recent-meta {
    margin-top: 5px;
    color: var(--app-muted, #64748b);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.dashboard-recent-status {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-recent-card.status-warning .dashboard-recent-status {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.dashboard-recent-card.status-overdue .dashboard-recent-status {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.dashboard-recent-card.status-completed .dashboard-recent-status {
    background: rgba(34, 197, 94, 0.16);
    color: #15803d;
}

.dashboard-recent-empty {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 22px 18px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 20px;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
}

.dashboard-recent-empty-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.dashboard-recent-empty-text {
    color: var(--app-muted, #64748b);
    font-size: 14px;
    margin-bottom: 14px;
}

.dashboard-recent-empty-action {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary, #2563eb);
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 900;
}

body.dark .dashboard-recent-card,
body.dark .dashboard-recent-empty {
    background: var(--app-surface, #24272d);
    border-color: var(--app-border, rgba(255,255,255,0.10));
}

body.dark .dashboard-recent-status {
    background: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
}

body.dark .dashboard-recent-card.status-warning .dashboard-recent-status {
    background: rgba(245, 158, 11, 0.24);
    color: #fde68a;
}

body.dark .dashboard-recent-card.status-overdue .dashboard-recent-status {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

body.dark .dashboard-recent-card.status-completed .dashboard-recent-status {
    background: rgba(34, 197, 94, 0.23);
    color: #bbf7d0;
}

@media (max-width: 768px) {
    .dashboard-section-header {
        margin-bottom: 9px;
    }

    .dashboard-recent-card {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
        border-radius: 18px;
        padding: 15px;
    }

    .dashboard-recent-status {
        justify-self: start;
    }

    .dashboard-recent-empty-action {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 769px) {
    .dashboard-recent-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 15px;
    }

    .dashboard-recent-card {
        min-height: 142px;
        grid-template-columns: 1fr;
        align-content: space-between;
    }

    .dashboard-recent-status {
        justify-self: start;
    }
}

/* =========================
   DASHBOARD DUE SOON
   Mobile-first attention cards
========================= */

.dashboard-due-soon-list {
    width: min(100%, 1100px);
    margin: 0 auto;
    display: grid;
    gap: 10px;
}

.dashboard-due-soon-card {
    position: relative;
    overflow: hidden;
    min-height: 76px;
    padding: 14px;
    box-sizing: border-box;
    border-radius: 18px;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
    color: var(--app-text, #111827);
    text-decoration: none;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.dashboard-due-soon-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #f59e0b;
}

.dashboard-due-soon-card.status-overdue::before {
    background: #ef4444;
}

.dashboard-due-soon-card.status-warning::before {
    background: #f59e0b;
}

.dashboard-due-soon-card.status-ok::before {
    background: var(--app-primary, #2563eb);
}

.dashboard-due-soon-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--app-shadow, 0 12px 32px rgba(0,0,0,0.12));
}

.dashboard-due-soon-main {
    min-width: 0;
}

.dashboard-due-soon-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--app-text, #111827);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dashboard-due-soon-meta {
    margin-top: 5px;
    color: var(--app-muted, #64748b);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.dashboard-due-soon-status {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-due-soon-card.status-overdue .dashboard-due-soon-status {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.dashboard-due-soon-card.status-ok .dashboard-due-soon-status {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.dashboard-due-soon-empty {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 22px 18px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 20px;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--app-border, rgba(0,0,0,0.10));
    box-shadow: var(--app-shadow-soft, 0 6px 18px rgba(0,0,0,0.08));
}

.dashboard-due-soon-empty-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.dashboard-due-soon-empty-text {
    color: var(--app-muted, #64748b);
    font-size: 14px;
    line-height: 1.45;
}

body.dark .dashboard-due-soon-card,
body.dark .dashboard-due-soon-empty {
    background: var(--app-surface, #24272d);
    border-color: var(--app-border, rgba(255,255,255,0.10));
}

body.dark .dashboard-due-soon-status {
    background: rgba(245, 158, 11, 0.24);
    color: #fde68a;
}

body.dark .dashboard-due-soon-card.status-overdue .dashboard-due-soon-status {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

body.dark .dashboard-due-soon-card.status-ok .dashboard-due-soon-status {
    background: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
}

@media (max-width: 768px) {
    .dashboard-due-soon-card {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
        border-radius: 18px;
        padding: 15px;
    }

    .dashboard-due-soon-status {
        justify-self: start;
    }
}

@media (min-width: 769px) {
    .dashboard-due-soon-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 15px;
    }

    .dashboard-due-soon-card {
        min-height: 118px;
        grid-template-columns: 1fr;
        align-content: space-between;
    }

    .dashboard-due-soon-status {
        justify-self: start;
    }
}

/* =========================
   COMPLETE TOGGLE
   Mobile-first task completion
========================= */

.complete-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.complete-toggle-wrap input[type="date"] {
    min-width: 0;
    flex: 1;
}

.complete-toggle-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    min-width: 38px;
    max-width: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
    box-shadow: none;
    font-size: 18px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.complete-toggle-btn:hover {
    background: rgba(34, 197, 94, 0.20);
}

.complete-toggle-btn.is-completed {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.complete-toggle-btn.is-completed:hover {
    background: rgba(245, 158, 11, 0.22);
}

body.dark .complete-toggle-btn {
    background: rgba(34, 197, 94, 0.22);
    color: #bbf7d0;
}

body.dark .complete-toggle-btn.is-completed {
    background: rgba(245, 158, 11, 0.24);
    color: #fde68a;
}

@media (max-width: 768px) {
    .complete-toggle-wrap {
        gap: 10px;
    }

    .complete-toggle-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        border-radius: 14px;
        font-size: 20px;
    }
}

/* =========================
   FLOATING ADD TASK BUTTON
   Mobile-first app action
========================= */

.mobile-quick-add {
    position: fixed;
    right: calc(16px + var(--app-safe-right, 0px));
    bottom: calc(16px + var(--app-safe-bottom, 0px));
    z-index: 1100;
    min-width: 62px;
    height: 62px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--app-primary, #2563eb);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.34);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.mobile-quick-add:hover {
    background: var(--app-primary-hover, #1d4ed8);
    color: #ffffff;
    transform: translateY(-2px);
}

.mobile-quick-add:active {
    transform: scale(0.96);
}

.mobile-quick-add-icon {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    margin-top: -2px;
}

.mobile-quick-add-text {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

body.dark .mobile-quick-add {
    background: var(--app-primary, #3b82f6);
    color: #ffffff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46);
}

@media (max-width: 768px) {
    .mobile-quick-add {
        min-width: 62px;
        width: 62px;
        height: 62px;
        padding: 0;
        right: calc(16px + var(--app-safe-right, 0px));
        bottom: calc(16px + var(--app-safe-bottom, 0px));
    }

    .mobile-quick-add-text {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-quick-add {
        right: 24px;
        bottom: 24px;
        height: 54px;
        min-width: 132px;
    }

    .mobile-quick-add-icon {
        font-size: 24px;
    }
}

/* =========================
   TRUE MOBILE-FIRST APP SHELL
   Bottom navigation and thumb layout
========================= */

.mobile-bottom-nav {
    display: none;
}

/* Mobile is the primary layout */
@media (max-width: 768px) {
    :root {
        --mobile-bottom-nav-height: 74px;
    }

    body {
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: calc(var(--mobile-bottom-nav-height) + 22px + var(--app-safe-bottom, 0px));
        min-height: 100svh;
    }

    /* Top nav becomes compact utility nav */
    body > nav:first-of-type {
        position: sticky;
        top: 0;
        z-index: 1000;
        min-height: 54px;
        margin-left: -10px;
        margin-right: -10px;
        padding: 8px 10px;
        box-sizing: border-box;
    }

    body > nav:first-of-type .nav-links {
        border-radius: 0 0 18px 18px;
    }

    body > nav:first-of-type .nav-links.open {
        max-height: calc(100svh - 72px);
        overflow-y: auto;
    }

    /* Bottom thumb nav */
    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1250;
        height: calc(var(--mobile-bottom-nav-height) + var(--app-safe-bottom, 0px));
        padding: 8px 10px calc(8px + var(--app-safe-bottom, 0px)) 10px;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        background: rgba(255, 255, 255, 0.92);
        border-top: 1px solid var(--app-border, rgba(0,0,0,0.10));
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    body.dark .mobile-bottom-nav {
        background: rgba(36, 39, 45, 0.94);
        border-top-color: var(--app-border, rgba(255,255,255,0.10));
        box-shadow: 0 -12px 30px rgba(0,0,0,0.42);
    }

    .mobile-bottom-nav-item {
        min-width: 0;
        min-height: 56px;
        padding: 6px 4px;
        border-radius: 16px;
        color: var(--app-muted, #64748b);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-weight: 800;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav-item:active {
        transform: scale(0.96);
        background: rgba(37, 99, 235, 0.10);
    }

    body.dark .mobile-bottom-nav-item:active {
        background: rgba(59, 130, 246, 0.16);
    }

    .mobile-bottom-nav-icon {
        font-size: 21px;
        line-height: 1;
        font-weight: 900;
    }

    .mobile-bottom-nav-label {
        font-size: 10px;
        line-height: 1;
        letter-spacing: -0.01em;
    }

    .mobile-bottom-nav-add {
        color: #ffffff;
        background: var(--app-primary, #2563eb);
        box-shadow: 0 8px 22px rgba(37, 99, 235, 0.30);
    }

    .mobile-bottom-nav-add:active {
        background: var(--app-primary-hover, #1d4ed8);
    }

    body.dark .mobile-bottom-nav-add {
        color: #ffffff;
        background: var(--app-primary, #3b82f6);
        box-shadow: 0 8px 22px rgba(0,0,0,0.34);
    }

    /* Avoid duplicate add buttons on mobile */
    .mobile-quick-add {
        display: none !important;
    }

    /* Main pages should feel app-native */
    .dashboard-container,
    .admin-users-page,
    .task-container,
    .categories-container,
    .table-wrapper {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dashboard-container {
        padding: 8px 0 18px 0;
    }

    .page-title {
        margin-top: 16px;
        margin-bottom: 14px;
        font-size: 26px;
        line-height: 1.08;
    }

    .tasklist-filter-bar {
        top: 54px;
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .app-toast-wrap {
        bottom: calc(var(--mobile-bottom-nav-height) + 14px + var(--app-safe-bottom, 0px));
    }

    .attachment-viewer-panel,
    .category-add-panel,
    .app-confirm-panel {
        max-height: calc(100svh - var(--mobile-bottom-nav-height) - 20px);
    }
}

/* Desktop keeps floating add task as a shortcut */
@media (min-width: 769px) {
    body {
        padding-bottom: 92px;
    }

    .mobile-bottom-nav {
        display: none !important;
    }
}

/* =========================
   TRUE MOBILE NAV FIX
========================= */

/* Layout wrapper */
.main-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

    /* REMOVE TOP NAV COMPLETELY */
    .top-nav {
        display: none !important;
    }

    /* Bottom nav */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: #ffffff;
        border-top: 1px solid rgba(0,0,0,0.1);
        z-index: 1000;
    }

    body.dark .mobile-bottom-nav {
        background: #1f2228;
        border-color: rgba(255,255,255,0.1);
    }

    .mobile-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-weight: 800;
        font-size: 11px;
        color: #64748b;
    }

    .mobile-bottom-nav-item span {
        font-size: 20px;
    }

    .mobile-bottom-nav-item.add {
        background: #2563eb;
        color: #ffffff;
    }

    /* CRITICAL: prevent content hiding */
    body {
        padding-bottom: 90px;
    }
}

/* ===== DESKTOP ===== */
@media (min-width: 769px) {

    .mobile-bottom-nav {
        display: none !important;
    }

    .top-nav {
        display: flex;
        justify-content: space-between;
        padding: 12px 20px;
        background: #ffffff;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    body.dark .top-nav {
        background: #1f2228;
        border-color: rgba(255,255,255,0.1);
    }
}