:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --card: #ffffff;
    --txt: #12203a;
    --muted: #627089;
    --pri: #2663eb;
    --danger: #d33c3c;
    --border: #dde3ef;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: var(--bg);
    color: var(--txt);
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
}

.container.small { max-width: 760px; }

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

.top-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.top-menu form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    margin: 0;
}

.inline-form select {
    margin: 0;
    width: auto;
    min-width: 140px;
}

.top-menu .button,
.top-menu .menu-toggle,
.top-menu select {
    margin-top: 0;
    height: 42px;
}

.top-menu .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.top-menu select {
    width: auto;
  
    padding: 0 10px;
}

.mobile-label {
    display: none;
}

.notification-btn {
    position: relative;
}

.notification-btn .notification-badge {
    display: none;
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    border-radius: 50%;
    width: 10px;
    height: 10px;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-todo-btn {
    margin-top: 0;
}

.add-standard-btn {
    height: 42px;
    min-width: 92px;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
}

.top-actions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(12, 30, 66, 0.12);
    z-index: 30;
}

.top-actions.open {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-actions .button {
    margin-top: 0;
    width: 100%;
    text-align: left;
}

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin: 14px 0;
    box-shadow: 0 4px 16px rgba(12, 30, 66, 0.05);
}

label {
    display: block;
    margin: 10px 0 6px;
    font-size: 14px;
    color: var(--muted);
}

input, textarea, select {
    width: 100%;
    border: 1px solid #cfd7e7;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
}

.date-picker-field {
    position: relative;
}

.custom-date-input {
    cursor: pointer;
    background: #fff;
}

.custom-calendar {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(300px, 92vw);
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(12, 30, 66, 0.14);
    z-index: 60;
}

.custom-calendar.hidden {
    display: none;
}

.calendar-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-picker-head button {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
}

.calendar-picker-title {
    font-weight: 700;
    text-align: center;
}

.calendar-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-picker-day,
.calendar-picker-date {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
}

.calendar-picker-day {
    color: var(--muted);
    font-weight: 700;
}

.calendar-picker-date {
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--txt);
}

.calendar-picker-date:hover,
.calendar-picker-date.selected {
    background: var(--pri);
    color: #fff;
}

.calendar-picker-date.empty {
    visibility: hidden;
}

button, .button {
    margin-top: 12px;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--pri);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button.secondary, .button.secondary {
    background: #657084;
}

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

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quick-start-btn.timer-active {
    background: #198754 !important;
    color: #fff;
    opacity: 1;
}

.quick-start-btn.timer-active .mobile-label::after {
    content: '•';
    margin-left: 4px;
    font-size: 14px;
    vertical-align: middle;
}

.flash {
    border-radius: 10px;
    padding: 10px 12px;
    margin: 12px 0;
}

.flash.success { background: #e7f7ec; color: #146734; }
.flash.error { background: #fdeaea; color: #9f2323; }

.hint {
    color: var(--muted);
    font-size: 13px;
}

.saved-transfer-picker {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
    margin-top: 10px;
}

.saved-transfer-picker label {
    grid-column: 1 / -1;
    margin: 0;
}

.saved-transfer-picker select {
    min-width: 0;
}

.saved-transfer-picker button {
    margin-top: 0;
    white-space: nowrap;
}

.saved-transfer-preview {
    margin-top: 8px;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.saved-transfer-preview-title {
    position: sticky;
    top: 0;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: #f8f9fa;
    font-weight: 700;
    z-index: 1;
}

.saved-transfer-preview table {
    margin: 0;
}

.saved-transfer-preview th,
.saved-transfer-preview td {
    font-size: 13px;
}

@media (max-width: 520px) {
    .saved-transfer-picker {
        grid-template-columns: 1fr;
    }
}

.table-wrap {
    overflow-x: auto;
}

.inventory-count-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.inventory-count-toolbar h2 {
    margin-top: 0;
}

.inventory-count-table input[type="number"] {
    width: 110px;
    min-width: 90px;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.inventory-count-save {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    padding: 14px 0 2px;
    background: var(--bg);
}

.count-positive { color: #147d3f; font-weight: 700; }
.count-negative { color: #b3261e; font-weight: 700; }

.timer-running-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.timer-running-actions form,
.timer-running-actions button {
    margin: 0;
}

.share-link-box {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #b9caea;
    border-radius: 10px;
    background: #f2f6ff;
}

.share-link-box label { margin-top: 0; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row input { margin: 0; }
.share-link-row button { white-space: nowrap; }
.active-shares { margin-top: 18px; }
.active-shares summary { cursor: pointer; font-weight: 700; }
.active-shares li { margin: 8px 0; }
.active-shares li span { margin-left: 8px; color: var(--muted); }
.share-expiry { padding: 10px 12px; border-radius: 8px; background: #fff5d9; }
.shared-count-message { max-width: 620px; margin: 60px auto; }

.product-order-list {
    margin: 20px 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.product-order-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 104px;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.product-order-item:last-child { border-bottom: 0; }
.product-order-item:hover { background: #f8faff; }

.product-order-position {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #e9eef7;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.product-order-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-order-info strong { line-height: 1.3; }
.product-order-info small { color: var(--muted); margin-top: 3px; }
.product-order-actions { display: flex; justify-content: flex-end; gap: 8px; }
.product-order-actions button {
    width: 44px;
    height: 40px;
    min-width: 44px;
    margin: 0;
    padding: 0;
    border-radius: 9px;
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 700px) {
    .inventory-count-toolbar {
        display: block;
    }

    .inventory-count-toolbar .row-actions {
        margin-top: 12px;
    }

    .product-order-item {
        grid-template-columns: 38px minmax(0, 1fr) 88px;
        gap: 8px;
        padding: 8px;
    }

    .product-order-position {
        width: 32px;
        height: 32px;
    }

    .product-order-actions { gap: 4px; }
    .product-order-actions button { width: 40px; min-width: 40px; }

    .inventory-count-table th,
    .inventory-count-table td {
        padding: 7px 5px;
    }

    .inventory-count-table th:first-child,
    .inventory-count-table td:first-child {
        width: 28px;
    }

    .inventory-count-table input[type="number"] {
        width: 76px;
        min-width: 76px;
        padding: 9px 7px;
    }

    .share-link-row { display: block; }
    .share-link-row button { width: 100%; margin-top: 8px; }
}

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

th, td {
    border-bottom: 1px solid var(--border);
    padding: 8px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.activity-history-table .ah-stop {
    display: block;
    color: #888;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.activity-history-table .ah-start {
    font-weight: 700;
}

.activity-history-card.history-actions-hidden .ah-actions-heading,
.activity-history-card.history-actions-hidden .ah-actions {
    display: none;
}

.status-open {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1db954;
}

.status-closed {
    display: inline-block;
    font-weight: 700;
    color: #b42323;
    font-size: 16px;
    line-height: 1;
}

.row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

.row-actions button {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 12px;
}

.row-actions .button {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 12px;
}

.view-switch {
    display: flex;
    gap: 8px;
}

.todo-link {
    border: 0;
    background: transparent;
    color: #1a4fb5;
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-align: left;
    text-decoration: underline;
}

.todo-suggestions {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.todo-suggestion-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f9;
    margin: 0;
    border-radius: 0;
    background: #fff;
    color: var(--txt);
    text-align: left;
    padding: 8px 10px;
}

.todo-suggestion-item:last-child {
    border-bottom: 0;
}

.todo-suggestion-item strong {
    display: block;
}

.todo-suggestion-item span {
    display: block;
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
    margin-top: 2px;
}

.todo-done td {
    opacity: 0.65;
}

.todo-type-icon {
    font-size: 15px;
    margin-right: 4px;
    vertical-align: middle;
    line-height: 1;
}

.todo-type-selectors {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.todo-type-selectors label {
    margin: 6px 0;
}

.todo-title-mobile {
    display: none;
}

.todo-due-text {
    display: inline-block;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.calendar-nav h2 {
    margin: 0;
    font-size: 20px;
}

.calendar-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 8px;
}

.cal-head {
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
}

.cal-cell {
    min-height: 110px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    background: #fff;
}

.cal-cell.empty {
    border-style: dashed;
    background: #f9fbff;
}

.cal-day {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-weight: 700;
    margin-bottom: 6px;
}

.cal-day-weekday {
    color: #9aa6b8;
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
}

.cal-item {
    font-size: 12px;
    border-radius: 8px;
    padding: 4px 6px;
    margin-bottom: 4px;
    background: #e9f0ff;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: grab;
}

.cal-item.done {
    background: #ebf8ef;
    color: #2f6a3f;
}

.cal-item.dragging {
    opacity: 0.5;
}

.cal-cell.drag-over {
    border-color: #2663eb;
    background: #f0f5ff;
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .topbar {
        align-items: flex-start;
    }

    .mobile-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        background: rgba(245, 247, 251, 0.97);
        border-top: 1px solid var(--border);
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        justify-content: center;
        gap: 14px;
        flex-wrap: nowrap;
    }

    .mobile-dock .user-filter-form {
        position: fixed;
        top: 8px;
        right: 10px;
        width: 112px;
        z-index: 90;
    }

    .mobile-dock .quick-start-form {
        position: static;
        width: auto;
        z-index: auto;
    }

    .mobile-dock .desktop-only-action {
        display: none;
    }

    .mobile-dock .user-filter-form select {
        width: 100%;
        font-size: 12px;
    }

    .mobile-dock > .button,
    .mobile-dock > .menu-toggle,
    .mobile-dock > form > .button {
        width: 54px;
        height: 54px;
        min-width: 0;
        margin: 0;
        padding: 0 !important;
        border-radius: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-dock .mobile-add-btn {
        width: 64px !important;
        height: 64px !important;
        border-radius: 50% !important;
        transform: translateY(-10px);
        font-size: 30px;
        font-weight: 700;
        line-height: 1;
    }

    .mobile-dock .desktop-label {
        display: none;
    }

    .mobile-dock .mobile-label {
        display: inline;
        line-height: 1;
    }

    .mobile-dock .top-actions {
        position: fixed;
        right: 12px;
        top: auto;
        bottom: calc(86px + env(safe-area-inset-bottom));
    }

    .hide-mobile {
        display: none !important;
    }

    .todo-list-table .todo-due-cell {
        white-space: nowrap;
    }

    .todo-list-table .todo-due-text {
        color: #6b7280;
        font-weight: 700;
    }

    .todo-list-table .todo-title-mobile {
        display: block;
        color: var(--txt);
        font-size: 14px;
        margin-top: 4px;
        font-weight: 600;
    }

    .todo-list-table .todo-actions-cell .row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .todo-list-table .todo-actions-cell .row-actions button,
    .todo-list-table .todo-actions-cell .row-actions .button {
        width: 100%;
        text-align: center;
    }

    .week-totals-table {
        width: 100%;
        border-collapse: collapse;
    }

    .week-totals-table th,
    .week-totals-table td {
        padding: 8px 10px;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }

    .activity-history-table thead {
        display: none;
    }

    .activity-history-table tbody tr {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr) auto;
        grid-template-areas:
            'status start time'
            'note note note'
            'actions actions actions';
        column-gap: 10px;
        row-gap: 8px;
        padding: 8px 0;
    }

    .activity-history-table td {
        border-bottom: 0;
        padding: 0;
    }

    .activity-history-table .ah-status {
        grid-area: status;
        align-self: center;
    }

    .activity-history-table .ah-startstop {
        grid-area: start;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .activity-history-table .ah-start,
    .activity-history-table .ah-stop {
        display: inline;
        font-size: 14px;
        font-weight: 700;
        color: inherit;
    }

    .activity-history-table .ah-stop::before {
        content: '  /  ';
        color: #888;
    }

    .activity-history-table .ah-time {
        grid-area: time;
        align-self: center;
        white-space: nowrap;
    }

    .activity-history-table .ah-note {
        grid-area: note;
        width: 100%;
        line-height: 1.35;
        word-break: break-word;
    }

    .activity-history-table .ah-actions {
        grid-area: actions;
    }

    .activity-history-table tbody tr + tr {
        border-top: 1px solid var(--border);
    }

    .transfer-table thead {
        display: none;
    }

    .transfer-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            'product product barcode'
            'expected received check';
        gap: 8px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }

    .transfer-table td {
        border-bottom: 0;
        padding: 0;
    }

    .transfer-table .transfer-cell-product { grid-area: product; font-weight: 700; }
    .transfer-table .transfer-cell-barcode { grid-area: barcode; text-align: right; color: var(--muted); }
    .transfer-table .transfer-cell-expected { grid-area: expected; text-align: left !important; }
    .transfer-table .transfer-cell-received { grid-area: received; text-align: left !important; }
    .transfer-table .transfer-cell-check { grid-area: check; }

    .transfer-table .transfer-cell-check form {
        display: flex !important;
        flex-direction: column;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 6px !important;
    }

    .transfer-table .transfer-cell-check input[type="number"] {
        width: 100% !important;
        max-width: none;
    }

    .transfer-table .transfer-cell-check button {
        width: 100%;
        margin-top: 0;
    }

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

    .cal-head {
        display: none;
    }

    .cal-cell.empty {
        display: none;
    }

    .cal-cell {
        min-height: auto;
    }
}

.modal {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    padding: 0;
}

.hidden {
    display: none !important;
}

.modal-content {
    width: 100%;
    max-width: 100%;
    flex: 1;
    background: #fff;
    border-radius: 0;
    padding: 24px 32px;
    border: none;
}

.modal-content.large {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 1024px) {
    #todo-create-modal.modal {
        background: rgba(15, 23, 42, 0.45);
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    #todo-create-modal .modal-content,
    #todo-create-modal .modal-content.large {
        width: min(680px, 100%);
        max-width: 680px;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        flex: 0 1 auto;
        border-radius: 12px;
        border: 1px solid var(--border);
        padding: 20px 24px;
    }
}

#transfer-products-modal .modal-content {
    max-height: none;
    display: flex;
    flex-direction: column;
}

#transfer-products-search {
    margin-top: 8px;
}

#transfer-products-list {
    margin-top: 10px;
    max-height: calc(100vh - 260px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

#transfer-products-list table {
    min-width: 760px;
}

#transfer-products-list .transfer-products-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
}

#transfer-products-list .transfer-products-table thead {
    display: none;
}

#transfer-products-list .transfer-products-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

#transfer-products-list .transfer-products-table td {
    padding: 0;
    border: 0;
    vertical-align: middle;
}

#transfer-products-list .transfer-products-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr minmax(92px, 110px);
    grid-template-areas:
        'name name name'
        'select barcode qty';
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    box-sizing: border-box;
}

#transfer-products-list .transfer-products-table .tp-cell-name {
    grid-area: name;
    font-weight: 700;
    line-height: 1.3;
    padding-bottom: 2px;
}

#transfer-products-list .transfer-products-table .tp-cell-select {
    grid-area: select;
    white-space: nowrap;
}

#transfer-products-list .transfer-products-table .tp-cell-barcode {
    grid-area: barcode;
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#transfer-products-list .transfer-products-table .tp-cell-qty {
    grid-area: qty;
}

#transfer-products-list .transfer-products-table .tp-cell-available {
    display: none;
}

#transfer-products-list .transfer-products-table .product-quantity {
    width: 100%;
    max-width: 110px;
}

@media (max-width: 768px) {
    #transfer-products-list {
        max-height: calc(100vh - 230px);
    }

    #transfer-products-list .transfer-products-mobile-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }

    #transfer-products-list .transfer-product-item {
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-sizing: border-box;
    }

    #transfer-products-list .transfer-product-item .tp-mobile-title {
        font-weight: 700;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    #transfer-products-list .transfer-product-item .tp-mobile-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        border-top: 1px solid var(--border);
        padding-top: 8px;
    }

    #transfer-products-list .transfer-product-item .tp-mobile-select {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    #transfer-products-list .transfer-product-item .tp-mobile-barcode {
        color: var(--muted);
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #transfer-products-list .transfer-product-item .product-quantity {
        width: 88px;
        max-width: 88px;
        min-width: 88px;
        margin: 0;
        flex: 0 0 88px;
    }
}

#transfer-products-save {
    margin-top: 10px;
    align-self: flex-start;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-description {
    white-space: pre-wrap;
}

.hidden {
    display: none !important;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

input[type="number"] {
    max-width: 100px;
}

label input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

label {
    display: block;
}

label input[type="checkbox"] {
    display: inline;
}
/* Notes container and grid */
.week-nav-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.week-nav-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.week-nav-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.week-nav-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--txt);
}

.week-nav-range-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}

.week-nav-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.week-nav-filters select,
.week-nav-filters input[type="date"] {
    flex: 1;
    min-width: 110px;
    height: 42px;
    padding: 0 8px;
}

/* Notes container and grid */
.notes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.note-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.note-header h3 {
    margin: 0;
    font-size: 1.1rem;
    word-break: break-word;
    flex: 1;
}

.note-content {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 200px;
    margin-bottom: 12px;
}

.note-meta {
    font-size: 0.8rem;
    color: #999;
    text-align: right;
}

.button.danger.small {
    padding: 4px 8px;
    font-size: 0.85rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.button.danger.small:hover {
    background-color: #c82333;
}

/* Note create form */
.form-group {
    margin-bottom: 16px;
}

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