/* ============ SCROLLBAR ============ */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0b1220;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #0b1220;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e293b, #334155);
    border-radius: 10px;
    border: 2px solid #0b1220;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #334155, #14b8a6);
}

*::-webkit-scrollbar-corner { background: #0b1220; }

:root {
    --bg: #0b1220;
    --surface: #0f172a;
    --surface-2: #111c32;
    --surface-3: #17223d;
    --border: #1e293b;
    --border-strong: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --primary: #14b8a6;
    --primary-light: #2dd4bf;
    --primary-dark: #0f766e;
    --accent: #6366f1;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --font-body: "DM Sans", system-ui, -apple-system, sans-serif;
    --font-heading: "Sora", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
}

/* ============ SHELL ============ */
.shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

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

.sidebar__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 10px 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar__brand-logo {
    height: 34px;
    width: auto;
    max-width: 180px;
    display: block;
    filter: drop-shadow(0 4px 16px rgba(20, 184, 166, 0.25));
}

.sidebar__brand-sub {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-left: 2px;
}

.sidebar__section {
    margin-top: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 8px 10px 6px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar__link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar__link.is-active {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.15), transparent);
    color: var(--primary-light);
    position: relative;
}

.sidebar__link.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--primary);
}

.sidebar__link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar__footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
    padding-left: 10px;
}

/* ============ MAIN ============ */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar__title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.topbar__title small {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.user-chip__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
}

.user-chip__name { font-size: 0.85rem; font-weight: 500; }

.logout-form { display: inline; }

.logout-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.15s;
}

.logout-btn:hover {
    color: var(--text);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.content {
    padding: 28px;
    flex: 1;
}

.content > h1:first-child,
.content > h2:first-child {
    margin-top: 0;
}

/* ============ GRID / CARDS ============ */
.grid {
    display: grid;
    gap: 18px;
}

.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 960px) {
    .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
    .content { padding: 20px; }
}

/* ============ MOBILE SIDEBAR (OFFCANVAS) ============ */
.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    transition: background 0.15s, border-color 0.15s;
}

.sidebar-toggle:hover { background: var(--surface-2); border-color: var(--primary); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 17, 0.6);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-backdrop.is-open { opacity: 1; }
body.no-scroll { overflow: hidden; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 86vw;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    }

    .sidebar.is-open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
    .sidebar-backdrop.is-open { display: block; }

    .topbar { padding: 14px 18px; gap: 10px; }
    .topbar__title { font-size: 1.05rem; min-width: 0; flex: 1; }
    .topbar__title small { font-size: 0.7rem; }
    .user-chip__name { display: none; }
    .user-chip { padding: 4px; }
    .logout-btn { padding: 7px 10px; font-size: 0; }
    .logout-btn svg { width: 16px !important; height: 16px !important; }
    .topbar__actions { gap: 8px; }
}

@media (max-width: 480px) {
    .content { padding: 16px; }
    .topbar { padding: 12px 14px; }
    .form-card { padding: 18px; }
    .toolbar { gap: 10px; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-strong); }

.card__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card__value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 6px;
}

.card__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(20, 184, 166, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(20, 184, 166, 0.25);
}

/* ============ LOGIN ============ */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(20, 184, 166, 0.18), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(99, 102, 241, 0.12), transparent 45%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-card__brand--centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin-bottom: 26px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.auth-card__logo {
    height: 52px;
    width: auto;
    max-width: 240px;
    filter: drop-shadow(0 8px 24px rgba(20, 184, 166, 0.35));
}

.auth-card__brand-sub {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-mascot {
    position: fixed;
    bottom: -30px;
    right: -30px;
    width: 320px;
    height: auto;
    opacity: 0.55;
    pointer-events: none;
    filter: drop-shadow(0 20px 40px rgba(20, 184, 166, 0.15));
    z-index: 0;
}

.auth-card { position: relative; z-index: 1; }

@media (max-width: 860px) {
    .auth-mascot { display: none; }
}

.auth-card h2 {
    font-size: 1.35rem;
    margin: 6px 0 8px;
}

.auth-card__lead {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-field { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-check input { accent-color: var(--primary); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}

.btn--primary {
    color: #042f2e;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.3);
}

.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(20, 184, 166, 0.4); color: #000000; }
.btn--primary:active { transform: translateY(0); }

.btn--block { width: 100%; }

.validation-summary-errors {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #fecaca;
    font-size: 0.85rem;
}

.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }

.field-validation-error,
.text-danger {
    display: block;
    font-size: 0.78rem;
    color: #fecaca;
    margin-top: 4px;
}

.auth-card__footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-dim);
    text-align: center;
}

/* ============ BUTTON VARIANTS ============ */
.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
}
.btn--ghost:hover { color: var(--text); border-color: var(--primary); background: rgba(20, 184, 166, 0.08); }

.btn--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn--danger:hover { background: rgba(239, 68, 68, 0.2); color: #fecaca; border-color: rgba(239, 68, 68, 0.6); }

.btn--sm { padding: 7px 14px; font-size: 0.82rem; }
.btn--icon { padding: 7px 10px; }

/* ============ TOOLBAR + FILTERS ============ */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.is-active { background: rgba(20, 184, 166, 0.15); color: var(--primary-light); border-color: rgba(20, 184, 166, 0.4); }

/* ============ TABLE ============ */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.9rem;
}

.table thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
}

.table tbody tr { border-top: 1px solid var(--border); transition: background 0.12s; }
.table tbody tr:first-child { border-top: none; }
.table tbody tr:hover { background: var(--surface-2); }

.table td a { color: var(--text); font-weight: 500; }
.table td a:hover { color: var(--primary-light); }

.table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.table-actions form { display: inline; margin: 0; }

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.badge--community { background: rgba(20, 184, 166, 0.12); color: var(--primary-light); border: 1px solid rgba(20, 184, 166, 0.3); }
.badge--b2b       { background: rgba(99, 102, 241, 0.12); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge--b2c       { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge--internal  { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

.badge--draft     { background: rgba(148, 163, 184, 0.1);  color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }
.badge--active    { background: rgba(34, 197, 94, 0.12);   color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge--paused    { background: rgba(245, 158, 11, 0.12);  color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge--completed { background: rgba(20, 184, 166, 0.12);  color: var(--primary-light); border: 1px solid rgba(20, 184, 166, 0.3); }
.badge--archived  { background: rgba(100, 116, 139, 0.1);  color: #64748b; border: 1px solid rgba(100, 116, 139, 0.25); }

/* ============ FLASH ============ */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--primary-light);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.flash svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}

.empty-state__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin: 0 auto 16px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.empty-state h3 { font-size: 1.1rem; color: var(--text); margin: 0 0 6px; }
.empty-state p { margin: 0 0 18px; font-size: 0.9rem; }

/* ============ FORM CARD ============ */
.form-card {
    max-width: 680px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

textarea.form-input { resize: vertical; min-height: 110px; font-family: inherit; }

select.form-input {
    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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 40px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ============ DETAIL VIEW ============ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.detail-field { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.detail-field__label { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.detail-field__value { margin-top: 4px; font-size: 0.95rem; color: var(--text); font-weight: 500; }

.detail-body {
    padding: 18px 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.detail-body--empty { color: var(--text-dim); font-style: italic; }

/* ============ SECTION HEADERS ============ */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 28px 0 12px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    text-transform: none;
    letter-spacing: -0.01em;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.section-count {
    display: inline-flex;
    min-width: 22px;
    padding: 1px 8px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    justify-content: center;
    align-items: center;
}

.section-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.empty-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ============ PHASE CARD ============ */
.phase-list { display: flex; flex-direction: column; gap: 14px; }

.phase-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    border-left: 3px solid var(--dot, var(--text-muted));
    transition: border-color 0.15s;
}

.phase-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.phase-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.phase-card__title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.phase-card__num {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.phase-card__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.phase-card__dates {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.phase-card__plan {
    margin: 12px 0 0;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

.phase-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.phase-progress__bar {
    flex: 1;
    height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.phase-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s;
}

.phase-progress__text {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ============ TASK LIST ============ */
.task-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background 0.12s;
}

.task-row:hover { background: var(--surface-2); }

.task-toggle { display: contents; }
.task-toggle form { display: contents; }

.task-check {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.12s, transform 0.12s;
    display: inline-flex;
    align-items: center;
}

.task-check:hover { color: var(--primary-light); transform: scale(1.1); }

.task-row.is-done .task-check { color: var(--primary); }
.task-row.is-done .task-title { color: var(--text-dim); text-decoration: line-through; }

.task-title {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.task-done-at {
    font-size: 0.72rem;
    color: var(--text-dim);
    padding: 2px 8px;
    background: rgba(20, 184, 166, 0.08);
    border-radius: 999px;
}

.task-delete { margin: 0; }

.task-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s, background 0.12s;
    display: inline-flex;
    align-items: center;
}

.task-row:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }

.task-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 10px;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    transition: border-color 0.15s;
}

.task-add:focus-within { border-color: var(--primary); border-style: solid; }

.task-add__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    padding: 4px 0;
}

.task-add__input::placeholder { color: var(--text-dim); }

.task-add__btn {
    background: var(--primary);
    color: #042f2e;
    border: none;
    padding: 5px 14px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
}

.task-add__btn:hover { background: var(--primary-light); }

/* ============ MILESTONE LIST ============ */
.milestone-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.milestone-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s;
}

.milestone-row:hover { border-color: var(--border-strong); }

.milestone-row.is-achieved { opacity: 0.7; }
.milestone-row.is-late { border-left: 3px solid #f59e0b; }

.milestone-toggle button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    transition: color 0.12s, transform 0.12s;
}

.milestone-toggle button:hover { color: var(--primary-light); transform: scale(1.1); }
.milestone-row.is-achieved .milestone-toggle button { color: var(--primary); }

.milestone-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.milestone-date__day {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.milestone-date__year {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.milestone-body { flex: 1; min-width: 0; }

.milestone-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.milestone-row.is-achieved .milestone-title { text-decoration: line-through; color: var(--text-muted); }

.milestone-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin: 2px 0 6px;
    line-height: 1.5;
}

.milestone-meta { margin-top: 4px; }

.milestone-actions {
    display: flex;
    gap: 6px;
}

/* ============ DASHBOARD UPCOMING LIST ============ */
.upcoming-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upcoming-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 8px;
    border-radius: 6px;
    transition: background 0.12s;
}

.upcoming-list li:hover { background: var(--surface-2); }

.upcoming-list__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 6px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.upcoming-list__date span {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.upcoming-list__date small {
    font-size: 0.68rem;
    color: var(--primary-light);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.upcoming-list__body { flex: 1; min-width: 0; }

.upcoming-list__body a {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
}

.upcoming-list__body a:hover { color: var(--primary-light); }

.upcoming-list__body small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============ BACK TO TOP ============ */
.back-to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 1px solid rgba(45, 212, 191, 0.4);
    color: #042f2e;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(20, 184, 166, 0.35);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    z-index: 50;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(20, 184, 166, 0.5);
}

/* ============ LOOP HERO CARD (DASHBOARD) ============ */
.loop-hero-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 120% 80% at 100% 100%, rgba(20, 184, 166, 0.18), transparent 55%),
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(99, 102, 241, 0.12), transparent 45%),
        var(--surface);
    padding: 24px 28px;
    min-height: 220px;
    display: flex;
    align-items: center;
}

.loop-hero-card__body {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.loop-hero-card__mascot {
    width: 170px;
    height: auto;
    flex-shrink: 0;
    margin-left: 12px;
    filter: drop-shadow(0 12px 30px rgba(20, 184, 166, 0.25));
    transform: rotate(-4deg);
    transition: transform 0.4s ease;
}

.loop-hero-card:hover .loop-hero-card__mascot { transform: rotate(0deg) scale(1.03); }

@media (max-width: 720px) {
    .loop-hero-card { flex-direction: column-reverse; text-align: left; }
    .loop-hero-card__mascot { width: 140px; margin: 0 0 12px; align-self: center; }
}

/* ============ UPDATE FEED ============ */
.update-feed { display: flex; flex-direction: column; gap: 12px; }

.update-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: border-color 0.15s;
}

.update-item:hover { border-color: var(--border-strong); }

.update-item__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.update-item__head h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.update-item__date {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

.update-item__body {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.update-item__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.update-item__project {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--primary-light);
    padding: 3px 10px;
    background: rgba(20, 184, 166, 0.08);
    border-radius: 999px;
}

.update-item__project--none { color: var(--text-dim); background: transparent; }

.update-item__actions { display: flex; gap: 6px; }

/* ============ MEETING LIST ============ */
.meeting-list { display: flex; flex-direction: column; gap: 8px; }

.meeting-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.meeting-row:hover { border-color: var(--primary); transform: translateX(2px); }

.meeting-row.is-past { opacity: 0.75; }
.meeting-row.is-today { border-left: 3px solid var(--primary); background: rgba(20, 184, 166, 0.04); }

.meeting-row__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.meeting-row__day {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}

.meeting-row__time {
    font-size: 0.74rem;
    color: var(--primary-light);
    margin-top: 2px;
    font-family: var(--font-heading);
}

.meeting-row.is-past .meeting-row__time { color: var(--text-dim); }

.meeting-row__body { flex: 1; min-width: 0; }

.meeting-row__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.meeting-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.meeting-row__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meeting-row__chevron {
    width: 18px;
    height: 18px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.meeting-row:hover .meeting-row__chevron { color: var(--primary); }

/* ============ MEDIA GRID ============ */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.media-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, transform 0.15s;
}

.media-card:hover { border-color: var(--primary); transform: translateY(-2px); }

.media-card__preview {
    display: block;
    aspect-ratio: 4/3;
    background: var(--surface-2);
    overflow: hidden;
    position: relative;
}

.media-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.media-card:hover .media-card__preview img { transform: scale(1.04); }

.media-card__icon {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--text-dim);
}

.media-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }

.media-card__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.media-card__project { color: var(--primary-light); text-transform: none; letter-spacing: 0; }

.media-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
}

/* ============ LOOP PAGE ============ */
.loop-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(20, 184, 166, 0.2), transparent 60%),
        radial-gradient(ellipse 60% 80% at 100% 100%, rgba(99, 102, 241, 0.15), transparent 55%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 200px;
}

.loop-hero__logo {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 8px 24px rgba(20, 184, 166, 0.35));
    flex-shrink: 0;
}

.loop-hero__body { flex: 1; min-width: 0; }

.loop-hero__tag {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.loop-hero__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.loop-hero__lead {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 540px;
}

.loop-hero__mascot {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 16px 40px rgba(20, 184, 166, 0.3));
    transform: rotate(4deg);
    transition: transform 0.4s ease;
    flex-shrink: 0;
}

.loop-hero:hover .loop-hero__mascot { transform: rotate(-2deg) scale(1.03); }

@media (max-width: 860px) {
    .loop-hero { flex-wrap: wrap; }
    .loop-hero__mascot { width: 120px; margin-left: auto; }
}

.loop-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.loop-gallery__item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}

.loop-gallery__item.is-transparent {
    background:
        linear-gradient(135deg, #17223d, #0f172a);
}

.loop-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.3s ease;
}

.loop-gallery__item:hover { border-color: var(--primary); transform: translateY(-2px); }
.loop-gallery__item:hover img { transform: scale(1.05); }

.loop-gallery__label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
    letter-spacing: 0.02em;
}

.loop-gallery__label em {
    font-style: normal;
    color: var(--primary-light);
    font-weight: 500;
    font-size: 0.68rem;
}
