:root {
    --bg: #edf1f7;
    --glass: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.5);
    --text: #0f172a;
    --muted: #6b7280;
    --accent: #1d4ed8;
    --success: #22c55e;
    --danger: #ef4444;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
    font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #e0e7ff, #fdf2f8);
    color: var(--text);
    min-height: 100vh;
}

main {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.glass {
    background: var(--glass);
    border-radius: 26px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.top-bar {
    margin: 1.5rem;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.top-bar h1 {
    margin: 0;
    font-size: 1.8rem;
}

.top-bar p {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.status-pill {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    color: #047857;
    font-size: 0.9rem;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

.btn.primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
}

.btn.secondary {
    background: rgba(99, 102, 241, 0.2);
    color: #312e81;
}

.btn.ghost {
    background: transparent;
    box-shadow: none;
    color: var(--muted);
}

.btn.tiny {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

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

.card {
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-header h2 {
    margin: 0;
}

.card-header p {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.card-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.chip {
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    background: rgba(148, 163, 184, 0.2);
    color: var(--muted);
    font-size: 0.85rem;
}

.chip.subtle {
    background: rgba(148, 163, 184, 0.15);
}

.group-tabs {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab {
    border: none;
    background: rgba(255,255,255,0.6);
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.2s ease;
}

.tab.active {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #fff;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.list {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-row {
    display: grid;
    grid-template-columns: 2fr auto auto;
    gap: 1rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.5);
    align-items: center;
}

.list-row h3 {
    margin: 0;
}

.list-row p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.platform-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.platform-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.8);
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.6);
}

.platform-pill-icon img {
    width: 16px;
    height: 16px;
}

.platform-pill.tt { color: #111827; }
.platform-pill.yt { color: #b91c1c; }
.platform-pill.ig { color: #d946ef; }
.platform-pill.fb { color: #2563eb; }
.platform-pill.success { border-color: rgba(34,197,94,0.3); }
.platform-pill.danger { border-color: rgba(239,68,68,0.3); }

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.empty {
    text-align: center;
    color: var(--muted);
}

.text-danger {
    color: var(--danger);
}

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.alert.success {
    background: rgba(34, 197, 94, 0.2);
    color: #065f46;
}

.alert.error {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.sheet {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.35);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem 1rem;
    z-index: 100;
}

.sheet[aria-hidden="false"] {
    display: flex;
}

.sheet-content {
    width: min(640px, 100%);
    padding: 2rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.sheet-content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sheet-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sheet-form label,
.sheet-form fieldset {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    gap: 0.5rem;
}

.sheet-form input,
.sheet-form textarea,
.sheet-form select {
    padding: 0.7rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,0.1);
    background: rgba(255,255,255,0.9);
    font: inherit;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
}

.platform-toggle {
    cursor: pointer;
}

.platform-toggle input {
    display: none;
}

.platform-toggle input:checked + .platform-pill {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-card {
    max-width: 420px;
    padding: 3rem 2.5rem;
    text-align: center;
}

.auth-logo {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #9333ea, #38bdf8);
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
}

.auth-subtitle {
    margin-top: 0;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.auth-form input {
    width: 100%;
}

.alert.error,
.alert.success {
    font-weight: 600;
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .row-actions {
        justify-content: flex-start;
    }
}
