/* ============================================================
   Avison Studios Dashboard — Rahmen und Sonderseiten: Handy-Feinschliff, Footer, Login,
   Dialoge, CI-Widget, Transfer
   Teil 5 von 6. Die Reihenfolge der <link>-Tags in index.html
   muss so bleiben, wie sie ist: in CSS gewinnt die spätere Regel.

   Das Gerüst (Seitenleiste, Bottom-Bar am Handy, Timer-Pill) und die
   Monatsansicht des Kalenders liegen in basis.css bzw. dashboard.css.
   ============================================================ */

/* ============ Mobile-Feinschliff (Handy/Tablet) ============ */
/* Auf Touch-Geräten gibt es kein Hover: Bedienelemente immer zeigen */
@media (hover: none) {
    .widget-controls { opacity: 0.85; }
    .prompter:not(.paused) .prompter-hud { opacity: 0.45; }
}

@media (max-width: 720px) {
    /* Unten Platz für die Bottom-Navigation lassen; Seitenränder regelt basis.css */
    .page { padding-top: 4px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .card { padding: 16px 14px; }
    .bento { gap: 14px; }
    .day-hero, .view-head { padding: 12px 2px 14px; }
    .day-title { font-size: clamp(26px, 8vw, 34px); }
    .day-sub { font-size: 13px; }
    /* Kuratierter: erklärende Nebentexte verschwinden am Handy */
    .alerts-sub { display: none; }
    .todo-legend { display: none; }
    .card-todos .todo-list { column-width: auto; column-count: auto; }
    .todo { flex-wrap: wrap; row-gap: 4px; }
    .todo-client { margin-left: 0; }
    .calendar-embed iframe { height: 380px; }
    .panel-actions { justify-content: flex-start; }
    .alert-row { flex-wrap: wrap; }
    .alert-text { flex-basis: 100%; order: 3; }
    .footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* ============ Footer ============ */
.footer {
    background: none;
    border: none;
    color: var(--ink-3);
    text-align: center;
    padding: 28px;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0;
}
.footer em { font-style: normal; color: var(--orange); }

/* ============ Dialoge ============ */
dialog {
    font-family: var(--font-display);
    background: var(--surface);
    color: var(--ink);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 26px;
    width: min(580px, 92vw);
}
dialog::backdrop { background: rgba(35,36,37,0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog h2 {
    margin-top: 0;
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.005em;
}
dialog h3 {
    margin: 20px 0 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}
dialog label { display: block; margin: 14px 0 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
dialog label input { margin-top: 6px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dlg-actions.space-between { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.dlg-actions.space-between > div { display: flex; gap: 10px; }

/* ---- To-do-Detailansicht ---- */
dialog.dlg-wide { width: min(720px, 94vw); }
.todo-dlg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.todo-dlg-check {
    width: 30px; height: 30px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface-2);
    cursor: pointer;
    flex-shrink: 0;
    display: grid;
    place-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #FFF6EC;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}
.todo-dlg-check:hover { border-color: var(--moss); }
.todo-dlg-check.on { background: var(--moss); border-color: var(--moss); }
.todo-dlg-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 4px 0;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 0;
    width: 100%;
}
.todo-dlg-title:focus { outline: none; box-shadow: none; background: transparent; border-bottom-color: var(--orange); }
.todo-dlg-title.struck { text-decoration: line-through; color: var(--ink-2); }
.todo-dlg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; }
.todo-dlg-grid label { margin: 0; }
.td-star-field { display: flex; flex-direction: column; min-width: 0; }
.td-star-field input { width: 100%; margin-top: 6px; }
.td-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.td-quick .link-btn { font-size: 12px; }
@media (max-width: 620px) { .todo-dlg-grid { grid-template-columns: repeat(2, 1fr); } }
dialog textarea {
    margin-top: 6px;
    resize: vertical;
    line-height: 1.5;
    font-size: 14px;
}

/* Anhänge */
.dropzone {
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 8px;
    background: var(--surface-2);
    transition: border-color 0.15s, background 0.15s;
}
.dropzone.over { border-color: var(--orange); background: var(--tone-orange); }
.dropzone-hint {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0;
    color: var(--ink-2);
    margin: 0;
    text-align: center;
}
.file-list:not(:empty) { margin-bottom: 10px; }
.file-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.file-row:last-child { border-bottom: none; }
.file-icon { font-size: 16px; flex-shrink: 0; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.link-btn {
    background: none;
    border: none;
    color: var(--orange);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}
.todo-text { cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.todo-text:hover { color: var(--orange); }
.detail-dot { font-size: 11px; margin-left: 7px; opacity: 0.65; }

/* ---- Kunden-Editor ---- */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 0;
}
.swatch:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.swatch.active { outline: 3px solid var(--powder); outline-offset: 2px; }
.color-free { display: flex; align-items: center; gap: 10px; }
input[type=color] {
    width: 54px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: var(--surface-2);
    padding: 3px;
    cursor: pointer;
}
.logo-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.logo-preview {
    width: 78px;
    height: 78px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    display: grid;
    place-content: center;
    background: var(--surface-2);
    overflow: hidden;
    text-align: center;
    flex-shrink: 0;
}
.logo-preview img { max-width: 68px; max-height: 68px; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Posting-Tage im Kunden-Editor */
.day-toggles { display: flex; gap: 7px; flex-wrap: wrap; margin: 8px 0 10px; }
.day-toggle {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    width: 42px;
    padding: 8px 0;
    border: none;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.day-toggle:hover { background: var(--tone-almond); color: var(--ink); }
.day-toggle.active {
    background: var(--tone-moss);
    color: var(--tone-moss-ink);
    box-shadow: none;
}

/* Zwei Felder nebeneinander im Dialog */
.field-row { display: flex; gap: 14px; }
.field-row label { flex: 1; }

/* ---- Backup ---- */
.backup-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ Login ============ */
/* Die Anmeldeseite hat ihr eigenes Aussehen: assets/intro.css */

/* ============ Micro-Animationen ============
   Bereiche gleiten beim Umschalten herein, Karten folgen leicht versetzt.
   Alles kurz (< 0,5 s) und mit Feder-Kurven – Feedback, keine Show. */
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
.view:not([hidden]) { animation: rise-in 0.32s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
.bento > .card { animation: rise-in 0.45s cubic-bezier(0.22, 0.9, 0.3, 1) backwards; }
.bento > .card:nth-child(2) { animation-delay: 0.06s; }
.bento > .card:nth-child(3) { animation-delay: 0.12s; }
.bento > .card:nth-child(4) { animation-delay: 0.18s; }
.bento > .card:nth-child(5) { animation-delay: 0.24s; }
.tool-launcher .tool-launch { animation: rise-in 0.4s cubic-bezier(0.22, 0.9, 0.3, 1) backwards; }
.tool-launcher .tool-launch:nth-child(2) { animation-delay: 0.05s; }
.tool-launcher .tool-launch:nth-child(3) { animation-delay: 0.1s; }
.tool-launcher .tool-launch:nth-child(4) { animation-delay: 0.15s; }
.tool-launcher .tool-launch:nth-child(5) { animation-delay: 0.2s; }
.tool-launcher .tool-launch:nth-child(n+6) { animation-delay: 0.25s; }

/* Tool-Fenster & Dialoge ploppen sanft auf */
@keyframes modal-pop { from { opacity: 0; transform: scale(0.97) translateY(10px); } }
@keyframes fade-in { from { opacity: 0; } }
.tool-modal-card { animation: modal-pop 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }
.tool-modal-backdrop { animation: fade-in 0.2s both; }
dialog[open] { animation: modal-pop 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
dialog::backdrop { animation: fade-in 0.2s; }

/* Abhaken: der eben geklickte Haken springt kurz (Klasse setzt app.js) */
@keyframes check-pop { 40% { transform: scale(1.35); } }
.todo input[type=checkbox].pop { animation: check-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Werkzeug-Icons heben sich beim Drüberfahren leicht */
@keyframes icon-lift { 50% { transform: translateY(-2px) scale(1.06); } }
.tool-launch:hover .tool-launch-icon { animation: icon-lift 0.4s ease-out; }

/* Sync-Punkt atmet, solange alles synchron ist */
@keyframes sync-pulse { 50% { opacity: 0.35; } }
.sync-status.ok::before { animation: sync-pulse 3s ease-in-out infinite; }

/* Wer weniger Bewegung will, bekommt sie auch nicht */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    #ambientFx { display: none; }
}

/* ============ CI-Widget (Corporate Identity) ============ */
.ci-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ci-chip {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ci-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.ci-chip.copied, .ci-code.copied { outline: 2px solid var(--moss); outline-offset: 2px; }
.ci-sections.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.ci-sections.cols .ci-sec:first-child { grid-row: span 2; }
.ci-sec { margin-bottom: 14px; min-width: 0; }
.ci-color {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.ci-color:last-of-type { border-bottom: none; }
.ci-color .ci-chip { width: 30px; height: 30px; }
.ci-color-info { flex: 1; min-width: 0; }
.ci-color-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ci-purpose { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.ci-codes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.ci-code {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    background: var(--surface-2);
    border: none;
    border-radius: var(--r-pill);
    padding: 3px 9px;
    cursor: pointer;
    color: var(--ink-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transition: background 0.15s, color 0.15s;
}
.ci-code:hover { background: var(--tone-almond); color: var(--ink); }
.ci-color-actions { display: flex; gap: 2px; flex-shrink: 0; }
/* Datei-Galerie: Vorschau-Kacheln mit Download-Knopf unten links im Bild */
.ci-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
}
.ci-file-tile { margin: 0; min-width: 0; }
.ci-file-frame { position: relative; }
.ci-file-preview {
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-content: center;
    /* Schachbrett: macht Transparenz von SVGs/PNGs sichtbar */
    background: repeating-conic-gradient(#f1ece2 0% 25%, #ffffff 0% 50%) 0 0 / 16px 16px;
}
.ci-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 8px;
    box-sizing: border-box;
}
.ci-file-preview .file-icon { font-size: 32px; }
.ci-file-dl {
    position: absolute;
    left: 6px;
    bottom: 6px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--charcoal);
    color: var(--almond);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s, background 0.15s;
}
.ci-file-dl:hover { background: var(--orange); color: #FFF6EC; }
.ci-file-dl:active { transform: translateY(1px); }
.ci-file-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(var(--ink-rgb), 0.55);
    color: var(--almond);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.35;
    transition: opacity 0.15s, background 0.15s;
}
.ci-file-tile:hover .ci-file-del, .ci-file-del:focus-visible { opacity: 1; }
.ci-file-del:hover { background: var(--danger); }
@media (hover: none) { .ci-file-del { opacity: 0.7; } }
.ci-file-name {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-2);
}

.ci-notes {
    width: 100%;
    font-size: 14px;
    resize: vertical;
    line-height: 1.5;
}
.ci-hex-input {
    width: 140px !important;
    font-family: var(--font-display);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
    .ci-sections.cols { grid-template-columns: 1fr; }
}

/* ============ Transfer (Dateien-Schleuse) ============ */
.tr-progress { margin: 12px 0 4px; }
.tr-progress-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.tr-prog-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-prog-pct { font-family: var(--font-display); font-size: 13px; color: var(--ink-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tr-list { margin-top: 12px; }
.tr-list .file-row .btn { flex-shrink: 0; }
.tr-list .file-row { flex-wrap: wrap; }

/* Verlorene CI-Dateien zurückholen */
.ci-orphan-hint { margin: 8px 0 0; font-size: 12px; }
.ci-orphans { margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.ci-orphans > p { margin: 0 0 8px; }
.ci-orphan-take { width: 100%; margin-top: 4px; padding-top: 3px; padding-bottom: 3px; }
