:root {
    --ig-blue: #515BD4;
    --ig-purple: #8134AF;
    --ig-pink: #DD2A7B;
    --ig-orange: #F58529;
    --ig-yellow: #FCAF45;
    --grad: linear-gradient(95deg, #515BD4 0%, #8134AF 32%, #DD2A7B 64%, #F58529 100%);

    --bg: #f5f5fa;
    --surface: #ffffff;
    --surface-2: #fbfbfe;
    --text: #1b1623;
    --muted: #6c6677;
    --faint: #9a96a5;
    --border: #ecebf2;
    --border-strong: #ddd9e6;

    --success: #128a63;
    --success-bg: #e4f6ef;
    --danger: #cf3a2f;
    --danger-bg: #fdeceb;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(27, 22, 35, .05), 0 10px 30px rgba(27, 22, 35, .05);
    --maxw: 1080px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.brandbar {
    height: 4px;
    background: var(--grad);
}

a { color: var(--ig-purple); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 28px 22px 60px;
}

/* --- Ust bar --- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--grad);
    display: inline-block;
    flex: none;
}
.brand-mark-lg { width: 44px; height: 44px; border-radius: 12px; }
.nav { display: flex; gap: 16px; margin-left: 6px; flex: 1; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.logout-form { margin: 0; }

/* --- Kartlar --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}

.page-head { margin-bottom: 22px; }

/* --- Butonlar --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform .04s ease, box-shadow .15s ease, background .15s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary {
    background: var(--grad);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(129, 52, 175, .25);
}
.btn-primary:hover { color: #fff; box-shadow: 0 6px 18px rgba(129, 52, 175, .32); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3cdc9; }
.btn-danger:hover { background: var(--danger-bg); }
.inline { display: inline; margin: 0; }

/* --- Formlar --- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="password"], input[type="file"], select {
    font: inherit;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    width: 100%;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--ig-purple);
    box-shadow: 0 0 0 3px rgba(129, 52, 175, .15);
}

/* --- Bildirimler --- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: #bfe6d6; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #f3cdc9; }

/* --- Giris --- */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: 21px; margin-top: 14px; }
.auth-head .brand-mark-lg { margin: 0 auto; }

/* --- Hesap kartlari --- */
.grid-accounts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.account-card { display: flex; flex-direction: column; gap: 16px; }
.account-top { display: flex; align-items: center; gap: 12px; }
.avatar-mark {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.account-handle { font-weight: 700; }
.account-stats { display: flex; gap: 22px; padding: 4px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { display: flex; flex-direction: column; padding: 10px 0; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-num-sm { font-size: 15px; font-weight: 600; line-height: 1.1; }
.stat-lbl { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.empty-state { text-align: center; color: var(--muted); grid-column: 1 / -1; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.help-list { margin: 0; padding-left: 20px; color: var(--muted); }
.help-list li { margin-bottom: 8px; }
.help-list strong { color: var(--text); }

/* --- Hata --- */
.error-card { text-align: center; }
.error-code { font-size: 46px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-msg { color: var(--muted); margin: 6px 0 18px; }

/* --- Metrik kartlari (analiz) --- */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.metric .m-label { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.metric .m-value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.m-up { color: var(--success); }
.m-down { color: var(--danger); }

/* --- Sekmeler --- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--ig-purple); border-bottom-color: var(--ig-pink); }
.tab .count { font-size: 12px; color: var(--faint); margin-left: 4px; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* --- Listeler / tablolar --- */
.list-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.list-toolbar input[type="text"] { max-width: 280px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; cursor: pointer; user-select: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.uname { font-weight: 600; }
.row-empty { text-align: center; color: var(--muted); padding: 28px 0; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.badge-new { background: var(--success-bg); color: var(--success); }
.badge-lost { background: var(--danger-bg); color: var(--danger); }

.footer { padding: 22px 0 36px; }
.footer .container { padding-top: 0; padding-bottom: 0; }

@media (max-width: 720px) {
    .two-col { grid-template-columns: 1fr; }
    .topbar-inner { gap: 12px; }
    .brand-name { display: none; }
}
