*{box-sizing:border-box}

body{
    margin:0;
    font-family:Inter,Arial,sans-serif;
    background:#f5f7fb;
    color:#081a3a;
    overflow-x:hidden;
}

a{
    color:inherit;
    text-decoration:none;
}

.muted{color:#64748b}

/* AUTH */
.auth-page{
    min-height:100vh;
    display:grid;
    grid-template-columns:1fr 1fr;
    background:#f5f7fb;
}

.auth-brand{
    background:linear-gradient(135deg,#081a3a,#0b5cff);
    color:white;
    padding:70px;
    display:flex;
    flex-direction:column;
    justify-content:center;
}

.auth-brand h1{
    font-size:52px;
    line-height:1.05;
    margin:0 0 20px;
    letter-spacing:-1.5px;
}

.auth-brand p{
    font-size:18px;
    line-height:1.7;
    opacity:.92;
    max-width:580px;
}

.auth-card-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:40px;
}

.auth-card{
    width:100%;
    max-width:460px;
    background:white;
    border-radius:26px;
    padding:38px;
    box-shadow:0 20px 60px rgba(8,26,58,.12);
}

.auth-card h2{
    margin:0 0 8px;
    font-size:30px;
    letter-spacing:-.5px;
}

.auth-switch{
    text-align:center;
    margin-top:22px;
    color:#64748b;
}

.auth-switch a{
    color:#0b5cff;
    font-weight:800;
}

/* FORMS */
.form-group{margin:18px 0}

.form-group label{
    display:block;
    margin-bottom:8px;
    font-weight:800;
    font-size:14px;
}

.form-control{
    width:100%;
    border:1px solid #d9e1ef;
    border-radius:14px;
    padding:15px 16px;
    font-size:15px;
    outline:none;
    transition:.2s;
    background:white;
}

textarea.form-control{
    resize:vertical;
    font-family:inherit;
}

.email-editor{
    min-height:330px;
    font-family:Consolas,monospace;
    line-height:1.6;
}

.form-control:focus{
    border-color:#0b5cff;
    box-shadow:0 0 0 4px rgba(11,92,255,.08);
}

.btn{
    display:inline-flex;
    justify-content:center;
    align-items:center;
    border:0;
    border-radius:14px;
    padding:15px 20px;
    cursor:pointer;
    font-weight:900;
    font-size:15px;
    background:#0b5cff;
    color:white;
    transition:.2s;
}

.btn:hover{
    background:#084bd2;
    transform:translateY(-1px);
}

.btn:disabled{
    opacity:.55;
    cursor:not-allowed;
}

.btn-primary{width:100%}

.small-btn{
    width:auto;
    padding:12px 16px;
    font-size:14px;
}

.secondary-btn{
    background:#eef4ff;
    color:#0b5cff;
}

.secondary-btn:hover{
    background:#dbeafe;
    color:#0b5cff;
}

.dark-btn{
    background:#081a3a;
    color:white;
}

.dark-btn:hover{
    background:#102a58;
}

.button-row{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

/* ALERT */
.alert{
    padding:14px 15px;
    border-radius:14px;
    margin:16px 0;
    font-size:14px;
    line-height:1.5;
}

.alert-error{
    background:#fee2e2;
    color:#991b1b;
}

.alert-success{
    background:#dcfce7;
    color:#166534;
}

/* DASHBOARD */
.dashboard{
    min-height:100vh;
    display:grid;
    grid-template-columns:270px 1fr;
}

.sidebar{
    background:#081a3a;
    color:white;
    padding:28px;
}

.sidebar-top{display:block}

.logo{
    font-size:24px;
    font-weight:900;
    margin-bottom:40px;
    line-height:1.3;
}

.nav-link{
    display:block;
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:8px;
    color:#dbeafe;
    font-weight:600;
}

.nav-link.active,
.nav-link:hover{
    background:rgba(255,255,255,.12);
    color:white;
}

.main{
    padding:32px;
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:34px;
    gap:20px;
}

.topbar h1{
    margin:0 0 10px;
    font-size:42px;
    letter-spacing:-1px;
}

.top-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.user-pill{
    display:flex;
    align-items:center;
    gap:12px;
    background:white;
    border-radius:999px;
    padding:8px 16px 8px 8px;
    box-shadow:0 10px 35px rgba(8,26,58,.08);
}

.avatar{
    width:42px;
    height:42px;
    background:#0b5cff;
    color:white;
    border-radius:50%;
    display:grid;
    place-items:center;
    font-weight:900;
}

/* CARDS */
.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:22px;
}

.stat-card,
.panel{
    background:white;
    border-radius:24px;
    padding:24px;
    box-shadow:0 14px 45px rgba(8,26,58,.08);
}

.stat-card span{
    color:#64748b;
    font-size:14px;
    font-weight:800;
}

.stat-card h3{
    margin:12px 0 0;
    font-size:32px;
}

.panel{margin-top:24px}

.narrow-panel{max-width:720px}

.actions-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-top:16px;
}

.action-box{
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:20px;
    background:#fbfdff;
    display:block;
    transition:.2s;
}

.action-box:hover{
    border-color:#0b5cff;
    transform:translateY(-2px);
}

.action-box h4{margin:0 0 8px}

.action-box p{
    margin:0;
    color:#64748b;
    line-height:1.5;
}

/* TABLES */
.form-grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:18px;
}

.filter-form{
    display:grid;
    grid-template-columns:2fr 1fr 1fr auto;
    gap:12px;
    align-items:center;
    margin-bottom:20px;
}

.table-wrap{overflow-x:auto}

.data-table{
    width:100%;
    border-collapse:collapse;
    min-width:850px;
}

.data-table th{
    text-align:left;
    font-size:13px;
    color:#64748b;
    padding:14px 12px;
    border-bottom:1px solid #e5e7eb;
}

.data-table td{
    padding:16px 12px;
    border-bottom:1px solid #eef2f7;
    font-size:14px;
    vertical-align:top;
}

.empty-state{
    text-align:center;
    color:#64748b;
    padding:35px!important;
}

.status-badge{
    display:inline-flex;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:900;
    text-transform:capitalize;
}

.status-subscribed,
.status-active,
.status-sent{
    background:#dcfce7;
    color:#166534;
}

.status-unsubscribed,
.status-inactive,
.status-draft{
    background:#fef3c7;
    color:#92400e;
}

.status-queued,
.status-sending{
    background:#dbeafe;
    color:#1d4ed8;
}

.status-failed,
.status-bounced{
    background:#fee2e2;
    color:#991b1b;
}

.status-paused,
.status-complained{
    background:#ede9fe;
    color:#5b21b6;
}

.danger-link{
    color:#dc2626!important;
    font-weight:900;
}

.action-links{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.action-links a{
    color:#0b5cff;
    font-weight:900;
}

.code-box{
    background:#081a3a;
    color:#dbeafe;
    padding:18px;
    border-radius:16px;
    overflow:auto;
    line-height:1.7;
}

/* MOBILE MENU DEFAULT HIDDEN */
.mobile-menu-btn,
.mobile-close-btn,
.mobile-overlay{
    display:none;
}

/* MOBILE RESPONSIVE FIX */
@media(max-width:900px){

    .auth-page{
        grid-template-columns:1fr;
    }

    .auth-brand{
        padding:40px 28px;
    }

    .auth-brand h1{
        font-size:36px;
    }

    .dashboard{
        display:block;
        min-height:100vh;
    }

    .main{
        width:100%!important;
        margin-left:0!important;
        padding:92px 22px 28px!important;
    }

    .mobile-menu-btn{
        display:flex!important;
        align-items:center;
        justify-content:center;
        position:fixed;
        top:14px;
        left:14px;
        z-index:99999;
        width:auto;
        min-width:105px;
        height:48px;
        padding:0 18px;
        border:0;
        border-radius:16px;
        background:#0b5cff;
        color:#fff;
        font-size:16px;
        font-weight:900;
        line-height:1;
        box-shadow:0 14px 35px rgba(8,26,58,.25);
        cursor:pointer;
    }

    .sidebar{
        display:block!important;
        position:fixed!important;
        top:0!important;
        left:-290px!important;
        width:270px!important;
        height:100vh!important;
        background:#081a3a!important;
        color:white!important;
        z-index:100000!important;
        padding:28px!important;
        overflow-y:auto!important;
        transition:left .25s ease!important;
        box-shadow:14px 0 40px rgba(8,26,58,.25);
    }

    .sidebar.mobile-open,
    .sidebar.open{
        left:0!important;
    }

    .sidebar-top{
        display:flex;
        justify-content:space-between;
        align-items:flex-start;
        gap:12px;
        margin-bottom:20px;
    }

    .logo{
        margin-bottom:20px;
    }

    .mobile-close-btn{
        display:flex!important;
        align-items:center;
        justify-content:center;
        width:40px;
        height:40px;
        border:0;
        border-radius:999px;
        background:rgba(255,255,255,.14);
        color:white;
        font-size:30px;
        line-height:1;
        cursor:pointer;
    }

    .mobile-overlay{
        display:none;
        position:fixed;
        inset:0;
        background:rgba(8,26,58,.45);
        z-index:99998;
    }

    .mobile-overlay.show-overlay,
    .mobile-overlay.show{
        display:block!important;
    }

    .nav-link{
        display:block!important;
        color:#dbeafe!important;
        padding:14px 16px!important;
        border-radius:14px!important;
        margin-bottom:8px!important;
    }

    .nav-link.active,
    .nav-link:hover{
        background:rgba(255,255,255,.12)!important;
        color:white!important;
    }

    .topbar{
        align-items:flex-start;
        gap:16px;
        flex-direction:column;
    }

    .topbar h1{
        font-size:34px;
    }

    .stats-grid,
    .actions-grid,
    .filter-form,
    .form-grid-2{
        grid-template-columns:1fr;
    }

    .top-actions{
        width:100%;
    }

    .top-actions .btn{
        flex:1;
    }

    .stat-card,
    .panel{
        border-radius:22px;
    }
}