/* =========================================================================
   Softebnid — UI styles (login + dashboard)
   ========================================================================= */

:root {
    --c-indigo: #6366f1;
    --c-indigo-d: #4f46e5;
    --c-violet: #8b5cf6;
    --c-emerald: #10b981;
    --c-amber: #f59e0b;
    --c-sky: #0ea5e9;
    --c-rose: #f43f5e;

    --bg: #f4f5fb;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-2: #475569;
    --ink-3: #94a3b8;
    --line: #e6e8f0;

    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 30px 60px -20px rgba(79, 70, 229, .35);
    --sidebar-w: 264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

/* ---- Brand ------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 11px;
    font-weight: 800; font-size: 19px; color: #fff;
    background: linear-gradient(135deg, var(--c-indigo), var(--c-violet));
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, .6);
}
.brand__name { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }

/* =========================================================================
   AUTH (login)
   ========================================================================= */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 100% 0%, rgba(139, 92, 246, .12), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(99, 102, 241, .12), transparent 55%),
        var(--bg);
}

.auth-shell {
    width: min(1040px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, .6);
}

/* Hero panel */
.auth-hero {
    position: relative;
    padding: 48px;
    color: #fff;
    background: linear-gradient(150deg, #4f46e5 0%, #6366f1 42%, #8b5cf6 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-hero__glow {
    position: absolute; inset: 0;
    background:
        radial-gradient(420px 420px at 80% 10%, rgba(255, 255, 255, .25), transparent 60%),
        radial-gradient(380px 380px at 10% 90%, rgba(255, 255, 255, .12), transparent 60%);
    pointer-events: none;
}
.auth-hero__content { position: relative; z-index: 1; }
.auth-hero .brand { margin-bottom: 56px; }
.auth-hero .brand__mark { background: rgba(255, 255, 255, .18); box-shadow: none; backdrop-filter: blur(4px); }
.auth-hero__title { font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.auth-hero__subtitle { margin-top: 16px; font-size: 15.5px; line-height: 1.6; color: rgba(255, 255, 255, .85); max-width: 38ch; }
.auth-hero__points { list-style: none; margin-top: 32px; display: grid; gap: 14px; }
.auth-hero__points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: rgba(255, 255, 255, .92); }
.auth-hero__points span {
    width: 22px; height: 22px; flex: none; display: grid; place-items: center;
    border-radius: 50%; background: rgba(255, 255, 255, .2); font-size: 12px;
}
.auth-hero__foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255, 255, 255, .7); }

/* Form panel */
.auth-form-panel { display: grid; place-items: center; padding: 48px; }
.auth-card { width: min(380px, 100%); }
.auth-card__head h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-card__head p { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; }
.auth-card form { margin-top: 28px; }
.auth-card__foot { margin-top: 26px; text-align: center; font-size: 14px; color: var(--ink-2); }
.auth-card__foot a { color: var(--c-indigo-d); font-weight: 600; }

/* Fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.field__row { display: flex; align-items: center; justify-content: space-between; }
.field__link { font-size: 13px; color: var(--c-indigo-d); font-weight: 600; }
.field__control {
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px; height: 50px;
    background: #f8f9fd;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s, background .15s;
    color: var(--ink-3);
}
.field__control:focus-within {
    border-color: var(--c-indigo);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
.field__control input {
    flex: 1; border: 0; background: transparent; outline: 0;
    font: inherit; font-size: 15px; color: var(--ink);
}
.field__control input::placeholder { color: var(--ink-3); }
.field__toggle { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; padding: 4px; }
.field__toggle.is-active { color: var(--c-indigo); }

.checkbox { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); margin: 6px 0 22px; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--c-indigo); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 50px; padding: 0 22px;
    border: 0; border-radius: var(--radius-sm);
    font: inherit; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: transform .08s, box-shadow .15s, opacity .15s;
}
.btn--block { width: 100%; }
.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--c-indigo), var(--c-violet));
    box-shadow: 0 12px 24px -10px rgba(99, 102, 241, .7);
}
.btn--primary:hover { box-shadow: 0 16px 30px -10px rgba(99, 102, 241, .8); }
.btn--primary:active { transform: translateY(1px); }

/* Button variants ------------------------------------------------------- */
.btn--ghost {
    background: #fff; color: var(--ink); border: 1.5px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: #cfd4e6; background: #fafbff; }
.btn--danger {
    background: #fff; color: var(--c-rose); border: 1.5px solid #fecdd3;
}
.btn--danger:hover { background: #fff1f2; border-color: #fda4af; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }

/* Form controls: textarea + select reuse the field shell --------------- */
textarea,
.field__control select {
    width: 100%; font: inherit; color: var(--ink);
}
textarea {
    font-size: 14.5px; padding: 12px 14px; line-height: 1.5;
    background: #f8f9fd; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); outline: 0; resize: vertical;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea:focus {
    border-color: var(--c-indigo); background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
.field__control select {
    border: 0; background: transparent; outline: 0; font-size: 15px;
    cursor: pointer; appearance: none;
}
.field__control input[type="file"] { border: 0; background: transparent; font-size: 14px; color: var(--ink-2); }
.field code { background: #eef1f8; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

.badge--amber { background: rgba(245, 158, 11, .14); color: #b45309; }

/* Progress bar ---------------------------------------------------------- */
.progress { height: 10px; background: #eef1f8; border-radius: 999px; overflow: hidden; }
.progress__bar {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--c-indigo), var(--c-violet));
    transition: width .4s ease;
}

/* Modal (campaign preview) --------------------------------------------- */
.modal {
    display: none; position: fixed; inset: 0; z-index: 60;
    background: rgba(15, 18, 34, .55); padding: 24px;
    place-items: center;
}
.modal.is-open { display: grid; }
.modal__box {
    width: min(720px, 100%); background: #fff;
    border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal__head h3 { font-size: 16px; font-weight: 700; }
.modal__close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--ink-3); }

/* Alerts */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 18px;
}
.alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert--success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* =========================================================================
   APP (dashboard)
   ========================================================================= */
.app-body { background: var(--bg); }
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w); flex: none;
    background: #0f1222;
    color: #cdd2e6;
    display: flex; flex-direction: column;
    padding: 22px 16px;
    position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; color: #fff; }
.nav { flex: 1; }
.nav__label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #5b618a; padding: 8px 12px; }
.nav__item {
    display: flex; align-items: center; gap: 13px;
    padding: 11px 12px; border-radius: 11px;
    font-size: 14.5px; font-weight: 500; color: #aab0cf;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.nav__item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav__item.is-active {
    background: linear-gradient(135deg, var(--c-indigo), var(--c-violet));
    color: #fff;
    box-shadow: 0 10px 22px -10px rgba(99, 102, 241, .8);
}
.nav__item svg { flex: none; }
.sidebar__foot { border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 14px; }
.nav__item--muted { color: #8089ad; }

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

/* Topbar */
.topbar {
    display: flex; align-items: center; gap: 18px;
    padding: 18px 28px;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar__menu { display: none; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.topbar__title h1 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.topbar__title p { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.search { display: flex; align-items: center; gap: 9px; padding: 0 14px; height: 42px; background: #f1f3fa; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-3); }
.search input { border: 0; background: transparent; outline: 0; font: inherit; font-size: 14px; width: 190px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }

.user-chip { display: flex; align-items: center; gap: 11px; }
.avatar {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
    background: linear-gradient(135deg, var(--c-violet), var(--c-indigo));
}
.avatar--sm { width: 34px; height: 34px; font-size: 12.5px; }
.user-chip__meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip__meta strong { font-size: 14px; }
.user-chip__meta small { font-size: 12px; color: var(--ink-3); text-transform: capitalize; }

/* Content */
.content { padding: 28px; max-width: 1280px; width: 100%; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card__head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.stat { position: relative; overflow: hidden; }
.stat__dot { position: absolute; top: 22px; right: 22px; width: 10px; height: 10px; border-radius: 50%; }
.stat__label { font-size: 13.5px; color: var(--ink-2); }
.stat__value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 12px; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge--green { background: rgba(16, 185, 129, .12); color: #047857; }
.badge--gray { background: #eef1f8; color: var(--ink-2); }
.badge--indigo { background: rgba(99, 102, 241, .12); color: var(--c-indigo-d); text-transform: capitalize; }

/* Grid + chart */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 10px; }
.chart__bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.chart__bar { width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--c-violet), var(--c-indigo)); transition: opacity .15s; }
.chart__bar:hover { opacity: .8; }
.chart__bar-wrap span { font-size: 12px; color: var(--ink-3); }

/* Quick actions */
.actions-list { display: grid; gap: 10px; }
.action { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; font-weight: 500; transition: background .15s, border-color .15s; }
.action:hover { background: #f8f9fd; border-color: #d9ddee; }
.action__ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; font-size: 16px; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.cell-user { display: flex; align-items: center; gap: 11px; }
.empty { text-align: center; color: var(--ink-3); padding: 28px; }

/* Empty state */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state__ico { font-size: 46px; }
.empty-state h3 { margin-top: 14px; font-size: 19px; }
.empty-state p { margin: 8px 0 22px; color: var(--ink-2); }

/* Overlay (mobile) */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15, 18, 34, .5); z-index: 40; }
.overlay.is-visible { display: block; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 920px) {
    .auth-shell { grid-template-columns: 1fr; min-height: 0; }
    .auth-hero { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 50;
        transform: translateX(-100%); transition: transform .25s ease;
    }
    .sidebar.is-open { transform: translateX(0); }
    .topbar__menu { display: grid; place-items: center; }
    .search { display: none; }
    .user-chip__meta { display: none; }
    .content { padding: 20px; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .auth-form-panel { padding: 32px 24px; }
}
