/* ============================================================
   SmartAdTag Panel CSS — v4
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --s-w:       228px;
    --s-bg:      #1e2433;
    --s-border:  rgba(255,255,255,.1);
    --accent:    #7c3aed;
    --accent2:   #6d28d9;
    --accent-lt: #ede9fe;
    --green:     #059669;
    --amber:     #d97706;
    --red:       #dc2626;
    --text:      #111827;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --bg:        #f0f4f8;
    --card:      #ffffff;
    --r:         8px;
    --r-lg:      12px;
    --r-xl:      18px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 13.5px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ============================================================
   Layout — max 1400px, ekranın ortasında
   ============================================================ */
.sat-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sat-main {
    flex: 1;
    min-width: 0;
    background: var(--bg);
}

.sat-main-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 2.25rem;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sat-sidebar {
    width: var(--s-w);
    background: var(--s-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sat-brand {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--s-border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sat-brand img, .sat-brand svg { width: 26px; height: 26px; flex-shrink: 0; }

.sat-brand-text { font-size: 15px; font-weight: 700; color: #f9fafb; letter-spacing: -.4px; }
.sat-brand-text span { color: #a78bfa; }

.sat-nav { padding: .5rem 0; flex: 1; }

.sat-nav-section {
    padding: .65rem 1.35rem .2rem;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,.2);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sat-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: .5rem 1.35rem;
    font-size: 13px;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    transition: all .14s;
    border-left: 2px solid transparent;
}

.sat-nav a:hover { color: rgba(255,255,255,.82); background: rgba(255,255,255,.04); }
.sat-nav a.active { color: #fff; background: rgba(124,58,237,.18); border-left-color: var(--accent); }
.sat-nav a svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .6; }
.sat-nav a.active svg { opacity: 1; }

/* FAQ — öne çıkan link */
.sat-nav-faq {
    margin: 6px 10px !important;
    padding: .5rem .9rem !important;
    border-radius: var(--r) !important;
    border: 1px solid rgba(124,58,237,.35) !important;
    border-left: 1px solid rgba(124,58,237,.35) !important;
    background: rgba(124,58,237,.12) !important;
    color: #c4b5fd !important;
    font-weight: 600 !important;
}
.sat-nav-faq:hover { background: rgba(124,58,237,.22) !important; color: #ddd6fe !important; }
.sat-nav-faq.active { background: rgba(124,58,237,.28) !important; border-color: var(--accent) !important; }

.sat-sidebar-footer {
    padding: .9rem 1.35rem 1rem;
    border-top: 1px solid var(--s-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sat-sidebar-footer a {
    font-size: 12px;
    color: rgba(255,255,255,.3);
    text-decoration: none;
}

.sat-sidebar-footer a:hover { color: #fca5a5; }

/* ============================================================
   Page header
   ============================================================ */
.sat-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}

.sat-page-title { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -.4px; }

/* ============================================================
   Flash
   ============================================================ */
.sat-flash {
    padding: .7rem 1rem;
    border-radius: var(--r);
    margin-bottom: 1.1rem;
    font-size: 13px;
    border-left: 3px solid;
}
.sat-flash.success { background: #f0fdf4; color: #14532d; border-color: var(--green); }
.sat-flash.error   { background: #fef2f2; color: #7f1d1d; border-color: var(--red); }
.sat-flash.info    { background: #f5f3ff; color: #3b0764; border-color: var(--accent); }

/* ============================================================
   Stat cards
   ============================================================ */
.sat-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
    margin-bottom: 1.4rem;
}

.sat-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.05rem 1.15rem;
    position: relative;
    overflow: hidden;
}

.sat-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
}

.sat-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 5px;
}

.sat-stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.sat-stat-sub   { font-size: 11px; color: var(--green); margin-top: 3px; font-weight: 500; }

/* ============================================================
   Cards
   ============================================================ */
.sat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.sat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.sat-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.sat-card-body  { padding: 1.15rem; }

/* ============================================================
   Table
   ============================================================ */
.sat-table-wrap { overflow-x: auto; }
.sat-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.sat-table th {
    text-align: left;
    padding: .55rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.sat-table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.sat-table tr:last-child td { border-bottom: none; }
.sat-table tr:hover td { background: #f9fafb; }
.sat-table td.empty { text-align: center; color: #9ca3af; padding: 2.5rem; }

/* ============================================================
   Badges
   ============================================================ */
.sat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
}

.sat-badge.pending  { background: #fef3c7; color: #78350f; }
.sat-badge.approved, .sat-badge.active { background: #d1fae5; color: #064e3b; }
.sat-badge.rejected { background: #fee2e2; color: #7f1d1d; }
.sat-badge.inactive { background: #f3f4f6; color: #6b7280; }
.sat-badge.blue     { background: #ede9fe; color: #4c1d95; }
.sat-badge.purple   { background: #fae8ff; color: #701a75; }

/* ============================================================
   Buttons
   ============================================================ */
.sat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: .42rem .95rem;
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .14s;
    white-space: nowrap;
}

.sat-btn:disabled { opacity: .5; cursor: not-allowed; }
.sat-btn-primary  { background: var(--accent2); color: #fff; }
.sat-btn-primary:hover { background: #5b21b6; }
.sat-btn-secondary { background: #fff; color: #374151; border-color: var(--border); }
.sat-btn-secondary:hover { background: #f9fafb; }
.sat-btn-danger  { background: var(--red); color: #fff; }
.sat-btn-danger:hover { background: #b91c1c; }
.sat-btn-success { background: var(--green); color: #fff; }
.sat-btn-success:hover { background: #047857; }
.sat-btn-sm { padding: .26rem .65rem; font-size: 11.5px; }

/* ============================================================
   Forms
   ============================================================ */
.sat-form-group { margin-bottom: 1rem; }

.sat-label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.sat-label-desc { display: block; font-size: 11px; color: #9ca3af; margin-bottom: 5px; line-height: 1.4; }

.sat-input, .sat-select, .sat-textarea {
    width: 100%;
    padding: .48rem .72rem;
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    font-size: 13px;
    color: var(--text);
    background: #fff;
    transition: border-color .14s, box-shadow .14s;
    outline: none;
}

.sat-input:focus, .sat-select:focus, .sat-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.sat-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

/* Toggle */
.sat-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.sat-toggle input[type="checkbox"] { display: none; }
.sat-toggle-track { width: 36px; height: 20px; background: #d1d5db; border-radius: 10px; position: relative; transition: background .18s; flex-shrink: 0; }
.sat-toggle input:checked ~ .sat-toggle-track { background: var(--accent); }
.sat-toggle-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.sat-toggle input:checked ~ .sat-toggle-track .sat-toggle-thumb { transform: translateX(16px); }
.sat-toggle-label { font-size: 13px; color: #374151; font-weight: 500; }

/* Selector list */
.sat-selector-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.sat-selector-item { display: flex; align-items: center; gap: 6px; }
.sat-selector-item input { flex: 1; }
.sat-selector-item button {
    flex-shrink: 0; width: 28px; height: 28px;
    border: 1px solid #fecaca; background: #fff; color: var(--red);
    border-radius: var(--r); cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   Modal
   ============================================================ */
.sat-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 200;
    align-items: center; justify-content: center; padding: 1rem;
}
.sat-modal-overlay.open { display: flex; }
.sat-modal {
    background: #fff; border-radius: var(--r-xl); padding: 1.5rem;
    width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0,0,0,.18);
}
.sat-modal-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 1.2rem; }
.sat-modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #f3f4f6; }

/* ============================================================
   Code box
   ============================================================ */
.sat-code-box {
    background: #0d1117; color: #c9d1d9;
    padding: 1rem 1.15rem; border-radius: var(--r);
    font-family: 'SF Mono','Fira Code',monospace; font-size: 12px;
    word-break: break-all; position: relative; line-height: 1.6;
    border: 1px solid #21262d;
}
.sat-copy-btn {
    position: absolute; top: .55rem; right: .55rem;
    background: rgba(255,255,255,.07); color: #8b949e;
    border: 1px solid #30363d; border-radius: 4px; padding: 2px 8px;
    font-size: 11px; cursor: pointer;
}
.sat-copy-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .sat-sidebar { display: none; }
    .sat-main-inner { padding: 1rem; }
    .sat-stats { grid-template-columns: repeat(2, 1fr); }
}