:root{
    --bg:#08101d;
    --bg-soft:#0f1728;
    --panel:#131d33;
    --panel-2:#18233d;
    --panel-3:#0d1527;
    --text:#f5f7fb;
    --muted:#97a3bd;
    --border:rgba(255,255,255,.08);
    --accent:#ff0a62;
    --accent-2:#ff2f7d;
    --success:#19c37d;
    --shadow:0 20px 40px rgba(0,0,0,.28);
    --radius:18px;
    --radius-sm:12px;
    --sidebar-w:260px;
    --topbar-h:72px;
    --content-w:1100px;
    --font:Inter, Arial, Helvetica, sans-serif;
}

*{
    box-sizing:border-box;
}

html,body{
    margin:0;
    padding:0;
    background:linear-gradient(180deg,#09111e 0%, #07101b 100%);
    color:var(--text);
    font-family:var(--font);
}

button,input{
    font:inherit;
}

a{
    color:inherit;
    text-decoration:none;
}

.hidden{
    display:none !important;
}

.app-shell{
    min-height:100vh;
}

.sidebar{
    position:fixed;
    top:0;
    left:0;
    width:var(--sidebar-w);
    height:100vh;
    background:linear-gradient(180deg,#121b2f 0%, #0d1628 100%);
    border-right:1px solid var(--border);
    padding:22px 18px;
    display:flex;
    flex-direction:column;
    z-index:50;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:28px;
}

.brand-mark{
    width:42px;
    height:42px;
    border-radius:14px;
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    box-shadow:0 10px 24px rgba(255,10,98,.28);
}

.brand-text{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.brand-text strong{
    font-size:18px;
}

.brand-text span{
    font-size:12px;
    color:var(--muted);
}

.sidebar-nav{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.nav-link{
    padding:12px 14px;
    border-radius:12px;
    color:#dfe7f7;
    transition:.18s ease;
}

.nav-link:hover,
.nav-link.active{
    background:rgba(255,255,255,.06);
}

.sidebar-footer{
    margin-top:auto;
    padding:12px 14px;
    color:var(--muted);
    font-size:12px;
}

.sidebar-overlay{
    display:none;
}

.app-main{
    margin-left:var(--sidebar-w);
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

.topbar{
    position:sticky;
    top:0;
    z-index:30;
    height:var(--topbar-h);
    display:flex;
    align-items:center;
    gap:14px;
    padding:0 22px;
    background:rgba(8,16,29,.82);
    backdrop-filter:blur(12px);
    border-bottom:1px solid var(--border);
}

.menu-toggle{
    width:44px;
    height:44px;
    border:1px solid var(--border);
    background:var(--panel);
    border-radius:12px;
    display:none;
    flex-direction:column;
    justify-content:center;
    gap:5px;
    padding:0 10px;
    cursor:pointer;
}

.menu-toggle span{
    display:block;
    height:2px;
    border-radius:2px;
    background:#fff;
}

.topbar-title{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.topbar-title-main{
    font-weight:700;
    font-size:18px;
}

.topbar-title-sub{
    color:var(--muted);
    font-size:12px;
}

.page-wrap{
    width:min(calc(100% - 32px), var(--content-w));
    margin:0 auto;
    padding:28px 0 40px;
    flex:1;
}

.page-head{
    margin-bottom:18px;
}

.page-head h1{
    margin:0;
    font-size:34px;
    line-height:1.1;
}

.page-subtitle{
    margin:8px 0 0;
    color:var(--muted);
}

.card{
    background:linear-gradient(180deg,var(--panel) 0%, #111a2d 100%);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:22px;
    box-shadow:var(--shadow);
    margin-bottom:20px;
}

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

.card-head h3{
    margin:0;
    font-size:22px;
}

.muted-pill{
    padding:8px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.06);
    color:var(--muted);
    font-size:12px;
}

.info-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}

.info-box{
    background:var(--panel-3);
    border:1px solid var(--border);
    border-radius:16px;
    padding:16px;
}

.info-box-label{
    font-size:12px;
    color:var(--muted);
    margin-bottom:8px;
}

.info-box-value{
    font-size:18px;
    font-weight:700;
    word-break:break-word;
}

.status-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.status-active,
.status-trial{
    background:rgba(25,195,125,.14);
    color:#7bf0bc;
}

.status-expired,
.status-blocked,
.status-none{
    background:rgba(255,10,98,.14);
    color:#ff7aa9;
}

.provider-lock{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.provider-box{
    background:var(--panel-3);
    border:1px solid var(--border);
    border-radius:16px;
    padding:16px;
}

.playlist-list{
    display:grid;
    gap:14px;
}

.playlist-card{
    background:var(--panel-3);
    border:1px solid var(--border);
    border-radius:16px;
    padding:16px;
}

.playlist-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:10px;
}

.playlist-title{
    font-size:18px;
    font-weight:700;
}

.playlist-sub{
    color:var(--muted);
    font-size:13px;
    line-height:1.45;
    word-break:break-all;
}

.playlist-meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}

.meta-pill{
    background:rgba(255,255,255,.06);
    color:#dce3f1;
    border-radius:999px;
    padding:6px 10px;
    font-size:12px;
}

.badge-default{
    display:inline-flex;
    align-items:center;
    background:rgba(25,195,125,.16);
    color:#89f4c4;
    border:1px solid rgba(25,195,125,.28);
    border-radius:999px;
    padding:6px 10px;
    font-size:11px;
    font-weight:700;
    letter-spacing:.04em;
    text-transform:uppercase;
}

.playlist-actions{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    margin-top:14px;
}

.tabs{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin-bottom:14px;
}

.tab{
    border:1px solid var(--border);
    background:var(--panel-3);
    color:#dce3f1;
    padding:13px 14px;
    border-radius:14px;
    cursor:pointer;
    transition:.18s ease;
}

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

.form-stack{
    display:grid;
    gap:12px;
}

input{
    width:100%;
    background:#0d1527;
    border:1px solid var(--border);
    color:#fff;
    border-radius:14px;
    padding:14px 15px;
    outline:none;
    transition:.18s ease;
}

input:focus{
    border-color:rgba(255,10,98,.5);
    box-shadow:0 0 0 3px rgba(255,10,98,.12);
}

.inline-actions{
    display:flex;
    gap:10px;
}

.btn{
    width:100%;
    border:none;
    border-radius:14px;
    padding:13px 16px;
    cursor:pointer;
    font-weight:600;
    transition:.18s ease;
}

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

.btn-primary{
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    color:#fff;
    box-shadow:0 10px 24px rgba(255,10,98,.22);
}

.btn-secondary{
    background:#2a3551;
    color:#edf1fb;
}

.btn-ghost{
    background:#1a243b;
    color:#edf1fb;
}

.site-footer{
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:20px 24px 28px;
    color:var(--muted);
    font-size:13px;
    border-top:1px solid var(--border);
}

.toast{
    position:fixed;
    right:20px;
    bottom:20px;
    min-width:260px;
    max-width:420px;
    padding:14px 16px;
    border-radius:14px;
    background:#151f35;
    border:1px solid var(--border);
    box-shadow:var(--shadow);
    color:#fff;
    opacity:0;
    transform:translateY(10px);
    pointer-events:none;
    transition:.22s ease;
    z-index:120;
}

.toast.show{
    opacity:1;
    transform:translateY(0);
}

.modal-backdrop{
    position:fixed;
    inset:0;
    background:rgba(2,7,14,.72);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:100;
}

.modal-card{
    width:min(100%, 560px);
    background:linear-gradient(180deg,var(--panel) 0%, #111a2d 100%);
    border:1px solid var(--border);
    border-radius:22px;
    box-shadow:var(--shadow);
    padding:22px;
}

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

.modal-head h3{
    margin:0;
}

.modal-close{
    width:42px;
    height:42px;
    border:none;
    border-radius:12px;
    background:#1a243b;
    color:#fff;
    font-size:24px;
    cursor:pointer;
}

.modal-actions{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin-top:16px;
}

.empty-state{
    padding:16px;
    border-radius:16px;
    background:var(--panel-3);
    border:1px dashed var(--border);
    color:var(--muted);
}

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

    .playlist-actions{
        grid-template-columns:1fr;
    }
}

@media (max-width: 860px){
    .sidebar{
        transform:translateX(-100%);
        transition:.24s ease;
    }

    .sidebar.open{
        transform:translateX(0);
    }

    .sidebar-overlay{
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.42);
        z-index:40;
    }

    .sidebar-overlay.show{
        display:block;
    }

    .app-main{
        margin-left:0;
    }

    .menu-toggle{
        display:flex;
    }

    .page-wrap{
        width:min(calc(100% - 24px), var(--content-w));
        padding:20px 0 28px;
    }

    .page-head h1{
        font-size:28px;
    }

    .site-footer{
        flex-direction:column;
        align-items:flex-start;
    }
}

@media (max-width: 520px){
    .topbar{
        padding:0 14px;
    }

    .card{
        padding:16px;
        border-radius:16px;
    }

    .card-head h3{
        font-size:19px;
    }

    .playlist-top{
        flex-direction:column;
    }

    .modal-actions{
        grid-template-columns:1fr;
    }

    .toast{
        left:12px;
        right:12px;
        bottom:12px;
        min-width:auto;
        max-width:none;
    }
}

.playlist-credentials{
margin-top:10px;
border-top:1px solid rgba(255,255,255,0.08);
padding-top:10px;
}

.cred-row{
display:flex;
justify-content:space-between;
margin:4px 0;
font-size:14px;
}

.cred-label{
opacity:.6;
}

.password{
font-family:monospace;
letter-spacing:1px;
}

.playlist-credentials{
margin-top:14px;
padding-top:12px;
border-top:1px solid rgba(255,255,255,0.08);
}

.cred-inline{
display:flex;
gap:40px;
}

.cred-col{
flex:1;
}

.cred-label{
font-size:12px;
opacity:.6;
margin-bottom:3px;
}

.cred-value{
font-size:14px;
font-weight:500;
}

.password{
font-family:monospace;
letter-spacing:1px;
}

.badge-default{
background:#1ecb81;
color:#fff;
font-size:12px;
padding:4px 10px;
border-radius:20px;
font-weight:600;
}
.playlist-card.default{
border:1px solid rgba(30,203,129,.45);
box-shadow:0 0 0 1px rgba(30,203,129,.18), 0 0 22px rgba(30,203,129,.08);
background:linear-gradient(180deg, rgba(30,203,129,.06), rgba(30,203,129,.02));
}
.playlist-card.default .playlist-title{
color:#bff5dc;
}