/* assets/css/admin.css */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
    --bg:          #0d0f14;
    --surface:     #161a23;
    --surface2:    #1e2330;
    --border:      #2a3045;
    --accent:      #4f8ef7;
    --accent-glow: rgba(79,142,247,.18);
    --accent-dark: #3a72d8;
    --success:     #34d399;
    --error:       #f87171;
    --text:        #e8ecf4;
    --muted:       #8892a4;
    --radius:      10px;
    --shadow:      0 4px 24px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* ── Login page ─────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,142,247,.22) 0%, transparent 70%),
        var(--bg);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.6rem 2.4rem;
    box-shadow: var(--shadow), 0 0 60px rgba(79,142,247,.08);
}

.login-logo {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 2rem;
}

.login-logo .logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), #7c4dff);
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 17px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}

.login-logo .logo-text {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

.login-card h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.03em;
    margin-bottom: .35rem;
}

.login-card .subtitle {
    color: var(--muted);
    font-size: .875rem;
    margin-bottom: 1.8rem;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-label {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .4rem;
}

.form-control, .form-control:focus {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: .65rem 1rem;
    font-size: .925rem;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--surface2);
    color: var(--text);
}

.form-control::placeholder { color: #4a5468; }

textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: inherit;
    font-size: .925rem;
    font-weight: 600;
    padding: .7rem 1.4rem;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    display: inline-flex; align-items: center; gap: .45rem;
    letter-spacing: -.01em;
}
.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 16px rgba(79,142,247,.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    font-family: inherit;
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem 1rem;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    display: inline-flex; align-items: center; gap: .4rem;
}
.btn-outline:hover { border-color: var(--muted); color: var(--text); }

.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius);
    padding: .75rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: 1.25rem;
}
.alert-error   { background: rgba(248,113,113,.12); color: var(--error);   border: 1px solid rgba(248,113,113,.25); }
.alert-success { background: rgba(52,211,153,.12);  color: var(--success); border: 1px solid rgba(52,211,153,.25); }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(13,15,20,.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
}

.topbar-brand {
    display: flex; align-items: center; gap: .6rem;
    font-weight: 600; font-size: 1rem; letter-spacing: -.02em;
}

.topbar-brand .logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent), #7c4dff);
    border-radius: 7px;
    display: grid; place-items: center;
    font-size: 14px; font-weight: 700; color: #fff;
}

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

.user-pill {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: .3rem .75rem;
    font-size: .8rem;
    color: var(--muted);
    display: flex; align-items: center; gap: .4rem;
}

/* ── Dashboard layout ───────────────────────────────────── */
.dash-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.04em;
    margin-bottom: .2rem;
}

.page-header p { color: var(--muted); font-size: .9rem; margin: 0; }

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1.5rem;
}

/* ── Section card ───────────────────────────────────────── */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.8rem;
    transition: box-shadow .25s;
}

.section-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.section-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.4rem;
}

.card-index {
    font-family: 'DM Mono', monospace;
    font-size: .7rem;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(79,142,247,.25);
    border-radius: 6px;
    padding: .2rem .55rem;
    letter-spacing: .06em;
}

.card-updated {
    font-size: .75rem;
    color: var(--muted);
}

.mb-field { margin-bottom: 1.1rem; }

.price-wrap {
    position: relative;
}
.price-wrap .currency {
    position: absolute;
    left: .9rem; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-weight: 600;
    pointer-events: none;
    font-size: .9rem;
}
.price-wrap .form-control { padding-left: 1.8rem; }

/* ── Checkout URL + copy button ─────────────────────────── */
.url-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, box-shadow .2s;
}

.url-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.url-field {
    font-family: 'DM Mono', monospace;
    font-size: .8rem;
    color: var(--muted);
    cursor: text;
    flex: 1 1 0%;
    width: auto;
    min-width: 0;
    background: transparent;
    border: none;
    padding: .65rem 0 .65rem 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-field:focus {
    box-shadow: none;
    border: none;
    background: transparent;
}

.btn-copy {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--muted);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    height: 100%;
    padding: .65rem .9rem;
    margin: 0;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: .35rem;
    transition: color .2s, background .2s;
    white-space: nowrap;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-copy:hover {
    color: var(--accent);
    background: rgba(79,142,247,.08);
}

.btn-copy.copied {
    color: var(--success);
    background: rgba(52,211,153,.1);
}

.btn-copy .icon-check { color: var(--success); }

@media (max-width: 420px) {
    .btn-copy .copy-label { display: none; }
    .btn-copy { padding: .65rem .8rem; }
}

.card-footer-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.save-feedback {
    font-size: .8rem;
    color: var(--success);
    opacity: 0;
    transition: opacity .4s;
    display: flex; align-items: center; gap: .3rem;
}

.save-feedback.show { opacity: 1; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .topbar { padding: 0 1rem; }
    .dash-main { padding: 1.5rem 1rem 3rem; }
    .section-card { padding: 1.4rem; }
    .login-card { padding: 2rem 1.4rem; }
}