/**
 * Cowork Todos - Dashboard v1.0
 * Mandantenfähige Aufgaben- und Projektverwaltung
 * Teil der Cowork-Suite (Core / Todos / Knowledge / Offers)
 */

/* ===================================================================
   RESET + VARIABLES
   =================================================================== */
.cw-todos, .cw-todos * { margin:0; padding:0; box-sizing:border-box; }
.cw-todos {
    --c-primary: #1a6fa0;
    --c-primary-d: #145580;
    --c-primary-l: #e8f4fb;
    --c-accent: #0ea5e9;
    --c-green: #059669;
    --c-green-l: #ecfdf5;
    --c-red: #dc2626;
    --c-yellow: #eab308;
    --c-orange: #f97316;
    --c-text: #1e293b;
    --c-text2: #475569;
    --c-text3: #94a3b8;
    --c-border: #e2e8f0;
    --c-bg: #f1f5f9;
    --c-white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --ease: cubic-bezier(.4,0,.2,1);

    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-bg);
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    line-height: 1.5;
    font-size: 15px;
}

/* ===================================================================
   HEADER
   =================================================================== */
.cw-todos-header {
    background: linear-gradient(135deg, #0f4c75 0%, #1a6fa0 40%, #2196c4 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
.cw-todos-header::before {
    content: '';
    position: absolute;
    top: -60%; right: -10%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
    border-radius: 50%;
}
.cw-todos-header::after {
    content: '';
    position: absolute;
    bottom: -40%; left: 20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
    border-radius: 50%;
}
.cw-todos-header__inner {
    position: relative; z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 36px;
}
.cw-todos-header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.cw-todos-header__logo {
    width: 36px; height: 36px;
    stroke: white; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    opacity: .9;
}
.cw-todos-header__title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: white;
    margin: 0;
}
.cw-todos-header__sub {
    font-size: .88rem;
    opacity: .8;
    display: block;
    margin-top: 2px;
}
.cw-todos-header__badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

/* ===================================================================
   TABS
   =================================================================== */
.cw-todos-tabs {
    display: flex;
    background: var(--c-white);
    border-bottom: 2px solid var(--c-border);
    padding: 0 36px;
    gap: 0;
    margin-top: 6px;
}
.cw-todos-tabs__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--c-text2);
    cursor: pointer;
    transition: all .2s var(--ease);
    font-family: var(--font);
}
.cw-todos-tabs__btn svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.cw-todos-tabs__btn:hover {
    color: #ffffff;
    background: rgba(26,111,160,.6);
}
.cw-todos-tabs__btn:hover svg {
    stroke: #ffffff;
}
.cw-todos-tabs__btn--active {
    color: #ffffff;
    background: var(--c-primary);
    border-bottom-color: var(--c-primary);
}
.cw-todos-tabs__btn--active svg {
    stroke: #ffffff;
}
.cw-todos-tabs__btn--active:hover {
    color: #ffffff;
    background: var(--c-primary);
}

/* ===================================================================
   PANELS
   =================================================================== */
.cw-todos-panel { padding: 24px 28px 36px; }

/* ===================================================================
   CARDS / SECTIONS
   =================================================================== */
.cw-todos-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.cw-todos-card--blue {
    border-left: 5px solid var(--c-primary);
    background: linear-gradient(135deg, var(--c-primary-l) 0%, #f0f9ff 100%);
}
.cw-todos-card--green {
    border-left: 5px solid var(--c-green);
    background: linear-gradient(135deg, var(--c-green-l) 0%, #f0fdf4 100%);
}

/* Collapse Toggle */
.cw-todos-card__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-text2);
    cursor: pointer;
    transition: background .2s;
    font-family: var(--font);
    text-align: left;
}
.cw-todos-card__toggle:hover {
    background: rgba(26,111,160,.7);
    color: #ffffff;
}
.cw-todos-card__toggle:hover svg:first-child { stroke: #ffffff; }
.cw-todos-card__toggle:hover .cw-todos-chevron { stroke: #ffffff; }
.cw-todos-card__toggle svg:first-child {
    width: 20px; height: 20px;
    stroke: var(--c-primary); fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
.cw-todos-card--green .cw-todos-card__toggle svg:first-child { stroke: var(--c-green); }
.cw-todos-chevron {
    width: 18px; height: 18px;
    stroke: var(--c-text3); fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    margin-left: auto;
    transition: transform .3s var(--ease);
}
.cw-todos-chevron--open { transform: rotate(180deg); }
.cw-todos-card__body { padding: 0 20px 20px; }

/* ===================================================================
   FORM ELEMENTS
   =================================================================== */
.cw-todos-grid { display: grid; gap: 14px; }
.cw-todos-grid--form { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cw-todos-grid--4 { grid-template-columns: repeat(4, 1fr); }

.cw-todos-field { display: flex; flex-direction: column; gap: 4px; }
.cw-todos-field--full { grid-column: 1 / -1; }

.cw-todos-label {
    font-weight: 600;
    font-size: .82rem;
    color: var(--c-text2);
}

.cw-todos-input {
    padding: 9px 12px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .92rem;
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-white);
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}
.cw-todos-input:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,111,160,.1);
}
.cw-todos-input--sm { padding: 7px 10px; font-size: .88rem; }
textarea.cw-todos-input { resize: vertical; min-height: 44px; }

.cw-todos-sub {
    font-size: .95rem;
    font-weight: 700;
    color: var(--c-text2);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-border);
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.cw-todos-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.cw-todos-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all .2s var(--ease);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    white-space: nowrap;
}
.cw-todos-btn svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
.cw-todos-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.cw-todos-btn:active { transform: translateY(0); }

.cw-todos-btn--primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-d));
    color: white;
}
.cw-todos-btn--green {
    background: linear-gradient(135deg, var(--c-green), #047857);
    color: white;
}
.cw-todos-btn--red {
    background: linear-gradient(135deg, var(--c-red), #b91c1c);
    color: white;
}
.cw-todos-btn--ghost {
    background: var(--c-white);
    color: var(--c-text2);
    border: 2px solid var(--c-border);
    box-shadow: none;
}
.cw-todos-btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* Toolbar Buttons - gleiche Breite */
.cw-todos-btn--tool {
    min-width: 100px;
    justify-content: center;
    background: var(--c-white);
    color: var(--c-text2);
    border: 2px solid var(--c-border);
    box-shadow: none;
    padding: 7px 14px;
    font-size: .85rem;
}
.cw-todos-btn--tool:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    transform: none;
}
.cw-todos-btn--active {
    background: var(--c-primary) !important;
    color: white !important;
    border-color: var(--c-primary) !important;
}
.cw-todos-btn--green.cw-todos-btn--tool {
    background: var(--c-green);
    color: white;
    border-color: var(--c-green);
}

.cw-todos-btn--xs {
    padding: 4px 8px; font-size: .8rem; box-shadow: none;
}
.cw-todos-btn--xs svg { width: 14px; height: 14px; }

/* Inline-Edit-Button fuer Dateibeschreibung */
.cw-todos-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    transition: all .2s;
}
.cw-todos-btn-inline svg {
    stroke: var(--c-text3);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cw-todos-btn-inline:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-l);
}
.cw-todos-btn-inline:hover svg { stroke: var(--c-primary); }

/* ===================================================================
   TOOLBAR
   =================================================================== */
.cw-todos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}
.cw-todos-toolbar__filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    flex: 1;
    max-width: 700px;
}
.cw-todos-toolbar__btns {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}
.cw-todos-filter { display: flex; flex-direction: column; gap: 3px; }
.cw-todos-filter__label {
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-text3);
}

/* ===================================================================
   TABLES - FIX: mehr Padding links in Spaltenkoepfen + Zellen
   =================================================================== */
.cw-todos-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}
.cw-todos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.cw-todos-table th {
    background: #334155;
    color: white;
    padding: 12px 14px 12px 22px;
    text-align: left;
    font-weight: 600;
    font-size: .82rem;
    white-space: nowrap;
    user-select: none;
}
.cw-todos-table th:first-child { padding-left: 28px; }
.cw-todos-table td {
    padding: 10px 14px 10px 22px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
    color: var(--c-text);
}
.cw-todos-table td:first-child { padding-left: 28px; }
.cw-todos-table tbody tr:hover { background: #f0f7ff; }
.cw-todos-table--sm th,
.cw-todos-table--sm td { padding: 8px 12px 8px 22px; }
.cw-todos-table--sm th:first-child,
.cw-todos-table--sm td:first-child { padding-left: 28px; }

/* Sort headers - FIX: Hover mit weisser Schrift */
.cw-todos-th--sort {
    cursor: pointer;
    position: relative;
    transition: background .15s;
}
.cw-todos-th--sort svg {
    display: inline-block;
    vertical-align: middle;
    width: 14px; height: 14px;
    fill: rgba(255,255,255,.5);
    margin-left: 3px;
    transition: all .2s;
}
.cw-todos-th--sort:hover {
    background: #475569;
    color: #ffffff;
}
.cw-todos-th--sort:hover svg { fill: #ffffff; }
.cw-todos-th--sort.cw-todos-sort-asc svg { fill: #ffffff; transform: rotate(180deg); }
.cw-todos-th--sort.cw-todos-sort-desc svg { fill: #ffffff; }

/* Zeilen-Status */
.cw-todos-row--done { opacity: .5; background: #f9fafb; }
.cw-todos-row--overdue td:nth-child(4) { color: var(--c-red); font-weight: 700; }

.cw-todos-info {
    padding: 8px 14px;
    font-size: .82rem;
    color: var(--c-text3);
}

/* ===================================================================
   BADGES - FIX: Weisse Schrift auf allen farbigen Badges
   =================================================================== */
.cw-todos-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    color: white;
}
.cw-todos-badge--hoch    { background: var(--c-red); }
.cw-todos-badge--mittel  { background: var(--c-yellow); color: #1e293b; }
.cw-todos-badge--niedrig { background: var(--c-green); }

.cw-todos-badge--backlog       { background: #94a3b8; }
.cw-todos-badge--in-planung    { background: #3b82f6; }
.cw-todos-badge--in-umsetzung  { background: #8b5cf6; }
.cw-todos-badge--on-hold       { background: var(--c-orange); }
.cw-todos-badge--erledigt      { background: var(--c-green); }

/* Table action buttons */
.cw-todos-act { display: flex; gap: 4px; flex-wrap: nowrap; }

/* ===================================================================
   KANBAN - FIX: Karten-Text und Badge-Kontraste
   =================================================================== */
.cw-todos-kanban {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    padding: 16px;
}
.cw-todos-kanban__col {
    background: var(--c-white);
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    padding: 12px;
    min-height: 180px;
    transition: border-color .2s, background .2s;
}
.cw-todos-kanban__col--over {
    border-color: var(--c-primary);
    background: rgba(26,111,160,.03);
}
.cw-todos-kanban__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--c-border);
    font-weight: 700;
    font-size: .9rem;
    color: var(--c-text2);
}
.cw-todos-kanban__cnt {
    background: var(--c-primary);
    color: white;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .78rem;
}
.cw-todos-kanban__cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

/* Kanban Card - FIX: schwarze Schrift fuer Titel, dunkle Schrift fuer Meta */
.cw-todos-kcard {
    background: var(--c-white);
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: grab;
    transition: all .2s var(--ease);
    font-size: .85rem;
}
.cw-todos-kcard:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
    border-color: var(--c-primary);
    transform: translateY(-1px);
}
.cw-todos-kcard--drag { opacity: .4; transform: rotate(2deg); }

.cw-todos-kcard__title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.3;
}

.cw-todos-kcard__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-bottom: 6px;
}

.cw-todos-kcard__detail {
    font-size: .8rem;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.cw-todos-kcard__detail svg {
    width: 13px; height: 13px;
    stroke: #475569;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cw-todos-kcard__overdue {
    color: var(--c-red) !important;
    font-weight: 600;
}
.cw-todos-kcard__overdue svg { stroke: var(--c-red) !important; }

.cw-todos-kcard__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ===================================================================
   FILE BROWSER
   =================================================================== */
.cw-todos-filebrowser__toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--c-border);
}

/* File icons */
.cw-todos-ficon {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.cw-todos-ficon svg { width: 18px; height: 18px; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.cw-todos-ficon--pdf  { background: #fef2f2; } .cw-todos-ficon--pdf svg  { stroke: #dc2626; }
.cw-todos-ficon--doc  { background: #eff6ff; } .cw-todos-ficon--doc svg  { stroke: #2563eb; }
.cw-todos-ficon--xls  { background: #ecfdf5; } .cw-todos-ficon--xls svg  { stroke: #059669; }
.cw-todos-ficon--ppt  { background: #fef3c7; } .cw-todos-ficon--ppt svg  { stroke: #d97706; }
.cw-todos-ficon--img  { background: #faf5ff; } .cw-todos-ficon--img svg  { stroke: #7c3aed; }
.cw-todos-ficon--zip  { background: #f1f5f9; } .cw-todos-ficon--zip svg  { stroke: #475569; }
.cw-todos-ficon--file { background: #f1f5f9; } .cw-todos-ficon--file svg { stroke: #64748b; }

.cw-todos-table .cw-todos-flink {
    color: var(--c-primary);
    text-decoration: none;
    font-weight: 600;
}
.cw-todos-flink:hover { text-decoration: underline; }

.cw-todos-fdesc { font-size: .82rem; color: var(--c-text2); }
.cw-todos-fdesc-cell { max-width: 280px; }

.cw-todos-ffolder {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    color: var(--c-text2);
    background: var(--c-bg);
    padding: 2px 8px;
    border-radius: 4px;
}
.cw-todos-ffolder svg {
    width: 13px; height: 13px;
    stroke: var(--c-text3); fill: none;
    stroke-width: 2;
}

/* ===================================================================
   MODALS
   =================================================================== */
.cw-todos-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cw-todos-modal {
    background: var(--c-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 660px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.cw-todos-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 2px solid var(--c-border);
    background: var(--c-bg);
    border-radius: 16px 16px 0 0;
}
.cw-todos-modal__head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-text);
    margin: 0;
}
.cw-todos-modal__close {
    background: none; border: none; cursor: pointer; padding: 4px; border-radius: 6px;
    transition: background .2s;
}
.cw-todos-modal__close svg { width: 20px; height: 20px; stroke: var(--c-text3); fill: none; stroke-width: 2; stroke-linecap: round; }
.cw-todos-modal__close:hover { background: var(--c-border); }
.cw-todos-modal__body { padding: 20px 24px; }
.cw-todos-modal__foot {
    padding: 14px 24px;
    border-top: 2px solid var(--c-border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===================================================================
   MESSAGES
   =================================================================== */
.cw-todos-msg {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 16px;
}
.cw-todos-msg--ok  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.cw-todos-msg--err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.cw-todos-msg--info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ===================================================================
   LOADING
   =================================================================== */
.cw-todos-loading {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.8);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: .95rem;
    color: var(--c-text2);
}
.cw-todos-loading--show { display: flex; }
.cw-todos-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: cw-todos-spin .7s linear infinite;
}
@keyframes cw-todos-spin { to { transform: rotate(360deg); } }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1200px) {
    .cw-todos-kanban { grid-template-columns: repeat(3, 1fr); }
    .cw-todos-toolbar__filters { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
}

@media (max-width: 768px) {
    .cw-todos-header__inner { padding: 20px 16px; }
    .cw-todos-header__title { font-size: 1.25rem; }
    .cw-todos-tabs { padding: 0 12px; }
    .cw-todos-tabs__btn { padding: 12px 14px; font-size: .88rem; }
    .cw-todos-panel { padding: 14px 10px 24px; }

    .cw-todos-grid--form { grid-template-columns: 1fr; }
    .cw-todos-grid--4 { grid-template-columns: 1fr 1fr; }

    .cw-todos-toolbar { flex-direction: column; align-items: stretch; }
    .cw-todos-toolbar__filters { grid-template-columns: 1fr 1fr; }
    .cw-todos-toolbar__btns { display: grid; grid-template-columns: repeat(3, 1fr); }
    .cw-todos-btn--tool { min-width: 0; }

    .cw-todos-kanban { grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }

    .cw-todos-table { font-size: .82rem; }
    .cw-todos-table th, .cw-todos-table td { padding: 8px 10px 8px 14px; }

    .cw-todos-modal { max-width: 100%; margin: 10px; }
}

@media (max-width: 480px) {
    .cw-todos-header__inner { padding: 16px 12px; }
    .cw-todos-header__title { font-size: 1.1rem; }
    .cw-todos-header__badge { display: none; }
    .cw-todos-tabs { padding: 0 8px; }
    .cw-todos-tabs__btn { padding: 10px 10px; font-size: .82rem; gap: 5px; }
    .cw-todos-panel { padding: 10px 8px 20px; }
    .cw-todos-toolbar__filters { grid-template-columns: 1fr; }
    .cw-todos-toolbar__btns { grid-template-columns: 1fr; }
    .cw-todos-grid--4 { grid-template-columns: 1fr; }

    .cw-todos-kanban { grid-template-columns: 1fr; }

    .cw-todos-table th, .cw-todos-table td { padding: 6px 8px 6px 12px; font-size: .78rem; }
}

/* ===================================================================
   DROPZONE + UPLOAD-QUEUE (v2.3)
   =================================================================== */
.cw-todos-dropzone {
    border: 2px dashed var(--c-border);
    border-radius: var(--radius-sm);
    padding: 32px 20px;
    text-align: center;
    background: #f8fafc;
    transition: border-color .2s, background .2s;
    cursor: default;
}
.cw-todos-dropzone--over {
    border-color: var(--c-primary);
    background: var(--c-primary-l);
}
.cw-todos-file-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: .85rem;
    gap: 8px;
}
.cw-todos-upload-progress {
    font-size: .85rem;
    color: var(--c-text2);
    margin-bottom: 6px;
}
.cw-todos-upload-bar {
    height: 6px;
    background: var(--c-border);
    border-radius: 99px;
    overflow: hidden;
}
.cw-todos-upload-bar__fill {
    height: 100%;
    background: var(--c-primary);
    transition: width .3s var(--ease);
    border-radius: 99px;
}

/* ===================================================================
   SPEICHER-BADGE IM HEADER (cw-todos-quota)
   =================================================================== */
.cw-todos-quota {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    font-family: inherit;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: white;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    line-height: 1;
}
.cw-todos-quota--ok       { background: rgba(5,150,105,.25);  border-color: rgba(5,150,105,.5); }
.cw-todos-quota--warn     { background: rgba(234,179,8,.3);   border-color: rgba(234,179,8,.6); }
.cw-todos-quota--critical { background: rgba(220,38,38,.35);  border-color: rgba(220,38,38,.7); }

.cw-todos-header__meta {
    position: relative;
    z-index: 1;
}

/* ===================================================================
   MANDANTEN-HINWEIS (ohne Mandanten-Zuordnung)
   =================================================================== */
.cw-todos-notice {
    font-size: .95rem;
    color: var(--c-text);
}
.cw-todos-notice--warn {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}
