/* ==========================================================================
   LPMS Admin — Bootstrap 5 üzerine özel tasarım katmanı
   ========================================================================== */
:root {
    --lp-sidebar-w: 260px;
    --lp-bg: #f4f6fb;
    --lp-surface: #ffffff;
    --lp-border: #e6e9f2;
    --lp-text: #1d2433;
    --lp-muted: #6b7489;
    --lp-primary: #4f46e5;
    --lp-primary-soft: #eef0ff;
    --lp-sidebar: #0f172a;
    --lp-sidebar-2: #111c38;
    --lp-radius: 14px;
    --lp-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.admin { background: var(--lp-bg); color: var(--lp-text); font-size: .925rem; }
.btn-primary { --bs-btn-bg: var(--lp-primary); --bs-btn-border-color: var(--lp-primary); --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; }
.btn-outline-primary { --bs-btn-color: var(--lp-primary); --bs-btn-border-color: #c7c9f9; --bs-btn-hover-bg: var(--lp-primary); --bs-btn-hover-border-color: var(--lp-primary); }
.form-control:focus, .form-select:focus { border-color: #a5a8f5; box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.form-check-input:checked { background-color: var(--lp-primary); border-color: var(--lp-primary); }
.form-label.required::after { content: " *"; color: #dc3545; }

/* Layout ------------------------------------------------------------------ */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--lp-sidebar-w); z-index: 1040;
    background: linear-gradient(180deg, var(--lp-sidebar) 0%, var(--lp-sidebar-2) 100%);
    color: #cbd5e1; display: flex; flex-direction: column; transition: transform .25s ease;
}
.admin-main { flex: 1; margin-left: var(--lp-sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.admin-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.admin-brand__logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, #6366f1, #a855f7); box-shadow: 0 6px 18px rgba(99, 102, 241, .35); }
.admin-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.admin-brand__text strong { letter-spacing: .06em; }
.admin-brand__text small { color: #94a3b8; font-size: .75rem; }
.admin-nav { padding: .5rem .75rem; flex: 1; overflow-y: auto; }
.admin-nav__label { text-transform: uppercase; font-size: .68rem; letter-spacing: .12em; color: #64748b; padding: 1rem .75rem .4rem; }
.admin-nav__link { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; color: #cbd5e1; text-decoration: none; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.admin-nav__link i { font-size: 1.05rem; opacity: .85; }
.admin-nav__link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav__link.is-active { background: rgba(99, 102, 241, .22); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.admin-sidebar__footer { padding: 1rem 1.25rem; font-size: .78rem; color: #64748b; border-top: 1px solid rgba(255, 255, 255, .06); }

.admin-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .85rem 1.75rem; background: rgba(244, 246, 251, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--lp-border); }
.admin-topbar__title { font-size: 1.05rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-content { padding: 1.75rem; flex: 1; }
.admin-footer { display: flex; justify-content: space-between; padding: 1rem 1.75rem; font-size: .78rem; color: var(--lp-muted); }

.btn-icon { border: 0; font-size: 1.4rem; padding: .1rem .4rem; }
.btn-user { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--lp-border); background: #fff; border-radius: 999px; padding: .25rem .75rem .25rem .25rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--lp-primary-soft); color: var(--lp-primary); font-weight: 700; font-size: .85rem; flex: none; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-main { margin-left: 0; }
    body.sidebar-open .admin-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
    .admin-content { padding: 1.1rem; }
    .admin-topbar { padding: .75rem 1rem; }
}

/* Page header ------------------------------------------------------------ */
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.page-header__title { font-size: 1.45rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-header__subtitle { color: var(--lp-muted); margin: .25rem 0 0; }
.page-header__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Cards ------------------------------------------------------------------ */
.card-panel { border: 1px solid var(--lp-border); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow); background: var(--lp-surface); }
.card-panel > .card-header { background: transparent; border-bottom: 1px solid var(--lp-border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1.1rem; }
.card-panel > .card-footer { background: #fafbfe; border-top: 1px solid var(--lp-border); }
.card-title { font-size: .95rem; font-weight: 600; margin: 0; display: flex; gap: .5rem; align-items: center; }
.card-title i { color: var(--lp-primary); }

/* KPI ------------------------------------------------------------------- */
.kpi { position: relative; background: var(--lp-surface); border: 1px solid var(--lp-border); border-radius: var(--lp-radius); padding: 1.1rem 1.2rem; box-shadow: var(--lp-shadow); height: 100%; }
.kpi__icon { position: absolute; right: 1rem; top: 1rem; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; }
.kpi__label { color: var(--lp-muted); font-size: .8rem; font-weight: 500; }
.kpi__value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; margin: .2rem 0; }
.kpi__meta { font-size: .78rem; color: var(--lp-muted); }
.kpi__change.is-up { color: #059669; font-weight: 600; }
.kpi__change.is-down { color: #dc2626; font-weight: 600; }
.bg-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); }
.bg-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.bg-amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.bg-rose { background: linear-gradient(135deg, #e11d48, #fb7185); }

.stat-strip { display: flex; flex-direction: column; background: var(--lp-surface); border: 1px solid var(--lp-border); border-radius: var(--lp-radius); padding: .9rem 1.1rem; box-shadow: var(--lp-shadow); }
.stat-strip__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--lp-muted); }
.stat-strip__value { font-size: 1.35rem; font-weight: 700; }
.stat-strip__sub { font-size: .78rem; color: var(--lp-muted); }

/* Tables ---------------------------------------------------------------- */
.table-modern { --bs-table-bg: transparent; }
.table-modern thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lp-muted); font-weight: 600; background: #fafbfe; border-bottom: 1px solid var(--lp-border); padding: .7rem 1rem; white-space: nowrap; }
.table-modern td { padding: .8rem 1rem; border-color: #eef0f6; }
.table-modern tbody tr:hover { background: #fafbff; }
.badge-soft { font-weight: 600; letter-spacing: .01em; }
.domain-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lp-primary); display: inline-block; flex: none; }
.progress-thin { height: 5px; background: #eef0f6; }
.progress-thin .progress-bar { background: linear-gradient(90deg, #6366f1, #a855f7); }

/* Bar list / timeline ---------------------------------------------------- */
.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.bar-list__row { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .3rem; }
.bar-list__track { height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.bar-list__track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0ea5e9, #6366f1); border-radius: 99px; transition: width .6s ease; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid #eef0f6; display: grid; gap: .85rem; }
.timeline li { position: relative; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--lp-primary); }
.timeline__action { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.timeline__meta { font-size: .75rem; color: var(--lp-muted); }

/* Charts ---------------------------------------------------------------- */
.chart { position: relative; width: 100%; display: flex; flex-direction: column; }
.chart svg { display: block; width: 100%; flex: 1 1 auto; min-height: 0; overflow: visible; }
.chart .axis text { fill: #94a3b8; font-size: 11px; }
.chart .grid line { stroke: #eef0f6; }
.chart-legend { flex: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .78rem; color: var(--lp-muted); margin-top: .5rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tooltip { position: absolute; pointer-events: none; background: #0f172a; color: #fff; font-size: .75rem; padding: .45rem .6rem; border-radius: 8px; box-shadow: 0 8px 20px rgba(15, 23, 42, .25); white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; z-index: 5; }
.chart-tooltip.is-visible { opacity: 1; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--lp-muted); font-size: .85rem; }

/* Empty state ------------------------------------------------------------ */
.empty-state { text-align: center; padding: 2rem 1rem; }
.empty-state__icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; color: var(--lp-primary); background: var(--lp-primary-soft); }
.empty-state h3 { font-size: 1.05rem; font-weight: 600; }
.empty-state p { color: var(--lp-muted); max-width: 420px; margin: 0 auto 1rem; }

/* Landing page cards ----------------------------------------------------- */
.lp-card { overflow: hidden; }
.lp-card.is-inactive { opacity: .7; }
.lp-card__preview { position: relative; height: 220px; overflow: hidden; background: #eef0f6; border-bottom: 1px solid var(--lp-border); }
.lp-card__preview iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 880px; border: 0; transform: scale(.32); transform-origin: 0 0; pointer-events: none; }
@media (min-width: 1400px) { .lp-card__preview iframe { transform: scale(.3); } }
.lp-card__overlay { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; background: rgba(15, 23, 42, 0); transition: background .2s; }
.lp-card__overlay span { opacity: 0; color: #fff; background: rgba(15, 23, 42, .8); padding: .5rem .9rem; border-radius: 999px; font-size: .85rem; transition: opacity .2s; }
.lp-card__overlay:hover { background: rgba(15, 23, 42, .25); }
.lp-card__overlay:hover span { opacity: 1; }
.lp-card__missing { height: 100%; display: grid; place-items: center; text-align: center; color: #b91c1c; padding: 1rem; font-size: .85rem; gap: .25rem; }
.lp-card__missing i { font-size: 1.6rem; }

/* Choice cards ----------------------------------------------------------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice__body { display: flex; flex-direction: column; gap: .25rem; border: 1.5px solid var(--lp-border); border-radius: 12px; padding: .9rem 1rem; transition: border-color .15s, background .15s; height: 100%; }
.choice__body i { font-size: 1.3rem; color: var(--lp-primary); }
.choice__body small { color: var(--lp-muted); }
.choice input:checked + .choice__body { border-color: var(--lp-primary); background: var(--lp-primary-soft); }
.choice input:focus-visible + .choice__body { box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .2); }
.choice input:disabled + .choice__body { opacity: .5; cursor: not-allowed; }
.choice--compact .choice__body { padding: .65rem .85rem; }

/* Misc ------------------------------------------------------------------ */
.copy-field { display: flex; gap: .4rem; }
.copy-field .form-control { background: #f8f9fc; }
.upload-preview { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; padding: .5rem; border: 1px dashed var(--lp-border); border-radius: 10px; }
.upload-preview img { max-height: 48px; max-width: 160px; object-fit: contain; }
.serp-preview { border: 1px solid var(--lp-border); border-radius: 12px; padding: 1rem 1.1rem; background: #fff; font-family: arial, sans-serif; }
.serp-preview__url { font-size: .8rem; color: #202124; }
.serp-preview__title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin: .2rem 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-preview__desc { color: #4d5156; font-size: .85rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-compact dt { font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-muted); margin-top: .5rem; }
.dl-compact dd { margin: 0; }
.audit-details code { color: #475569; white-space: normal; }
.campaign-card .badge.fw-normal { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.counter-over { color: #dc2626 !important; font-weight: 600; }

/* Auth ------------------------------------------------------------------ */
body.auth { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #c7d2fe 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #f5d0fe 0%, transparent 60%), #f4f6fb; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid #fff; border-radius: 20px; padding: 2rem; box-shadow: 0 20px 60px rgba(30, 41, 59, .15); }
.auth-card__brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.auth-card__brand div { display: flex; flex-direction: column; line-height: 1.15; }
.auth-card__brand small { color: var(--lp-muted); font-size: .78rem; }
.auth-card__title { font-size: 1.35rem; font-weight: 700; }
.auth-card__subtitle { color: var(--lp-muted); font-size: .9rem; margin-bottom: 1.25rem; }
.auth-card__note { margin: 1.25rem 0 0; font-size: .78rem; color: var(--lp-muted); text-align: center; }
