/* ===========================================================
   9495 Creative Management — main stylesheet
   Self-contained. No external fonts or CDN dependencies.
   =========================================================== */

:root {
    --bg:           #0b1220;
    --bg-elev:      #111a2e;
    --card:         #162038;
    --card-2:       #1c2742;
    --border:       #243151;
    --border-soft:  #1c2742;
    --text:         #e2e8f0;
    --text-2:       #cbd5e1;
    --muted:        #8aa0c4;
    --accent:       #6366f1;
    --accent-2:     #8b5cf6;
    --accent-hover: #818cf8;
    --ok:           #22c55e;
    --warn:         #f59e0b;
    --err:          #ef4444;
    --info:         #0ea5e9;

    --shadow:       0 10px 30px -10px rgba(0,0,0,.5);
    --shadow-lg:    0 25px 50px -15px rgba(0,0,0,.6);
    --radius:       12px;
    --radius-sm:    8px;
    --radius-lg:    16px;
    --sb-width:     244px;
    --tb-height:    64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a.link { color: var(--accent-hover); }

h1, h2, h3, h4, h5 { margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }

p { margin: 0 0 12px; }

img { max-width: 100%; display: block; }

.muted { color: var(--muted); }
.ok    { color: var(--ok); }
.err   { color: var(--err); }
.overdue { color: var(--err); font-weight: 600; }

/* ===========================================================
   AUTH (login) page
   =========================================================== */

.auth-body {
    background: radial-gradient(ellipse at top, #1e1b4b 0%, #0b1220 50%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand h1 { margin: 14px 0 4px; font-size: 22px; }
.auth-brand p { color: var(--muted); font-size: 13px; }
.auth-foot { margin-top: 24px; display: flex; justify-content: center; }

/* ===========================================================
   APP LAYOUT
   =========================================================== */

body.app {
    display: grid;
    grid-template-columns: var(--sb-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 22px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 16px;
}
.brand-logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
    letter-spacing: -0.5px;
    box-shadow: 0 6px 14px -4px rgba(99,102,241,.5);
}
.brand-logo.big {
    width: 64px; height: 64px;
    font-size: 22px;
    border-radius: 16px;
    margin: 0 auto 8px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text small { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(99,102,241,.18), rgba(139,92,246,.08)); color: white; box-shadow: inset 3px 0 0 var(--accent); }
.nav-ico { font-size: 16px; opacity: .9; width: 18px; text-align: center; }

.sidebar-foot { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.profile-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background .12s;
}
.profile-card:hover { background: var(--card); }
.profile-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.profile-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta small { font-size: 11px; color: var(--muted); }

.main { min-height: 100vh; min-width: 0; }

.topbar {
    height: var(--tb-height);
    background: rgba(11,18,32,.85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex; align-items: center; gap: 20px;
    position: sticky; top: 0; z-index: 50;
}
.page-title { margin: 0; font-size: 18px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.lang-switch {
    display: inline-flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.lang-switch a {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .04em;
}
.lang-switch a.active { background: var(--accent); color: white; }
.lang-switch a:hover:not(.active) { color: var(--text); background: var(--card-2); }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-2);
    cursor: pointer;
}
.icon-btn:hover { background: var(--card-2); color: white; }

.menu-toggle { display: none; }

.content { padding: 24px; max-width: 1480px; margin: 0 auto; }

/* ===========================================================
   FLASH MESSAGES
   =========================================================== */
.flashes { display: flex; flex-direction: column; gap: 8px; margin: 0 24px; margin-top: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    border: 1px solid transparent;
    line-height: 1.4;
}
.flash-success { background: rgba(34,197,94,.1);  border-color: rgba(34,197,94,.3);  color: #86efac; }
.flash-error   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.3);  color: #fca5a5; }
.flash-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fbbf24; }
.flash-info    { background: rgba(14,165,233,.1); border-color: rgba(14,165,233,.3); color: #7dd3fc; }

/* ===========================================================
   FORMS
   =========================================================== */
label {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
label .req { color: var(--err); margin-left: 2px; }

input, select, textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }
input[type="file"] { padding: 8px; cursor: pointer; }
input[disabled] { opacity: .6; cursor: not-allowed; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238aa0c4' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 32px;
}

.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: auto; margin: 0; }

.hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: block; }

.form { padding: 24px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-row { display: flex; flex-direction: column; }
.form-row.span-2 { grid-column: 1 / -1; }
.form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--card-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, transform .05s;
    white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,.2); color: #fee2e2; }
.btn-block { width: 100%; margin-top: 12px; padding: 12px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; font-size: 18px; }
.btn-complete {
    background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.4); color: #86efac;
    margin: 12px 0 16px;
}
.btn-complete:hover { background: rgba(34,197,94,.25); color: #bbf7d0; }

.inline { display: inline-flex; }

.back-link {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.back-link:hover { color: var(--text); }

/* ===========================================================
   PAGE HEAD
   =========================================================== */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; flex: 1; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.view-switch {
    display: inline-flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
}
.view-switch a {
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}
.view-switch a:hover { color: var(--text); }
.view-switch a.active { background: var(--accent); color: white; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { padding: 8px 12px; font-size: 13px; }
.search-form input { min-width: 220px; }

/* ===========================================================
   WELCOME / DASHBOARD
   =========================================================== */
.welcome { margin-bottom: 24px; }
.welcome h2 { font-size: 22px; margin-bottom: 4px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
}
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat-value { font-size: 32px; font-weight: 700; margin-top: 4px; line-height: 1.1; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.panel, .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.panel-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; align-items: center;
}
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-body { padding: 12px; }
.card { padding: 0; }

/* Task list rows */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li + li { border-top: 1px solid var(--border-soft); }
.task-row {
    display: grid;
    grid-template-columns: 8px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background .1s;
}
.task-row:hover { background: var(--card-2); }
.biz-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.task-title-line { display: flex; flex-direction: column; min-width: 0; }
.task-title-line strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-title-line small { font-size: 11px; }

.status-chip {
    font-size: 11px; font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.status-chip.mini { font-size: 9.5px; padding: 2px 6px; }

.platforms { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.type-pill {
    font-size: 10px; font-weight: 600;
    padding: 2px 7px;
    background: var(--card-2); color: var(--muted);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.due { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ===========================================================
   AVATARS
   =========================================================== */
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
    letter-spacing: 0;
}
.avatar.small { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===========================================================
   ACTIVITY FEED
   =========================================================== */
.activity-feed { list-style: none; padding: 0; margin: 0; }
.activity-row {
    display: flex;
    gap: 12px;
    padding: 10px 6px;
    border-bottom: 1px solid var(--border-soft);
}
.activity-row:last-child { border-bottom: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-body small { font-size: 11px; }

/* ===========================================================
   BUSINESS CARDS
   =========================================================== */
.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.business-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px;
    transition: transform .15s, box-shadow .15s;
    display: block;
}
.business-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.business-head { display: flex; gap: 12px; align-items: center; }
.business-logo {
    width: 48px; height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--card-2);
}
.business-logo.lg { width: 72px; height: 72px; border-radius: 14px; }
.business-logo.placeholder {
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
}
.business-socials {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted);
}
.business-socials span {
    background: var(--card-2);
    padding: 4px 9px;
    border-radius: 999px;
}
.badge { display: inline-block; padding: 3px 8px; font-size: 10px; border-radius: 999px; font-weight: 700; }
.badge-muted { background: var(--card-2); color: var(--muted); margin-top: 8px; }

.mini-stats {
    display: flex; gap: 24px;
    padding: 12px 16px;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    margin: 8px 0 16px;
}
.mini-stats strong { font-size: 18px; }
.mini-stats span.muted { font-size: 12px; }

.info-block { padding: 16px; border-top: 1px solid var(--border-soft); }
.info-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.info-block p { font-size: 14px; line-height: 1.6; margin: 0; }

/* ===========================================================
   KANBAN
   =========================================================== */
.kanban {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 60vh;
}
.kanban-col {
    flex: 0 0 280px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}
.kanban-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; align-items: center;
    border-top: 3px solid;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}
.kanban-head .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.kanban-head .count {
    background: var(--card);
    color: var(--muted);
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.kanban-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 100px;
}
.kanban-list.drag-over { background: rgba(99,102,241,.06); }

.task-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: grab;
    position: relative;
    transition: border-color .12s, box-shadow .12s, transform .05s;
}
.task-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: .4; transform: scale(.96); }
.task-card .card-link {
    position: absolute; inset: 0; z-index: 1; cursor: pointer;
}
.task-card header, .task-card h4, .task-card footer {
    position: relative; z-index: 2;
}
.task-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.task-card h4 { font-size: 13.5px; margin: 4px 0 10px; line-height: 1.4; }
.task-card footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px;
    gap: 4px;
}

.business-tag {
    font-size: 10.5px; font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.business-tag a { color: inherit; }

.priority-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.priority-dot.p-low    { background: #64748b; }
.priority-dot.p-normal { background: #3b82f6; }
.priority-dot.p-high   { background: #f59e0b; }
.priority-dot.p-urgent { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.priority-tag {
    font-size: 10.5px; font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.priority-tag.p-low    { background: rgba(100,116,139,.15); color: #94a3b8; }
.priority-tag.p-normal { background: rgba(59,130,246,.15);  color: #93c5fd; }
.priority-tag.p-high   { background: rgba(245,158,11,.15);  color: #fbbf24; }
.priority-tag.p-urgent { background: rgba(239,68,68,.15);   color: #fca5a5; }

.due-pill {
    font-size: 10.5px;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--card-2);
    color: var(--muted);
    white-space: nowrap;
}
.due-pill.overdue { background: rgba(239,68,68,.15); color: #fca5a5; }

.card-meta { display: inline-flex; gap: 6px; align-items: center; }

/* ===========================================================
   TASK DETAIL
   =========================================================== */
.task-detail {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
.task-main { grid-column: 1; padding: 24px; }
.task-detail > section:not(.task-main):not(.task-side) {
    grid-column: 1;
    padding: 20px 24px;
}
.task-side {
    grid-column: 2;
    grid-row: 1 / 5;
    padding: 20px;
}
.task-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.task-title { font-size: 24px; margin: 0 0 14px; line-height: 1.3; }
.task-title .check {
    display: inline-block; margin-left: 8px;
    color: var(--ok); font-size: 22px;
}

.meta-row {
    display: flex; flex-wrap: wrap;
    gap: 22px;
    padding: 12px 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 14px;
}
.meta-block { display: flex; flex-direction: column; gap: 4px; }
.meta-block label { margin: 0; }
.meta-block strong { font-size: 13.5px; }

.status-changer, .assignee-changer { display: flex; flex-direction: column; gap: 4px; }
.status-changer label, .assignee-changer label { margin: 0; }
.status-select, .assignee-select { padding: 6px 28px 6px 10px; font-size: 13px; min-width: 130px; }

.side-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
}
.side-row:last-child { border-bottom: 0; }

/* ===========================================================
   ATTACHMENTS
   =========================================================== */
.upload-zone {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: var(--bg-elev);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    margin: 12px 0 16px;
    align-items: center;
}
.upload-zone.drag-over { border-color: var(--accent); background: rgba(99,102,241,.06); }
.upload-drop {
    flex: 1;
    margin: 0;
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    color: var(--muted);
    transition: background .12s, color .12s;
}
.upload-drop:hover { background: var(--card-2); color: var(--text); }
.upload-drop input { display: none; }
.upload-kind {
    width: 140px; padding: 22px 12px;
    text-align: center;
    font-weight: 600;
}

.attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 0 24px 24px;
}
.attach-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.attach-card .thumb {
    display: block;
    height: 130px;
    background: var(--card-2);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.attach-card .thumb img,
.attach-card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.attach-card .file-icon { font-size: 40px; opacity: .6; }
.attach-meta { padding: 10px; font-size: 11.5px; }
.attach-meta strong { display: block; font-size: 12.5px; margin-bottom: 4px; }
.attach-meta small { display: block; color: var(--muted); font-size: 10.5px; }
.attach-del {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    background: rgba(0,0,0,.55);
    border: 0;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s;
}
.attach-card:hover .attach-del { opacity: 1; }
.attach-del:hover { background: var(--err); }

/* ===========================================================
   COMMENTS
   =========================================================== */
.comments { display: flex; flex-direction: column; gap: 14px; padding: 12px 24px; }
.comment { display: flex; gap: 12px; }
.comment-body {
    flex: 1;
    background: var(--bg-elev);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}
.comment-body header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.comment-body header small { font-size: 11px; }
.comment-body p { margin: 0; font-size: 13.5px; line-height: 1.5; }

.comment-form {
    display: flex;
    gap: 10px;
    padding: 12px 24px 20px;
    align-items: end;
}
.comment-form textarea { flex: 1; resize: vertical; min-height: 44px; }
.comment-form button { white-space: nowrap; }

/* ===========================================================
   TABLE
   =========================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.data-table th, .data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    text-align: left;
}
.data-table th {
    background: var(--bg-elev);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.data-table tr { cursor: pointer; transition: background .1s; }
.data-table tr:hover td { background: var(--card-2); }

.card-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    padding: 12px 14px;
}
.card-row:hover { border-color: var(--accent); }
.task-table { display: flex; flex-direction: column; gap: 8px; }

/* ===========================================================
   TEAM
   =========================================================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.team-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: center;
}
.team-card.inactive { opacity: .5; }
.team-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-body strong { font-size: 14px; }
.team-body small { font-size: 11.5px; }
.team-stats {
    display: flex; gap: 14px;
    margin-top: 6px;
    font-size: 11px; color: var(--muted);
}
.team-stats strong { color: var(--text); font-size: 13px; }

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

/* ===========================================================
   CHIP GROUP (platform selection)
   =========================================================== */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-size: 12.5px;
    user-select: none;
    transition: background .12s, border-color .12s;
}
.chip input { display: none; }
.chip:hover { border-color: var(--accent); }
.chip:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===========================================================
   CALENDAR
   =========================================================== */
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-nav h2 { margin: 0 8px; min-width: 180px; text-align: center; font-size: 17px; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.cal-dow {
    background: var(--bg-elev);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: center;
}
.cal-day {
    background: var(--card);
    min-height: 110px;
    padding: 6px;
    display: flex;
    flex-direction: column;
}
.cal-day.empty { background: var(--bg); }
.cal-day.today { background: rgba(99,102,241,.08); }
.cal-day.today .cal-date {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.cal-date { font-size: 12px; color: var(--muted); padding: 2px 4px; margin-bottom: 4px; }
.cal-items { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-item {
    background: var(--bg-elev);
    border-left: 3px solid;
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background .1s;
}
.cal-item:hover { background: var(--card-2); }
.cal-item strong { font-size: 11.5px; font-weight: 600; }
.cal-item small { font-size: 10px; }
.more { font-size: 10.5px; color: var(--muted); padding: 0 4px; }

/* ===========================================================
   EMPTY STATE
   =========================================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state .empty-icon {
    font-size: 56px;
    opacity: .4;
    margin-bottom: 16px;
}
.empty-state h2, .empty-state h3 { color: var(--text); margin-bottom: 16px; }

.hashtags { color: var(--accent-hover); font-family: ui-monospace, monospace; font-size: 13px; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .task-detail { grid-template-columns: 1fr; }
    .task-side { grid-column: 1; grid-row: auto; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body.app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        z-index: 100;
        transition: left .25s;
    }
    .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
    .menu-toggle { display: inline-flex; }
    .content { padding: 16px; }
    .kanban-col { flex: 0 0 260px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .calendar-grid { font-size: 11px; }
    .cal-day { min-height: 70px; }
    .cal-item strong { font-size: 10.5px; }
}
