/* =========================================================
   BASIS
   ========================================================= */

body {
    margin: 0;

    font-family: Arial, sans-serif;

    background: #f4f6f8;
    color: #172033;

    position: relative;
    min-height: 100vh;
}

/*body::before {
    content: "";
    position: fixed;
    right: 40px;
    bottom: 30px;

    width: 320px;
    height: 320px;

    background-image: url("/static/todos/img/logo.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    opacity: 0.1;

    pointer-events: none;
    z-index: 0;
}*/

.container {
    max-width: 1000px;

    margin: 40px auto;
    padding: 0 20px;

    position: relative;
    z-index: 1;
}


/* =========================================================
   SITE HEADER / ACCOUNT
   ========================================================= */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    z-index: 100;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;

    min-height: 66px;
    padding: 8px 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    color: inherit;
}

.site-brand-icon {
    width: 44px;
    height: 44px;

    object-fit: contain;

    display: block;
    flex: 0 0 auto;

    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.site-brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.account-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;

    gap: 12px;

    margin-bottom: 0;

    overflow-wrap: anywhere;
}

.account-bar form {
    margin: 0;
}

.account-menu {
    position: relative;
    z-index: 1000;
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    box-sizing: border-box;

    border: 1px solid #c7d2fe;
    border-radius: 50%;

    background: #e0e7ff;
    color: #3730a3;

    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;

    text-decoration: none;
    list-style: none;

    cursor: pointer;

    transition:
        background 150ms,
        box-shadow 150ms;
}

.account-avatar::-webkit-details-marker {
    display: none;
}

.account-avatar:hover,
.account-menu[open] .account-avatar {
    background: #c7d2fe;
    box-shadow: 0 0 0 4px #eef2ff;
}

.account-avatar:focus-visible,
.account-action:focus-visible {
    outline: 3px solid #6366f1;
    outline-offset: 3px;
}

.account-avatar-guest {
    background: #ffffff;
    color: #64748b;
    border-color: #dbe2ea;
}

.account-dropdown {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    z-index: 20;

    width: 240px;
    max-width: calc(100vw - 40px);

    box-sizing: border-box;

    padding: 18px;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    box-shadow: 0 12px 32px rgb(23 32 51 / 12%);
}

.account-caption {
    display: block;

    font-size: 0.75rem;
    color: #64748b;
}

.account-name {
    display: block;

    margin: 6px 0 16px;

    font-size: 0.95rem;
}

.account-action {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;

    padding: 11px 12px;

    border: 0;
    border-radius: 8px;

    background: #f1f5f9;
    color: #334155;

    font: inherit;
    font-size: 0.9rem;

    cursor: pointer;
}

.account-action:hover {
    background: #e2e8f0;
}


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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
}

.list-meta {
    margin: 6px 0 0;
    color: #6b7280;
}

.header-logo{
    height: 20px;
}

.back-link {
    display: inline-block;

    margin-bottom: 18px;

    color: #6b7280;

    font-size: 0.95rem;
    text-decoration: none;
}

.back-link:hover {
    color: #222222;
}

.add-button {
    display: inline-block;

    padding: 11px 18px;

    border-radius: 8px;

    background: #222222;
    color: #ffffff;

    font-weight: 600;
    text-decoration: none;

    white-space: nowrap;
}

.add-button:hover {
    opacity: 0.85;
}


/* =========================================================
   LISTENÜBERSICHT HEADER
   ========================================================= */

.page-header.list-overview-header {
    justify-content: flex-start;
    align-items: flex-start;

    flex-direction: row;
    flex-wrap: wrap;

    gap: 16px 24px;
}

.list-overview-header > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.list-overview-header .overview-sort {
    margin-left: auto;
    min-height: 40px;
}

.list-overview-header .item-display-options {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 12px 18px;
}


/* =========================================================
   SORTIERUNG / GRUPPIERUNG
   ========================================================= */

.list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}

.sort-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 18px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;

    color: #4b5563;
}

.control-group select {
    padding: 8px 10px;

    border: 1px solid #d1d5db;
    border-radius: 7px;

    background: #ffffff;

    font: inherit;

    cursor: pointer;
}


/* Toggle */

.group-toggle {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    font-size: 0.9rem;

    color: #4b5563;

    cursor: pointer;
}

.group-toggle input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    position: relative;

    width: 40px;
    height: 22px;

    flex-shrink: 0;

    border-radius: 999px;

    background: #d1d5db;

    transition: background 0.2s;
}

.toggle-slider::after {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 16px;
    height: 16px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);

    transition: transform 0.2s;
}

.group-toggle input:checked + .toggle-slider {
    background: #172033;
}

.group-toggle input:checked + .toggle-slider::after {
    transform: translateX(18px);
}


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

.quick-add {
    display: grid;

    grid-template-columns:
        58px
        minmax(0, 1fr);

    margin-bottom: 24px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 12px;
}


/* Linke Rail – identische Designsprache wie Todo-Checkbox */

.quick-add-rail {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px 10px;

    background: #f1f5ff;

    border-right: 1px solid #e1e8fb;
}


/* Such-/Plus-Icon */

.quick-add-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border-radius: 9px;

    background: #ffffff;
    color: #5f6b7a;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

     display: none !important;
}


.quick-add-icon svg {
    width: 30px;
    height: 30px;

    display: block;

    stroke: currentColor;
}


/* Inhalt */

.quick-add-content {
    padding: 16px 18px;
}

.quick-add-content label {
    display: block;

    margin-bottom: 10px;

    font-weight: 600;
}

.quick-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 10px;
}

.quick-add-row input {
    flex: 1 1 220px;

    min-width: 0;

    padding: 12px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    font: inherit;
}

.quick-add button:disabled {
    opacity: 0.5;

    cursor: default;
}

#quick-status {
    margin-bottom: 0;
}

#quick-status:empty {
    display: none;
}

.quick-add [hidden] {
    display: none;
}


/* =========================================================
   TODO LISTE
   ========================================================= */

.todo-list {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


/* =========================================================
   TODO KARTE

   Drei Bereiche:
   1. Status-Rail
   2. Inhalt
   3. Aktionen
   ========================================================= */

.todo-card {
    display: grid;

    grid-template-columns:
        58px
        minmax(0, 1fr)
        auto;

    align-items: stretch;

    gap: 0;

    padding: 0;

    overflow: hidden;

    background: #ffffff;

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}


/* =========================================================
   STATUS-RAIL / CHECKBOX
   ========================================================= */

.todo-check-column {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100%;

    padding: 18px 10px;

    box-sizing: border-box;

    background: #f1f5ff;

    border-right: 1px solid #e1e8fb;
}

.todo-check-form {
    margin: 0;
}

.todo-checkbox {
    width: 28px;
    height: 28px;

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

    padding: 0;

    border: 2px solid #a7b0bf;
    border-radius: 7px;

    background: #ffffff;
    color: #ffffff;

    font-size: 18px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background 150ms,
        border-color 150ms,
        box-shadow 150ms;
}

.todo-checkbox:hover:not(:disabled) {
    border-color: #64748b;

    box-shadow: 0 0 0 3px #e5ebff;
}

.todo-checkbox.checked {
    background: #687386;
    border-color: #687386;
}

.todo-checkbox:disabled {
    opacity: 0.45;

    cursor: default;
}


/* =========================================================
   TODO HAUPTINHALT
   ========================================================= */

.todo-main {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-width: 0;

    padding: 18px 20px;
}

.todo-content {
    flex: 1;

    min-width: 0;
}

.todo-content h2 {
    margin: 0 0 8px;

    font-size: 1.2rem;
}

.todo-content h2:last-child {
    margin-bottom: 0;
}

.todo-description {
    margin: 0 0 12px;

    line-height: 1.45;

    color: #394150;
}


/* =========================================================
   META INFOS
   ========================================================= */

.todo-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 10px;
}

.todo-meta-row:empty {
    display: none;
}

.todo-meta-badge {
    display: inline-block;

    padding: 6px 9px;

    border-radius: 6px;

    background: #f1f3f5;

    color: #4b5563;

    font-size: 0.9rem;
}

.external-link {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    border-radius: 6px;

    background: #eef4ff;

    color: #2456a6;

    font-size: 0.9rem;
    font-weight: 600;

    text-decoration: none;
}

.external-link:hover {
    background: #dce8ff;
}


/* =========================================================
   BILD IN DER LISTE
   ========================================================= */

.todo-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 80px;
    height: 70px;

    flex-shrink: 0;

    overflow: hidden;

    border-radius: 8px;
}

.todo-image {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}


/* =========================================================
   TODO AKTIONEN
   ========================================================= */

.todo-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    flex-shrink: 0;

    padding: 18px 18px 18px 0;
}

.icon-button {
    width: 36px;
    height: 36px;

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

    padding: 0;

    border: none;
    border-radius: 7px;

    background: #f1f3f5;
    color: #333333;

    text-decoration: none;

    font: inherit;
    font-size: 17px;

    cursor: pointer;
}

.icon-button:hover {
    background: #e2e6ea;
}

.icon-button.delete {
    background: #fff0f1;
}

.icon-button.delete:hover {
    background: #ffdfe2;
}

/* =========================================================
   LISTEN FOOTER
   ========================================================= */

.list-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 20px;
}

.footer-file-actions {
    display: flex;
    gap: 10px;
}

.footer-back-to-top {
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-back-to-top:hover {
    color: #1f2937;
}

.csv-import-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* =========================================================
   ERLEDIGTE EINTRÄGE
   ========================================================= */

.todo-card.completed {
    opacity: 0.65;
}

.todo-card.completed .todo-check-column {
    background: #edf0f5;
}

.todo-card.completed h2,
.todo-card.completed .todo-description {
    text-decoration: line-through;
}


/* =========================================================
   LEERE LISTE
   ========================================================= */

.empty-state {
    padding: 30px;

    border-radius: 12px;

    background: #ffffff;

    text-align: center;

    color: #6b7280;
}


/* =========================================================
   LISTENÜBERSICHT
   ========================================================= */

.list-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));

    gap: 16px;
}

.list-card {
    position: relative;

    padding: 20px;

    background: #ffffff;

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.list-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.list-card-main {
    display: block;

    padding-right: 90px;

    color: inherit;

    text-decoration: none;
}

.list-card-main h2 {
    margin: 0 0 8px;

    font-size: 1.2rem;
}

.list-card-main p {
    margin: 0;

    color: #6b7280;
}

.list-card-actions {
    position: absolute;

    top: 16px;
    right: 16px;

    display: flex;

    gap: 6px;
}

.todo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;

    margin-top: 6px;
    margin-bottom: 10px;
}

/* =========================================================
   FORMULAR
   ========================================================= */

.form-card {
    max-width: 760px;

    margin: 0 auto;

    padding: 28px;

    background: #ffffff;

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-card h1 {
    margin-top: 0;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 6px;

    margin-bottom: 18px;
}

.form-group label {
    font-weight: 600;
}

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

    box-sizing: border-box;

    padding: 10px 12px;

    border: 1px solid #cccccc;
    border-radius: 8px;

    background: #ffffff;

    font: inherit;
}

.form-group textarea {
    min-height: 120px;

    resize: vertical;
}

.form-help {
    font-size: 0.85rem;

    color: #666666;
}

.form-error {
    font-size: 0.9rem;

    color: #b00020;
}


/* =========================================================
   BILD IM FORMULAR
   ========================================================= */

.image-clear-checkbox {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.image-preview {
    position: relative;

    width: 220px;
    height: 160px;

    margin-bottom: 12px;

    overflow: hidden;

    border: 1px solid #dddddd;
    border-radius: 10px;

    background: #f5f5f5;
}

.image-preview img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}

.image-delete-button {
    position: absolute;

    top: 8px;
    right: 8px;

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

    width: 30px;
    height: 30px;

    border-radius: 50%;

    background: rgba(0, 0, 0, 0.7);

    color: #ffffff;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.image-delete-button:hover {
    background: #000000;
}

.image-upload {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.image-upload label {
    font-weight: 600;
}


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

.form-actions {
    display: flex;

    gap: 10px;

    margin-top: 24px;
}

.primary-button,
.secondary-button {
    display: inline-block;

    padding: 10px 16px;

    border-radius: 8px;

    font: inherit;

    text-decoration: none;

    cursor: pointer;
}

.primary-button {
    border: none;

    background: #222222;
    color: #ffffff;
}

.secondary-button {
    border: none;

    background: #e9ecef;
    color: #222222;
}

.primary-button:hover,
.secondary-button:hover {
    opacity: 0.85;
}

.danger-button {
    background: #c92a2a;
}

.danger-button:hover {
    background: #a51111;
}


/* =========================================================
   Login
   ========================================================= */

.login-page {
    min-height: 100vh;

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

    background: #f4f6f8;

    padding: 32px;
}

.login-layout {
    width: 100%;
    max-width: 980px;

    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(320px, 420px);

    align-items: center;
    gap: 64px;
}

.login-branding {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo {
    width: 100%;
    max-width: 440px;
    height: auto;

    display: block;
}

.login-panel {
    width: 100%;
}

.login-card {
    padding: 32px;
}

.login-card h1 {
    margin-top: 0;
    margin-bottom: 8px;
}

.login-intro {
    margin-top: 0;
    margin-bottom: 24px;

    color: #64748b;
}

.login-submit {
    width: 100%;

    margin-top: 8px;
}


/* =========================================================
   Login Mobile
   ========================================================= */

@media (max-width: 700px) {

    .login-page {
        align-items: flex-start;

        padding: 28px 16px;
    }

    .login-layout {
        grid-template-columns: 1fr;

        gap: 24px;
    }

    .login-logo {
        max-width: 260px;
    }

    .login-card {
        padding: 24px;
    }
}


/* =========================================================
   MODAL
   ========================================================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

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

    padding: 20px;

    background: rgba(0, 0, 0, 0.35);

    z-index: 1000;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 420px;

    padding: 24px;

    background: #ffffff;

    border-radius: 14px;

    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.modal-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.modal-card p {
    margin-bottom: 20px;

    color: #4b5563;
}

/* =========================
   TAG EDITOR
   ========================= */

.tag-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    min-height: 46px;
    padding: 8px 10px;

    background: #ffffff;

    border: 1px solid #cbd5e1;
    border-radius: 9px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.tag-editor:focus-within {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}


.tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}


.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 8px 5px 10px;

    background: #eef2ff;
    color: #334155;

    border: 1px solid #dce3f5;
    border-radius: 999px;

    font-size: 0.9rem;
    line-height: 1.2;
}


.tag-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #64748b;

    cursor: pointer;

    font-size: 17px;
    line-height: 1;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.tag-chip-remove:hover {
    background: rgba(100, 116, 139, 0.12);
    color: #1f2937;
}


.tag-editor-input {
    flex: 1 1 140px;

    min-width: 120px;

    padding: 5px 2px;

    border: 0;
    outline: 0;

    background: transparent;

    font: inherit;
    color: inherit;
}

.tag-editor-input::placeholder {
    color: #94a3b8;
}


.form-help {
    margin-top: 6px;
    margin-bottom: 0;

    color: #64748b;

    font-size: 0.85rem;
}

/* =========================
   TAG IN EINTRÄGEN UND LISTEN
   ========================= */

.tag-display-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 12px;
}

.tag-display-chip {
    display: inline-flex;
    align-items: center;

    padding: 3px 8px;

    background: #f1f5f9;
    color: #475569;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    font-size: 0.8rem;
    line-height: 1.2;
}

.inline-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 1px solid #d6dde8;
    border-radius: 8px;

    background: #f8fafc;
    color: #475569;

    font: inherit;
    font-size: 1.25rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.inline-add-button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1f2937;
}

/* =========================================================
   CATEGORY SELECTOR
   ========================================================= */

.category-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-option {
    appearance: none;

    padding: 6px 12px;

    border: 1px solid #d6dde8;
    border-radius: 999px;

    background: #f8fafc;
    color: #475569;

    font: inherit;
    font-size: 0.9rem;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.category-option:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.category-option.active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #3730a3;
}

.category-new-button {
    background: #ffffff;
    border-style: dashed;
}


/* Eingabe für neue Kategorie */

.category-new-input-row {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 10px;

    padding: 6px 8px;

    border: 1px solid #cbd5e1;
    border-radius: 9px;

    background: #ffffff;
}

.category-new-input-row[hidden] {
    display: none;
}

.category-new-input {
    flex: 1;

    min-width: 0;

    padding: 5px 2px;

    border: 0;
    outline: 0;

    background: transparent;

    font: inherit;
    color: inherit;
}

.category-new-input::placeholder {
    color: #94a3b8;
}

.category-new-input-row:focus-within {
    border-color: #94a3b8;

    box-shadow:
        0 0 0 3px rgba(148, 163, 184, 0.14);
}

/* =========================================================
   CATEGORY GROUPING
   ========================================================= */

.category-group {
    margin-bottom: 30px;
}

.category-group-summary {
    margin-bottom: 12px;
}

.category-group .todo-card + .todo-card {
    margin-top: 12px;
}

.status-group {
    margin-top: 8px;
    margin-bottom: 16px;
}

.status-group-title {
    margin-bottom: 10px;

    font-size: 0.95rem;
    font-weight: 600;

    color: #475569;
}

.completed-status-group {
    margin-top: 14px;
}

.completed-status-group > .todo-card:first-of-type {
    margin-top: 10px;
}


.todo-classification-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;

    margin-top: 7px;
    margin-bottom: 9px;
}

/* Kategorie = strukturelle Zuordnung */
.category-display-chip {
    display: inline-flex;
    align-items: center;

    padding: 3px 9px;

    border: 1px solid #cbd5e1;
    border-radius: 999px;

    background: #ffffff;
    color: #334155;

    font-size: 0.8rem;
    font-weight: 600;
}

/* Tags = zusätzliche Merkmale */
.category-display-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 3px 9px;

    border: 1px solid #cbd5e1;
    border-radius: 999px;

    background: #ffffff;
    color: #334155;

    font-size: 0.8rem;
    font-weight: 600;
}

.category-chip-icon {
    width: 14px;
    height: 14px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Suche / dynamisches Ausblenden */

.todo-card[hidden],
.category-group[hidden],
.status-group[hidden] {
    display: none !important;
}


/* =========================================================
   MOBILE
   Nur Unterschiede zum Desktop!
   ========================================================= */

@media (max-width: 700px) {

    .container {
        margin: 20px auto;
        padding: 0 12px;
    }


    /* =====================================================
       Header
       ===================================================== */

    .site-header-inner {
        padding: 10px 12px;
    }

    .page-header {
        align-items: flex-start;
        gap: 12px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .add-button {
        padding: 10px 13px;
    }


    /* =====================================================
       Listenübersicht
       ===================================================== */

    .list-overview-header .overview-sort {
        flex-basis: 100%;
        margin-left: 0;
    }

    .list-overview-header .item-display-options {
        align-items: stretch;
    }

    /* =====================================================
       Sortierung / Gruppierung
       ===================================================== */

    .list-controls {
        align-items: flex-start;
    }

    .sort-form {
        width: 100%;

        flex-direction: column;
        align-items: stretch;

        gap: 12px;
    }

    .control-group {
        justify-content: space-between;
    }

    .control-group select {
        flex: 1;
        max-width: 200px;
    }

    .group-toggle {
        justify-content: flex-start;
    }


    /* =====================================================
       Quick Add
       ===================================================== */

    .quick-add {
        grid-template-columns:
            48px
            minmax(0, 1fr);
    }

    .quick-add-content {
        padding: 14px;
    }

    .quick-add-row {
        display: grid;

        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;

        align-items: center;
        gap: 8px;
    }

    .quick-add-row input {
        min-width: 0;
        width: 100%;
    }

    /*
       Mobile: Text der beiden Aktionen ausblenden,
       nur Icon anzeigen.
    */

    .quick-action-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 44px;
        height: 44px;

        min-width: 44px;

        padding: 0;

        white-space: nowrap;
    }

    .quick-action-text {
        display: none;
    }

    .quick-action-icon {
        display: inline;

        font-size: 1.2rem;
        line-height: 1;
    }

    /*
       Absichtlich KEINE Farbdefinition für
       .quick-add-icon hier.
       Desktop und Mobile verwenden dieselbe Farbe.
    */


    /* =====================================================
       Todo Karte
       Checkbox | Inhalt | Aktionen
       ===================================================== */

    .todo-card {
        grid-template-columns:
            48px
            minmax(0, 1fr)
            auto;

        align-items: stretch;
    }

    .todo-check-column {
        grid-column: 1;
        grid-row: 1;

        padding: 14px 8px;
    }

    .todo-main {
        grid-column: 2;
        grid-row: 1;

        min-width: 0;

        flex-direction: column;
        align-items: flex-start;

        gap: 10px;

        padding: 14px;
    }

    .todo-content {
        width: 100%;
        min-width: 0;
    }

    .todo-content h2 {
        font-size: 1.05rem;
    }

    .todo-description {
        font-size: 0.95rem;
    }


    /* =====================================================
       Bild unter dem Inhalt
       ===================================================== */

    .todo-image-wrapper {
        width: 72px;
        height: 64px;
    }


    /* =====================================================
       Aktionen rechts in der Karte
       ===================================================== */

    .todo-actions {
        grid-column: 3;
        grid-row: 1;

        display: flex;
        flex-wrap: nowrap;

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

        gap: 7px;

        padding:
            14px
            14px
            14px
            0;

        margin: 0;
    }


    /* =====================================================
       Touch-Flächen
       ===================================================== */

    .icon-button {
        flex: 0 0 auto;

        width: 40px;
        height: 40px;
    }

    .todo-checkbox {
        width: 27px;
        height: 27px;
    }


    /* =====================================================
       Formulare
       ===================================================== */

    .form-card {
        padding: 20px;
    }

    .image-preview {
        width: 100%;
        max-width: 260px;

        height: 180px;
    }

    .form-actions {
        flex-direction: column;
    }

    /*
       WICHTIG:
       Nur normale Formularbuttons auf volle Breite.
       Nicht mehr global alle primary/secondary buttons!
    */

    .form-actions .primary-button,
    .form-actions .secondary-button {
        width: 100%;

        box-sizing: border-box;
        text-align: center;
    }


    /* =====================================================
       Listen
       ===================================================== */

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