/* Alp Tasarım — Pazaryeri Entegrasyonu */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Kenar çubuğu */
    --side-bg: #101828;
    --side-bg-hover: #1d2939;
    --side-text: #98a2b3;
    --side-text-active: #ffffff;
    --side-accent: #2e90fa;

    /* İçerik */
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e4e7ec;
    --text: #101828;
    --text-dim: #667085;
    --primary: #175cd3;
    --primary-hover: #1849a9;
    --green: #067647;
    --green-bg: #ecfdf3;
    --red: #b42318;
    --red-bg: #fef3f2;
    --amber: #b54708;
    --amber-bg: #fffaeb;

    --trendyol: #f27a1a;
    --hepsiburada: #ff6000;
    --n11: #7b2ff2;
    --pazarama: #00b2a9;

    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
}

html, body { height: 100%; }
body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.layout { display: flex; min-height: 100vh; }

/* ============ Kenar Çubuğu ============ */
.sidebar {
    width: 260px; flex-shrink: 0;
    background: var(--side-bg);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand-logo {
    width: 42px; height: 42px; flex-shrink: 0;
    background: linear-gradient(135deg, #2e90fa, #175cd3);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; color: #fff; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { color: #fff; font-size: 1.02rem; }
.brand-text span { color: var(--side-text); font-size: .76rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; flex: 1; }
.tab {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border: none; border-radius: 8px;
    background: none; color: var(--side-text);
    font-size: .92rem; font-weight: 500; font-family: inherit;
    cursor: pointer; text-align: left; width: 100%;
    transition: background .15s, color .15s;
}
.tab svg { width: 19px; height: 19px; flex-shrink: 0; }
.tab:hover { background: var(--side-bg-hover); color: #fff; }
.tab.active { background: var(--side-accent); color: var(--side-text-active); }
.badge {
    margin-left: auto;
    background: #f04438; color: #fff; border-radius: 10px;
    padding: 1px 8px; font-size: .72rem; font-weight: 700;
}
.tab.active .badge { background: rgba(255, 255, 255, .25); }

.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, .06);
    display: flex; flex-direction: column; gap: 10px;
}
.sync-status { color: var(--side-text); font-size: .8rem; }
.sync-status.syncing { color: #fdb022; }
.sync-status.ok { color: #32d583; }
.logout-link { color: var(--side-text); font-size: .8rem; text-decoration: none; }
.logout-link:hover { color: #fff; text-decoration: underline; }

/* ============ Butonlar ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--card); color: var(--text);
    font-size: .88rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all .15s;
}
.btn:hover { background: var(--bg); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-sync {
    background: rgba(255, 255, 255, .08); border-color: transparent; color: #fff;
    width: 100%;
}
.btn-sync:hover { background: rgba(255, 255, 255, .15); }
.btn-test { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-test:hover { background: #eff8ff; }

/* ============ Ana Alan ============ */
.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }

.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { color: var(--text-dim); font-size: .88rem; margin-top: 3px; }

.select {
    background: var(--card); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 12px; font-size: .88rem; font-family: inherit;
    box-shadow: var(--shadow); cursor: pointer;
}

/* ============ İstatistikler ============ */
.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px; margin-bottom: 16px;
}
.stat-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon-blue { background: #eff8ff; color: #175cd3; }
.stat-icon-teal { background: #f0fdf9; color: #107569; }
.stat-icon-green { background: var(--green-bg); color: var(--green); }
.stat-icon-amber { background: var(--amber-bg); color: var(--amber); }
.stat-label { color: var(--text-dim); font-size: .8rem; font-weight: 500; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat-green { color: var(--green); }
.stat-amber { color: var(--amber); }

/* ============ Pazaryeri Kartları ============ */
.mp-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.mp-card {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px;
    box-shadow: var(--shadow); cursor: pointer;
    border-top: 3px solid var(--border);
    transition: box-shadow .15s, transform .15s;
}
.mp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.mp-card.active { outline: 2px solid var(--primary); outline-offset: -1px; }
.mp-trendyol { border-top-color: var(--trendyol); }
.mp-hepsiburada { border-top-color: var(--hepsiburada); }
.mp-n11 { border-top-color: var(--n11); }
.mp-pazarama { border-top-color: var(--pazarama); }
.mp-name { font-weight: 700; font-size: .9rem; }
.mp-stat { color: var(--text-dim); font-size: .78rem; text-align: right; line-height: 1.45; }

/* ============ İçerik Kartı & Tablo ============ */
.tab-content { display: none; }
.tab-content.active { display: block; }

.panel-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.data-table th {
    text-align: left; padding: 13px 16px;
    color: var(--text-dim); font-weight: 600; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .04em;
    background: #f9fafb; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid #f2f4f7; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: #f9fafb; }
.data-table tr.row-new td { background: var(--green-bg); }
.empty { text-align: center; color: var(--text-dim); padding: 40px 16px !important; }

/* Pazaryeri etiketi */
.mp-tag {
    display: inline-block; padding: 3px 10px; border-radius: 16px;
    font-size: .74rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.mp-tag-trendyol { background: var(--trendyol); }
.mp-tag-hepsiburada { background: var(--hepsiburada); }
.mp-tag-n11 { background: var(--n11); }
.mp-tag-pazarama { background: var(--pazarama); }

.status-tag {
    display: inline-block; padding: 3px 10px; border-radius: 16px;
    font-size: .74rem; font-weight: 600;
    background: #f2f4f7; color: var(--text-dim); white-space: nowrap;
}
.status-open { background: var(--green-bg); color: var(--green); }
.status-closed { background: #f2f4f7; color: var(--text-dim); }
.items-cell { max-width: 300px; color: var(--text-dim); font-size: .82rem; line-height: 1.5; }
.amount { font-weight: 700; white-space: nowrap; }

/* ============ Sorular ============ */
.questions-list { display: flex; flex-direction: column; gap: 14px; }
.question-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 22px;
    box-shadow: var(--shadow);
}
.question-card.row-new { border-color: #6ce9a6; background: #fbfefc; }
.question-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.question-product { color: var(--text-dim); font-size: .84rem; font-weight: 500; }
.question-text { font-size: .95rem; line-height: 1.6; }
.question-meta { margin-top: 10px; color: var(--text-dim); font-size: .8rem; }

/* ============ Ayarlar ============ */
.settings-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}
.settings-card {
    background: var(--card); border: 1px solid var(--border);
    border-top: 3px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px;
    box-shadow: var(--shadow);
}
.mp-border-trendyol { border-top-color: var(--trendyol); }
.mp-border-hepsiburada { border-top-color: var(--hepsiburada); }
.mp-border-n11 { border-top-color: var(--n11); }
.mp-border-pazarama { border-top-color: var(--pazarama); }
.settings-card h3 { margin-bottom: 16px; font-size: 1.05rem; }
.settings-card label {
    display: block; margin-bottom: 14px;
    font-size: .82rem; font-weight: 600; color: var(--text-dim);
}
.settings-card input {
    display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: .9rem; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.settings-card input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 144, 250, .15);
}
.settings-actions { display: flex; gap: 10px; margin-top: 6px; }
.test-result { margin-top: 12px; font-size: .84rem; min-height: 1.2em; font-weight: 500; }
.test-result.ok { color: var(--green); }
.test-result.fail { color: var(--red); }
.settings-note {
    margin-top: 20px; color: var(--text-dim); font-size: .86rem;
    background: #eff8ff; border: 1px solid #b2ddff; border-radius: 10px;
    padding: 14px 18px;
}

/* Loglar */
.log-ok { color: var(--green); font-weight: 600; }
.log-fail { color: var(--red); font-weight: 600; }

/* ============ Duyarlı ============ */
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .tab { width: auto; }
    .main { padding: 18px 16px 40px; }
}
