﻿/* ============================================================
   Personel Performance (App) â€” "Aria" Light Professional
   2026 Â· v3
   ============================================================ */

:root {
    --bg0: #e3eaf3;
    --bg1: #d9e2ec;

    --surface:  #ffffff;
    --surface2: #f8fafc;
    --surface3: #f1f5f9;

    --text:   #0f172a;
    --muted:  #64748b;
    --muted2: #94a3b8;

    --stroke:  rgba(15,23,42,.10);
    --stroke2: rgba(15,23,42,.07);

    --accent:      #6366f1;
    --accent-dark: #4f46e5;
    --accent2:     #0ea5e9;
    --accent3:     #10b981;

    --ok:     #16a34a;
    --warn:   #d97706;
    --danger: #dc2626;

    --brand: var(--accent);

    --r-xl: 24px;
    --r-lg: 20px;
    --r:    16px;
    --r-sm: 12px;
    --r-xs:  8px;

    --shadow-xs: 0 1px 4px rgba(15,23,42,.07);
    --shadow-sm: 0 2px 10px rgba(15,23,42,.08);
    --shadow:    0 8px 28px rgba(15,23,42,.10);
    --shadow-lg: 0 20px 64px rgba(15,23,42,.14);
    --shadow-accent: 0 8px 24px rgba(99,102,241,.22);
}

/* ============================================================
   BASE
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    position: relative;
    isolation: isolate;
    background: var(--bg0);
    background-image:
        radial-gradient(ellipse 900px 500px at 5% -8%,  rgba(99,102,241,.07), transparent 55%),
        radial-gradient(ellipse 700px 400px at 95% -5%, rgba(14,165,233,.06), transparent 50%),
        radial-gradient(ellipse 900px 520px at -10% 45%, rgba(99,102,241,.06), transparent 55%),
        radial-gradient(ellipse 900px 520px at 110% 55%, rgba(14,165,233,.055), transparent 55%);
    min-height: 100vh;
}

/* Not: Global layout'a dokunmuyoruz (Ä°ÅŸler sayfasÄ± bozulmasÄ±n).
   Mesajlar iÃ§-scroll dÃ¼zeni sadece #pageMessages altÄ±nda uygulanÄ±r. */

.rt-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(148,163,184,.65);
    border: 1px solid rgba(15,23,42,.16);
    box-shadow: 0 0 0 0 rgba(16,185,129,.0);
    flex: 0 0 auto;
}
.rt-dot.connecting {
    background: rgba(245,158,11,.8);
    border-color: rgba(245,158,11,.35);
}
.rt-dot.on {
    background: rgba(16,185,129,.95);
    border-color: rgba(16,185,129,.40);
    box-shadow: 0 0 0 4px rgba(16,185,129,.14);
}
.rt-dot.off {
    background: rgba(148,163,184,.70);
    border-color: rgba(148,163,184,.35);
}

/* Desktop: yan boÅŸluk hissini azaltan ambient arka plan katmanlarÄ± */
@media (min-width: 980px) {
    body::before,
    body::after {
        content: "";
        position: fixed;
        inset: -20%;
        pointer-events: none;
        z-index: -1;
    }

    /* BÃ¼yÃ¼k, yumuÅŸak glow'lar (kenarlara aÄŸÄ±rlÄ±k ver) */
    body::before {
        background:
            radial-gradient(ellipse 820px 520px at 12% 32%, rgba(99,102,241,.12), transparent 58%),
            radial-gradient(ellipse 860px 540px at 88% 38%, rgba(14,165,233,.11), transparent 60%),
            radial-gradient(ellipse 740px 520px at 50% 110%, rgba(245,158,11,.08), transparent 65%);
        filter: blur(18px);
        opacity: .9;
        transform: translateZ(0);
        animation: glowFloat 18s ease-in-out infinite;
    }

    /* Ä°nce doku: animasyonlu grid + diagonal sweep */
    body::after {
        background-image:
            linear-gradient(to right, rgba(14,165,233,.10) 2px, transparent 2px),
            linear-gradient(to bottom, rgba(99,102,241,.09) 2px, transparent 2px),
            repeating-linear-gradient(135deg, rgba(99,102,241,.08) 0 2px, transparent 2px 16px);
        background-size: 56px 56px, 56px 56px, 240px 240px;
        background-position: 0 0;
        opacity: .72;
        -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.90) 32%, rgba(0,0,0,.32) 60%, rgba(0,0,0,.12) 86%);
        mask-image: linear-gradient(135deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.90) 32%, rgba(0,0,0,.32) 60%, rgba(0,0,0,.12) 86%);
        -webkit-mask-size: 240% 240%;
        mask-size: 240% 240%;
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
        animation: gridSweep 16s linear infinite;
    }
}

@keyframes gridSweep {
    0%   { background-position: 0 0;   -webkit-mask-position: -20% -20%; mask-position: -20% -20%; opacity: .55; }
    45%  { opacity: .70; }
    100% { background-position: 340px 340px; -webkit-mask-position: 120% 120%; mask-position: 120% 120%; opacity: .55; }
}

@keyframes glowFloat {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(1.5%, -1%, 0); }
    100% { transform: translate3d(-1%, 1.2%, 0); }
}

:focus-visible {
    outline: 2px solid rgba(99,102,241,.50);
    outline-offset: 2px;
    border-radius: 4px;
}

.app-shell {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 20px 16px 80px;
    position: relative;
}

.hidden { display: none !important; }
.page   { display: none; }
.page.active { display: block; animation: fadeUp .22s ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.field { margin-bottom: 14px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--muted);
}

.input, .select, .textarea {
    width: 100%;
    border: 1px solid var(--stroke);
    border-radius: var(--r-sm);
    background: var(--surface);
    padding: 11px 13px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: var(--shadow-xs);
}

.input::placeholder, .textarea::placeholder { color: var(--muted2); }

.input:focus, .select:focus, .textarea:focus {
    border-color: rgba(99,102,241,.45);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.btn {
    border: 0;
    border-radius: var(--r-sm);
    padding: 12px 18px;
    font-weight: 700;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 6px 20px rgba(99,102,241,.25);
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 28px rgba(99,102,241,.32);
    transform: translateY(-1px);
}

.btn-soft {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-xs);
}

.btn-soft:hover { background: var(--surface2); }

.btn-danger-soft {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.btn-danger-soft:hover { background: #fee2e2; }

.row { display: flex; align-items: center; gap: 10px; }

/* Ä°ÅŸ Ata: Ã–ncelik + Konum satÄ±rÄ±nda Konum alanÄ± tam geniÅŸlikte uzasÄ±n */
.row-assign-meta { align-items: flex-end; }
.row-assign-meta > .field { margin-bottom: 0; min-width: 0; }
.row-assign-meta > .field:first-child { flex: 0 0 170px; }
.row-assign-meta > .field:last-child { flex: 1 1 auto; }

@media (max-width: 520px) {
    .row-assign-meta { flex-direction: column; align-items: stretch; }
    .row-assign-meta > .field:first-child { flex: 1 1 auto; width: 100%; }
}

/* Ä°ÅŸ Ata: Kabul/Tamamlama hedefleri satÄ±rÄ± iki eÅŸit kolon */
.row-assign-targets { align-items: flex-end; }
.row-assign-targets > .field { margin-bottom: 0; min-width: 0; flex: 1 1 0; }

@media (max-width: 520px) {
    .row-assign-targets { flex-direction: column; align-items: stretch; }
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 5px;
    border: 2px solid var(--surface);
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: fixed;
    inset: 0;
    overflow: auto;
    isolation: isolate;
    background:
        radial-gradient(ellipse 900px 700px at 15% -10%, rgba(99,102,241,.09), transparent 60%),
        radial-gradient(ellipse 700px 500px at 90% -5%,  rgba(14,165,233,.07), transparent 55%),
        #f1f5f9;
}

/* Login arka plan: animasyonlu, sol-Ã¼stten saÄŸ-alta akÄ±yormuÅŸ gibi duran kareli doku */
.login::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(14,165,233,.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99,102,241,.085) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: 0 0;
    opacity: .44;
    -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.90) 32%, rgba(0,0,0,.28) 60%, rgba(0,0,0,.12) 86%);
    mask-image: linear-gradient(135deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.90) 32%, rgba(0,0,0,.28) 60%, rgba(0,0,0,.12) 86%);
    -webkit-mask-size: 240% 240%;
    mask-size: 240% 240%;
    -webkit-mask-position: 0% 0%;
    mask-position: 0% 0%;
    animation: gridSweep 14s linear infinite;
}

.login-card {
    width: min(440px, 100%);
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-lg);
    padding: 36px 30px;
    position: relative;
    overflow: hidden;
}

/* login-card'a hafif premium hissi veren Ã¼st glow/Ã§izgi */
.login-card::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 14px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(99,102,241,.9), rgba(14,165,233,.9));
    opacity: .75;
}

.brand-badge {
    width: min(340px, 100%);
    height: 92px;
    margin: 0 auto 18px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse 340px 120px at 20% 30%, rgba(99,102,241,.18), transparent 60%),
        radial-gradient(ellipse 320px 120px at 85% 25%, rgba(14,165,233,.16), transparent 62%),
        rgba(255,255,255,.75);
    border: 1px solid rgba(99,102,241,.18);
    box-shadow: 0 18px 48px rgba(15,23,42,.10);
}

.brand-logo {
    width: min(300px, 100%);
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(15,23,42,.18));
}

.title {
    margin: 0;
    text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -.5px;
    color: var(--text);
}

.subtitle {
    margin: 8px 0 28px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.error {
    border: 1px solid #fecaca;
    color: #b91c1c;
    background: #fef2f2;
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

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

.header {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 14px;
    z-index: 10;
    margin-bottom: 14px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

/* Dark pill for hotel name â€” distinctive within light header */
.hotel-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    background: #1e293b;
    border: 1px solid #334155;
    color: rgba(255,255,255,.90);
    max-width: 300px;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(15,23,42,.18);
}

.hotel-logo {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.hotel-pill svg { color: rgba(255,255,255,.55); flex-shrink: 0; }

.header-hotel-name {
    font-weight: 700;
    font-size: 13.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -.1px;
}

.hotel-pill .header-hotel-name { color: rgba(255,255,255,.92); }

.header-welcome {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    padding-left: 2px;
}

.header-nav {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--stroke2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-pill {
    border: 1px solid var(--stroke);
    background: var(--surface2);
    color: var(--muted);
    border-radius: 999px;
    padding: 9px 12px;
    font-weight: 800;
    font-size: 12.5px;
    letter-spacing: -.2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .14s, border-color .14s, transform .12s, color .14s;
    box-shadow: var(--shadow-xs);
}

.nav-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(99,102,241,.35);
    background: #f5f3ff;
    color: var(--accent);
}

.nav-pill.active {
    background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(14,165,233,.14));
    border-color: rgba(99,102,241,.28);
    color: var(--text);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke);
    background: var(--surface);
    display: grid;
    place-items: center;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition: transform .12s, border-color .14s, background .14s, color .14s;
    box-shadow: var(--shadow-xs);
}

.icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(99,102,241,.35);
    background: #f5f3ff;
    color: var(--accent);
}

.profile-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    color: #fff;
    font-weight: 900;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99,102,241,.28);
    transition: transform .12s, box-shadow .12s;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.profile-avatar-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 8px 20px rgba(99,102,241,.36);
}

/* ============================================================
   CONTENT + BOARD
   ============================================================ */

.content { padding: 0; }

.board {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.3px;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text);
    line-height: 1.2;
}

.section-subtitle {
    font-size: 11.5px;
    color: var(--muted2);
    margin-top: 2px;
}

/* Right side of board-head */
.board-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 5px 4px 10px;
    border-radius: var(--r-sm);
    background: var(--surface2);
    border: 1px solid var(--stroke);
}

.filter-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--muted2);
    white-space: nowrap;
}

.filter-select {
    min-width: 140px;
    border-radius: var(--r-xs);
    padding: 6px 32px 6px 8px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    font-family: inherit;
    box-shadow: var(--shadow-xs);
}

/* Ä°ÅŸ Ata button â€” inline in board-head */
.fab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99,102,241,.24);
    transition: transform .12s, box-shadow .12s, filter .12s;
    white-space: nowrap;
}

.fab-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(99,102,241,.34);
    filter: brightness(1.04);
}

.fab-btn:active { transform: translateY(0); }

/* ============================================================
   KPI STRIP â€” COMPACT HORIZONTAL ROWS
   ============================================================ */

.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.kpi-item {
    border-radius: var(--r-sm);
    padding: 10px 13px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--stroke2);
    background: var(--surface2);
    transition: transform .12s, box-shadow .12s;
    cursor: default;
}

.kpi-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Icon box */
.kpi-icon {
    order: 1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* Label */
.kpi-item small {
    order: 2;
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Number */
.kpi-item strong {
    order: 3;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.5px;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

/* Variants */
.kpi-item.kpi-total   { background: linear-gradient(135deg,#f5f3ff,#ede9fe); border-color: #ddd6fe; }
.kpi-item.kpi-total strong   { color: var(--accent); }
.kpi-item.kpi-total .kpi-icon { color: var(--accent); }

.kpi-item.kpi-assigned { background: linear-gradient(135deg,#fffbeb,#fef3c7); border-color: #fde68a; }
.kpi-item.kpi-assigned strong   { color: #b45309; }
.kpi-item.kpi-assigned .kpi-icon { color: #d97706; }

.kpi-item.kpi-progress { background: linear-gradient(135deg,#eff6ff,#dbeafe); border-color: #bfdbfe; }
.kpi-item.kpi-progress strong   { color: #1d4ed8; }
.kpi-item.kpi-progress .kpi-icon { color: #3b82f6; }

.kpi-item.kpi-done { background: linear-gradient(135deg,#f0fdf4,#dcfce7); border-color: #bbf7d0; }
.kpi-item.kpi-done strong   { color: #15803d; }
.kpi-item.kpi-done .kpi-icon { color: #16a34a; }

/* ============================================================
   TASK LIST
   ============================================================ */

.task-list {
    display: grid;
    gap: 8px;
}

.task-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas: "main right" "footer footer";
    gap: 6px 12px;
    border: 1px solid var(--stroke2);
    border-radius: var(--r);
    padding: 13px 15px 11px 20px;
    background: var(--surface);
    position: relative;
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.task-row:hover {
    transform: translateY(-2px);
    border-color: rgba(99,102,241,.22);
    box-shadow: var(--shadow), 0 0 0 1px rgba(99,102,241,.08);
}

.task-row:active { transform: translateY(0); }

/* Priority stripe */
.task-row::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: var(--r) 0 0 var(--r);
}

.task-row.priority-urgent::before { background: linear-gradient(180deg,#ef4444,#dc2626); }
.task-row.priority-high::before   { background: linear-gradient(180deg,#f97316,#ea580c); }
.task-row.priority-medium::before { background: linear-gradient(180deg,#6366f1,#4f46e5); }
.task-row.priority-low::before    { background: linear-gradient(180deg,#94a3b8,#64748b); }

.prio-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.task-row.priority-urgent .prio-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.14); }
.task-row.priority-high .prio-dot   { background: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
.task-row.priority-medium .prio-dot { background: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.task-row.priority-low .prio-dot    { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.14); }



@keyframes newTaskBeacon {
    0%   { box-shadow: 0 0 0 0   rgba(245,158,11,.50), var(--shadow-xs); border-color: rgba(245,158,11,.60); }
    65%  { box-shadow: 0 0 0 8px rgba(245,158,11,.0),  var(--shadow-xs); border-color: rgba(245,158,11,.28); }
    100% { box-shadow: 0 0 0 0   rgba(245,158,11,.0),  var(--shadow-xs); border-color: rgba(245,158,11,.60); }
}

@keyframes newTaskStripe {
    0%, 100% { filter: brightness(1); }
    50%       { filter: brightness(1.5) saturate(1.3); }
}

@keyframes newTaskBadgeBlink {
    0%, 80%, 100% { opacity: 1; }
    90%            { opacity: .55; }
}

.task-row.task-new-assigned {
    background: linear-gradient(135deg, #fffef7 0%, #fffbeb 60%, #fff7ed 100%);
    border-color: rgba(245,158,11,.60);
    animation: newTaskBeacon 2.4s ease-out infinite;
}

.task-row.task-new-assigned::before {
    background: linear-gradient(180deg, #fbbf24, #d97706);
    animation: newTaskStripe 2.4s ease-in-out infinite;
}

.task-row.task-new-assigned::after {
    content: 'YENİ';
    position: absolute;
    bottom: 0; right: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .7px;
    padding: 4px 12px;
    border-radius: 10px 0 var(--r) 0;
    animation: newTaskBadgeBlink 2.4s ease-in-out infinite;
}

/* ── Status-based card design ───────────────────────────────── */

/* Devam Ediyor — elektrik mavi, canlı, badge */
@keyframes inProgressPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,.0); }
    50%       { box-shadow: 0 0 0 5px rgba(59,130,246,.28); }
}
@keyframes inProgressBadge {
    0%, 80%, 100% { opacity: 1; }
    90%            { opacity: .6; }
}
.task-row.status-in_progress {
    background: linear-gradient(110deg, #dbeafe 0%, #eff6ff 35%, var(--surface) 100%);
    border-color: rgba(59,130,246,.42);
    box-shadow: 0 3px 12px rgba(59,130,246,.15), inset 3px 0 0 #3b82f6;
}
.task-row.status-in_progress::before { background: linear-gradient(180deg,#60a5fa,#1d4ed8) !important; }
.task-row.status-in_progress::after {
    content: none;
    position: absolute;
    bottom: 0; right: 0;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .7px;
    padding: 4px 12px;
    border-radius: 10px 0 var(--r) 0;
    animation: inProgressBadge 2s ease-in-out infinite;
}
.task-row.status-in_progress .prio-dot {
    width: 9px; height: 9px;
    background: #3b82f6 !important;
    animation: inProgressPulse 1.8s ease-in-out infinite;
}
.task-row.status-in_progress:hover {
    border-color: rgba(59,130,246,.65);
    box-shadow: 0 6px 20px rgba(59,130,246,.22), inset 3px 0 0 #1d4ed8;
}

/* Tamamlandı — yeşil, başarılı */
.task-row.status-completed {
    background: linear-gradient(110deg, #dcfce7 0%, #f0fdf4 40%, var(--surface) 100%);
    border-color: rgba(16,185,129,.30);
    box-shadow: inset 3px 0 0 #10b981;
    opacity: .88;
}
.task-row.status-completed::before { background: linear-gradient(180deg,#34d399,#059669) !important; }
.task-row.status-completed::after {
    content: none;
    position: absolute;
    bottom: 0; right: 0;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .7px;
    padding: 4px 12px;
    border-radius: 10px 0 var(--r) 0;
}
.task-row.status-completed .task-title-text {
    text-decoration: line-through;
    color: var(--muted);
}

/* İptal Edildi — kırmızı tonları */
.task-row.status-cancelled {
    background: linear-gradient(110deg, #fee2e2 0%, #fff1f2 40%, var(--surface) 100%);
    border-color: rgba(239,68,68,.28);
    box-shadow: inset 3px 0 0 #ef4444;
    opacity: .80;
}
.task-row.status-cancelled::before { background: linear-gradient(180deg,#f87171,#dc2626) !important; }
.task-row.status-cancelled::after {
    content: none;
    position: absolute;
    bottom: 0; right: 0;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .7px;
    padding: 4px 12px;
    border-radius: 10px 0 var(--r) 0;
}
.task-row.status-cancelled .task-title-text {
    text-decoration: line-through;
    color: #ef4444;
    opacity: .75;
}

/* Yeni atama — badge ve animasyon korunur, task-new-assigned ezmeye devam eder */
.task-row.task-new-assigned,
.task-row.task-new-assigned.status-assigned { opacity: 1; filter: none; }

.task-main { grid-area: main; min-width: 0; }

.task-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.task-title-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-meta strong { color: var(--text); font-weight: 600; }

.task-row-right {
    grid-area: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.task-footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.task-footer-spacer { flex: 1 1 auto; }

/* Status pills */
.task-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.task-status.assigned    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.task-status.in_progress { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.task-status.completed   { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.task-status.cancelled   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.task-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2px;
    white-space: nowrap;
}
.task-status-inline::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .92;
}
.task-status-inline.assigned { color: #92400e; }
.task-status-inline.in_progress { color: #1d4ed8; }
.task-status-inline.completed { color: #15803d; }
.task-status-inline.cancelled { color: #b91c1c; }

/* Priority pills */
.task-priority {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.task-priority.urgent { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.task-priority.high   { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.task-priority.medium { background: #f5f3ff; color: #4338ca; border: 1px solid #ddd6fe; }
.task-priority.low    { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

.task-loc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--stroke2);
    padding: 3px 8px;
    border-radius: 999px;
}

.task-time { font-size: 11px; color: var(--muted2); }

.muted-center {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; }
.empty-state svg { opacity: .22; margin: 0 auto 14px; display: block; }

.empty-title {
    font-size: 15px;
    font-weight: 800;
    color: rgba(15,23,42,.55);
    margin-bottom: 5px;
    letter-spacing: -.2px;
    font-family: 'Space Grotesk', sans-serif;
}

.empty-sub { font-size: 12.5px; color: var(--muted2); }

.text-xs { font-size: 12px; }
.text-slate-400 { color: var(--muted2); }

/* ============================================================
   dark header + light scrollable body
   ============================================================ */

.sheet-backdrop, .dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.48);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 40;
    animation: fadeBackdrop .18s ease;
    backdrop-filter: blur(3px);
}

@keyframes fadeBackdrop { from { opacity: 0; } to { opacity: 1; } }

.dialog-backdrop { align-items: center; }

.sheet {
    width: min(720px, 100%);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-xl) var(--r-xl) var(--r) var(--r);
    box-shadow: var(--shadow-lg);
    animation: sheetIn .20s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 820px);
}

@keyframes sheetIn {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Dark header inside generic sheets */
.sheet > .header-row {
    background: #1e293b;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sheet > .header-row h3 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.2px;
    color: rgba(255,255,255,.92);
}

/* Icons + buttons inside dark header */
.sheet > .header-row .icon-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.60);
    box-shadow: none;
}

.sheet > .header-row .icon-btn:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.20);
    color: rgba(255,255,255,.90);
    transform: none;
}

.sheet > .header-row .btn-soft {
    background: rgba(255,255,255,.09);
    border-color: rgba(255,255,255,.14);
    color: rgba(255,255,255,.78);
    font-size: 12px;
    padding: 6px 12px;
    box-shadow: none;
}

.sheet > .header-row .btn-soft:hover { background: rgba(255,255,255,.15); }

/* Scrollable body of generic sheets */
.sheet > div:not(.header-row) {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: var(--stroke) transparent;
}

.sheet > div:not(.header-row)::-webkit-scrollbar { width: 5px; }
.sheet > div:not(.header-row)::-webkit-scrollbar-track { background: transparent; }
.sheet > div:not(.header-row)::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 999px; }

/* ---- Dialog ---- */
.dialog {
    width: min(460px, 92%);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: popIn .18s ease;
    overflow: hidden;
}

@keyframes popIn {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.dialog h3 {
    margin: 0 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.25px;
}

/* ---- Task Detail Sheet (special layout) ---- */

.task-detail-sheet {
    /* Override generic sheet flex layout */
    padding: 0;
}

/* Prevent generic body styles applying to task-detail-sheet's header */
.task-detail-sheet > div:not(.header-row):not(.task-sheet-header):not(.task-sheet-body) {
    padding: 0;
}

.task-sheet-header {
    background: #1e293b;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Subtle radial decorations in dark header */
.task-sheet-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.22), transparent 70%);
    pointer-events: none;
}

.task-sheet-priority-bar { height: 3px; }
.task-sheet-priority-bar.prio-low    { background: #64748b; }
.task-sheet-priority-bar.prio-medium { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.task-sheet-priority-bar.prio-high   { background: linear-gradient(90deg, #f97316, #fb923c); }
.task-sheet-priority-bar.prio-urgent { background: linear-gradient(90deg, #ef4444, #f87171); }

.task-sheet-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px 15px;
}

.task-sheet-title-wrap { min-width: 0; }

.task-sheet-title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.3px;
    font-family: 'Space Grotesk', sans-serif;
    color: rgba(255,255,255,.95);
    line-height: 1.3;
}

.task-sheet-meta {
    margin: 5px 0 0;
    color: rgba(255,255,255,.50);
    font-size: 12px;
    line-height: 1.45;
}

.task-sheet-close {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.55);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .12s, background .12s, color .12s;
    flex-shrink: 0;
}

.task-sheet-close:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.14);
    color: rgba(255,255,255,.90);
}

.task-sheet-body {
    flex: 1;
    padding: 16px 20px 22px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--stroke) transparent;
}

.task-sheet-body::-webkit-scrollbar { width: 5px; }
.task-sheet-body::-webkit-scrollbar-track { background: transparent; }
.task-sheet-body::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 999px; }

.sheet-desc-wrap {
    border: 1px solid var(--stroke);
    background: var(--surface2);
    border-radius: var(--r-sm);
    padding: 13px 14px;
    margin-bottom: 13px;
}

.sheet-desc-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--muted2);
}

.sheet-desc {
    margin: 8px 0 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
}

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

.info-box {
    border: 1px solid var(--stroke);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Special boxes (photo upload / gallery) stay vertical */
.info-box.photo-gallery,
.info-box:has(> input),
.info-box:has(> .input) {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.info-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--muted2);
    flex-shrink: 0;
}

.info-value {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    text-align: right;
    flex-shrink: 0;
}

/* Status/Priority pills in detail sheet */
.info-status-pill, .info-priority-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.info-status-pill.assigned    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.info-status-pill.in_progress { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.info-status-pill.completed   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.info-status-pill.cancelled   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.info-priority-pill.low    { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; }
.info-priority-pill.medium { background: #f5f3ff; border: 1px solid #ddd6fe; color: #4338ca; }
.info-priority-pill.high   { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.info-priority-pill.urgent { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.sheet-actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--stroke2);
}

.sheet-actions .btn { width: 100%; }

.task-sheet-body .sheet-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-bottom: 4px;
    border-top: none;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.97) 45%);
}

/* Photo gallery */
.photo-gallery { background: var(--surface2); }

.photo-gallery-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.photo-gallery-strip::-webkit-scrollbar { display: none; }

.photo-thumb {
    width: 90px; height: 70px;
    border-radius: var(--r-sm);
    object-fit: cover;
    border: 1px solid var(--stroke);
    cursor: zoom-in;
    transition: transform .15s, box-shadow .15s;
}

.photo-thumb:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ── Tamamlama fotoğraf önizleme ─────────────────────────── */
.task-photo-upload-box { background: var(--surface2) !important; }

.task-photo-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.task-photo-item {
    position: relative;
    width: 76px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--stroke);
    flex-shrink: 0;
    transition: transform .2s ease, opacity .2s ease;
}

.task-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.task-photo-del {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(15,23,42,.72);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s, transform .15s;
}

.task-photo-del:hover {
    background: rgba(239,68,68,.90);
    transform: scale(1.12);
}

.task-photo-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99,102,241,.08);
    border: 1px dashed rgba(99,102,241,.40);
    border-radius: var(--r-sm);
    padding: 7px 14px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.task-photo-add-btn:hover {
    background: rgba(99,102,241,.14);
    border-color: rgba(99,102,241,.65);
}

/* ============================================================
   TIMELINE â€” with vertical connector
   ============================================================ */

.timeline {
    margin-top: 16px;
    background: var(--surface2);
    border: 1px solid var(--stroke);
    border-radius: var(--r-sm);
    padding: 14px 16px;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.timeline-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--muted2);
    font-weight: 800;
}

.timeline-count {
    font-size: 11px;
    color: var(--accent);
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 800;
}

.timeline-items { display: grid; gap: 0; }

.timeline-item {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr);
    gap: 12px;
    position: relative;
    padding-bottom: 14px;
}

/* Vertical connector line between items */
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--stroke);
    border-radius: 1px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    width: 28px; height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--stroke);
    color: var(--muted);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-xs);
}

.timeline-dot.dot-created    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.timeline-dot.dot-started    { background: #fff7ed; border-color: #fed7aa; color: #ea580c; }
.timeline-dot.dot-completed  { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.timeline-dot.dot-cancelled  { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.timeline-dot.dot-note_added { background: #fdf4ff; border-color: #e9d5ff; color: #7c3aed; }

.timeline-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 4px; }

.timeline-body        { font-size: 13px; color: var(--text); }
.timeline-body strong { font-weight: 700; color: var(--text); }
.timeline-time        { font-size: 11px; color: var(--muted2); }

.timeline-note {
    display: block;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-xs);
    padding: 7px 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    margin-top: 4px;
    color: var(--muted);
    box-shadow: var(--shadow-xs);
}

.timeline-note.note-created    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.timeline-note.note-started    { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.timeline-note.note-completed  { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.timeline-note.note-cancelled  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.timeline-note.note-note_added { background: #fdf4ff; border-color: #e9d5ff; color: #6b21a8; }

/* ============================================================
   PROFILE PANEL & NOTIFICATIONS
   ============================================================ */

.panel {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: 12px;
}

/* Dark banner header */
.profile-gradient-hd {
    height: 96px;
    background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 50%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.profile-gradient-hd::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.30), transparent 70%);
}

.profile-gradient-hd::after {
    content: '';
    position: absolute;
    bottom: -30px; left: 30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,165,233,.22), transparent 70%);
}

.profile-av {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    font-size: 22px;
    font-family: 'Space Grotesk', sans-serif;
    margin-top: -32px;
    margin-left: 18px;
    box-shadow: 0 8px 20px rgba(99,102,241,.28);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.profile-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke2);
    background: var(--surface2);
}

.stat strong { font-size: 18px; font-weight: 900; color: var(--text); font-family: 'Space Grotesk', sans-serif; }
.stat small  { font-size: 11px; color: var(--muted); font-weight: 700; }

.stat.stat-total     { background: #f5f3ff; border-color: #ddd6fe; }
.stat.stat-total strong     { color: var(--accent); }
.stat.stat-completed { background: #f0fdf4; border-color: #bbf7d0; }
.stat.stat-completed strong { color: #16a34a; }
.stat.stat-response  { background: #fffbeb; border-color: #fde68a; }
.stat.stat-response strong  { color: #b45309; }
.stat.stat-cancel    { background: #fef2f2; border-color: #fecaca; }
.stat.stat-cancel strong    { color: #dc2626; }

/* Notifications */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--stroke2);
    cursor: pointer;
    position: relative;
    transition: opacity .12s;
}

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

/* Unread left accent */
.notif-item.unread::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.notif-item.unread .notif-title { color: var(--text); font-weight: 800; }

.notif-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    font-size: 14px;
}

.notif-item.unread .notif-icon { background: var(--accent); border-color: var(--accent-dark); }

.notif-body  { flex: 1; min-width: 0; }
.notif-top   { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.notif-title { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.notif-time  { font-size: 10px; color: var(--muted2); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.notif-msg   { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ============================================================
   TOGGLE
   ============================================================ */

.toggle { position: relative; width: 46px; height: 26px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e2e8f0;
    transition: .22s;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
}

.toggle .slider:before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 999px;
    transition: .22s;
    box-shadow: 0 2px 6px rgba(15,23,42,.20);
}

.toggle input:checked + .slider { background: var(--accent); border-color: var(--accent-dark); }
.toggle input:checked + .slider:before { transform: translateX(20px); }

/* ============================================================
   TOAST
   ============================================================ */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid #334155;
    color: rgba(255,255,255,.92);
    padding: 11px 20px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    z-index: 60;
    display: none;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

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

.confirm-modal {
    width: min(380px, 92%);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

/* Top accent bar */
.confirm-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.confirm-icon-wrap { display: flex; justify-content: center; margin-bottom: 14px; margin-top: 6px; }

.confirm-icon {
    width: 56px; height: 56px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    background: #fef2f2;
    color: #dc2626;
    font-size: 22px;
    border: 1px solid #fecaca;
}

.confirm-body  { text-align: center; }
.confirm-title { margin: 0; font-size: 17px; font-weight: 900; color: var(--text); font-family: 'Space Grotesk', sans-serif; }
.confirm-desc  { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

.confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-top: 18px;
}

.confirm-cancel-btn { background: var(--surface2); color: var(--text); border: 1px solid var(--stroke); }
.confirm-ok-btn { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.24); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 720px) {
    .board-head { flex-direction: column; align-items: stretch; }

    /* Filter + Ä°ÅŸ Ata butonu yan yana, aynÄ± yÃ¼kseklikte */
    .board-head-actions {
        justify-content: space-between;
        align-items: stretch;
    }

    .filter-bar { flex: 1; }
    .filter-select { min-width: 0; width: 100%; }

    /* Buton filtre ile aynÄ± yÃ¼kseklikte gerilsin */
    .board-head-actions .fab-btn {
        align-self: stretch;
        padding-left: 16px;
        padding-right: 16px;
        justify-content: center;
    }

    /* KPI: 2Ã—2 grid, scroll yok */
    .stats-strip {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* Mobilde kart iÃ§i: ikon solda 2 satÄ±r kapsÄ±yor, saÄŸda sayÄ± Ã¼stte / label altta */
    .kpi-item {
        display: grid;
        grid-template-columns: 28px 1fr;
        grid-template-rows: auto auto;
        column-gap: 9px;
        row-gap: 1px;
        padding: 10px 12px;
        align-items: center;
    }

    .kpi-icon {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        order: unset;
    }

    .kpi-item strong {
        grid-column: 2;
        grid-row: 1;
        order: unset;
        font-size: 20px;
        align-self: end;
    }

    .kpi-item small {
        grid-column: 2;
        grid-row: 2;
        order: unset;
        flex: none;
        font-size: 11px;
        align-self: start;
    }

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

    .notif-item.unread::before { left: -18px; }
}

@media (min-width: 900px) {
    .task-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
    .app-shell { padding: 14px 12px 80px; }
    .header { position: static; }
    .stats { grid-template-columns: 1fr; }
    .kpi-item strong { font-size: 18px; }
    .kpi-item { min-width: 130px; }
    .fab-btn span { display: none; }
}

@media (min-width: 720px) {
    .sheet-backdrop, .dialog-backdrop { align-items: center; }
    .sheet { border-radius: var(--r-lg); }
}

/* ============================================================
   MESSAGES (DM)
   ============================================================ */

/* Mesajlar sayfasında sayfa scroll olmasın; sohbet ve listeler kendi içinde scroll olsun. */
#pageMessages.page.active {
    overflow: hidden;
    position: relative;
}

#pageMessages.page.active::before {
    display: none;
}

#pageMessages.page.active::after {
    display: none;
}

@keyframes msgAurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-1.2%, 0.8%, 0) scale(1.02); }
    100% { transform: translate3d(1.0%, -0.6%, 0) scale(1); }
}

@keyframes msgGridDrift {
    0%   { background-position: 0 0; }
    100% { background-position: 340px 340px; }
}

.msg-shell {
    z-index: 1;
}

.msg-shell {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 12px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    height: var(--pp-msg-shell-h, auto);
    position: relative;
}

.msg-shell::before,
.msg-shell::after { display: none; }

.msg-left,
.msg-right {
    background: var(--surface);
    border: 1px solid rgba(15,23,42,.12);
    border-radius: var(--r-lg);
    box-shadow: 0 10px 34px rgba(15,23,42,.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.msg-tabs {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--stroke2);
    background: linear-gradient(180deg, rgba(15,23,42,.04), rgba(99,102,241,.05), transparent);
}

.msg-tab {
    flex: 1;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 9px 10px;
    background: var(--surface2);
    color: var(--muted);
    font-weight: 900;
    font-size: 12px;
    cursor: pointer;
    transition: background .14s, border-color .14s, transform .12s, color .14s;
}

.msg-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(99,102,241,.30);
    color: var(--accent);
    background: #f5f3ff;
}

.msg-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: #fff;
}

.msg-list {
    padding: 10px;
    overflow: auto;
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--surface2);
}

.msg-empty {
    padding: 14px 12px;
    border: 1px dashed rgba(15,23,42,.16);
    border-radius: var(--r);
    background: rgba(15,23,42,.03);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.msg-thread,
.msg-person {
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(15,23,42,.14);
    background: var(--surface2);
    border-radius: var(--r);
    padding: 12px 12px;
    cursor: pointer;
    transition: transform .12s, border-color .14s, background .14s;
    box-shadow: var(--shadow-xs);
    margin-bottom: 10px;
}

.msg-thread:hover,
.msg-person:hover {
    transform: translateY(-1px);
    border-color: rgba(99,102,241,.28);
    background: #f5f3ff;
}

.msg-thread {
    grid-template-columns: 44px 1fr auto;
}

.msg-person {
    grid-template-columns: 44px 1fr 18px;
    gap: 12px;
    padding: 12px 12px;
}

.msg-thread-av,
.msg-person-av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    font-weight: 1000;
    letter-spacing: -.3px;
    color: #fff;
    background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(14,165,233,.92));
    box-shadow: 0 10px 22px rgba(99,102,241,.20);
}

.msg-thread-av.has-image,
.msg-person-av.has-image {
    background: #fff;
    padding: 0;
    overflow: hidden;
}

.msg-thread-av.has-image img,
.msg-person-av.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.msg-thread-av.no-shadow {
    box-shadow: none;
}

.msg-person-main { min-width: 0; }

.msg-person-name {
    font-size: 14px;
}

.msg-person-sub {
    margin-top: 4px;
}

.msg-person-chevron {
    color: rgba(100,116,139,.85);
    display: grid;
    place-items: center;
}

.msg-person:hover .msg-person-chevron {
    color: var(--accent);
}

.msg-thread-main { min-width: 0; }

.msg-thread-name,
.msg-person-name {
    font-weight: 900;
    letter-spacing: -.2px;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.msg-thread-time {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted2);
    flex: 0 0 auto;
}

.msg-thread-sub,
.msg-person-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-thread-preview {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-group-create {
    width: 100%;
    margin-bottom: 10px;
    border: 1px dashed rgba(99,102,241,.45);
    background: rgba(99,102,241,.08);
    color: var(--accent-dark);
    border-radius: var(--r);
    padding: 10px 12px;
    font-weight: 900;
    cursor: pointer;
}

.msg-group-create:hover {
    background: rgba(99,102,241,.14);
}

.msg-thread-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(99,102,241,.14);
    border: 1px solid rgba(99,102,241,.25);
    color: var(--accent-dark);
    font-weight: 900;
    font-size: 12px;
}

.msg-person-cta {
    color: var(--accent);
    font-weight: 900;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(99,102,241,.22);
    background: rgba(99,102,241,.10);
}

.msg-chat-empty {
    padding: 18px 16px;
}

.msg-chat-empty-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.msg-chat-empty-sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.msg-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.msg-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--stroke2);
    background: linear-gradient(180deg, rgba(14,165,233,.07), transparent);
}

#msgChatAvatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
}

.msg-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--muted);
    display: none;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.msg-back:hover {
    border-color: rgba(99,102,241,.28);
    color: var(--accent);
    background: #f5f3ff;
}

.msg-chat-head-text { min-width: 0; }

.msg-chat-title {
    font-weight: 900;
    letter-spacing: -.2px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-chat-sub {
    margin-top: 1px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(14,165,233,.95);
    font-weight: 900;
}

.msg-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transform: translateY(1px);
}

.msg-typing-dots i {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(14,165,233,.95);
    opacity: .35;
    animation: msgDot 1.1s infinite ease-in-out;
}

.msg-typing-dots i:nth-child(2) { animation-delay: .12s; }
.msg-typing-dots i:nth-child(3) { animation-delay: .24s; }

@keyframes msgDot {
    0%, 100% { transform: translateY(0); opacity: .35; }
    45%      { transform: translateY(-2px); opacity: 1; }
}

.msg-media {
    position: relative;
}

.msg-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.28), transparent 40%);
    opacity: .8;
}

.msg-bubble.media .msg-media img {
    transition: transform .18s ease;
}

.msg-bubble.media:active .msg-media img {
    transform: scale(0.995);
}

.msg-chat-body {
    padding: 14px 12px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    background: var(--surface2);
    position: relative;
}

@media (prefers-reduced-motion: reduce) {
    #pageMessages.page.active::before,
    #pageMessages.page.active::after { animation: none; }
}

.msg-bubble {
    max-width: 78%;
    padding: 10px 12px;
    padding-bottom: 26px; /* saat + tik alanı */
    border-radius: 16px;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-xs);
    margin-bottom: 10px;
    position: relative;
}

/* Media balonları kendi padding düzenini kullanır */
.msg-bubble.media {
    padding: 5px 5px 0 5px;
    max-width: 280px;
}

.msg-bubble.mine {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(14,165,233,.10));
    border-color: rgba(99,102,241,.22);
}

.msg-bubble.theirs {
    margin-right: auto;
    background: rgba(255,255,255,.92);
}

.msg-bubble-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13.5px;
    line-height: 1.35;
    padding-right: 66px; /* meta saÄŸ altta, metin Ã¼stÃ¼ne binmesin */
}

.msg-sender {
    font-size: 11px;
    font-weight: 900;
    color: rgba(71,85,105,.95);
    margin-bottom: 6px;
}

.msg-bubble-meta {
    position: absolute;
    right: 10px;
    bottom: 8px;
    margin-top: 0;
    font-size: 10.5px;
    color: rgba(100,116,139,.90);
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    user-select: none;
}

.msg-bubble.mine .msg-bubble-meta { color: rgba(15,23,42,.55); }

.msg-ticks {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: rgba(100,116,139,.85);
    transform: translateY(1px);
}

.msg-ticks .tick.two { margin-left: -9px; opacity: .55; }
.msg-ticks.read { color: rgba(14,165,233,.95); }
.msg-ticks.read .tick.two { opacity: .95; }

.msg-bubble.mine .msg-ticks { color: rgba(51,65,85,.70); }
.msg-bubble.mine .msg-ticks.read { color: rgba(14,165,233,.98); }

.msg-compose {
    padding: 10px 12px;
    border-top: 1px solid var(--stroke2);
    background: var(--surface);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.msg-compose-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-attach {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--surface2);
    border: 1px solid var(--stroke2);
    box-shadow: var(--shadow-xs);
    flex: 0 0 auto;
}

.msg-attach:active { transform: translateY(1px); }

.msg-image-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: var(--surface2);
    border: 1px solid var(--stroke2);
    box-shadow: var(--shadow-xs);
}

.msg-image-strip {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding-bottom: 2px;
}

.msg-image-item {
    position: relative;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
}

.msg-image-thumb {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--stroke);
    background: #fff;
    display: block;
}

.msg-image-meta { flex: 1; min-width: 0; }
.msg-image-name {
    font-size: 12.5px;
    font-weight: 900;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-image-sub {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted2);
}

.msg-image-remove {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(244,63,94,.22);
    background: rgba(244,63,94,.08);
    color: rgba(190,18,60,.95);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.msg-image-x {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(244,63,94,.28);
    background: rgba(255,255,255,.92);
    color: rgba(190,18,60,.98);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-xs);
}

.msg-media {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--stroke);
}

.msg-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
    cursor: pointer;
}

/* Saat + tik → görselin altında baloncuk tabanında, WhatsApp gibi */
.msg-bubble.media .msg-bubble-meta {
    position: relative;
    right: auto;
    bottom: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    padding: 4px 6px 6px 6px;
}

.msg-bubble.media .msg-bubble-body {
    padding: 5px 8px 0 6px;
    font-size: 13px;
}

.msg-compose-input {
    margin: 0;
    resize: none;
    min-height: 44px;
    max-height: 140px;
    box-shadow: var(--shadow-xs);
}

.msg-send {
    padding: 12px 14px;
    flex: 0 0 auto;
}

@media (max-width: 980px) {
    .msg-shell { grid-template-columns: 1fr; }
    .msg-list { max-height: none; }
    .msg-chat { min-height: 0; }
}

@media (max-width: 860px) {
    #pageMessages .msg-right { display: none; }
    #pageMessages.chat-open .msg-left { display: none; }
    #pageMessages.chat-open .msg-right { display: flex; }
    .msg-back { display: grid; }
    .msg-left,
    .msg-right {
        border-radius: 18px;
    }
    .msg-shell {
        gap: 10px;
    }
    .msg-thread,
    .msg-person {
        border-radius: 16px;
        padding: 11px 12px;
    }
    .msg-compose {
        position: sticky;
        bottom: 0;
        z-index: 4;
        backdrop-filter: blur(6px);
        background: rgba(255,255,255,.92);
    }
}
