/* ==========================================================================
   TEDARİK360 — Tasarım Sistemi (Önizleme)
   Tüm preview sayfaları bu dosyayı paylaşır.
   ========================================================================== */

/* ---------- Tasarım Token'ları ---------- */
:root {
    /* Marka */
    --brand-50:  #eef4ff;
    --brand-100: #dbe7ff;
    --brand-200: #b7cefe;
    --brand-400: #6c93f5;
    --brand-500: #3b6df0;
    --brand-600: #2a55d6;
    --brand-700: #1e40af;
    --brand-900: #0b1b46;

    /* Aksan */
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    /* Durum renkleri */
    --green-500: #22c55e;
    --green-50:  #f0fdf4;
    --green-700: #15803d;
    --red-500:   #ef4444;
    --red-50:    #fef2f2;
    --red-700:   #b91c1c;
    --amber-500: #f59e0b;
    --amber-50:  #fffbeb;
    --amber-700: #b45309;
    --sky-500:   #0ea5e9;
    --sky-50:    #f0f9ff;
    --sky-700:   #0369a1;
    --purple-500:#a855f7;
    --purple-50: #faf5ff;
    --purple-700:#7e22ce;

    /* Nötr */
    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --ink-300: #cbd5e1;
    --ink-200: #e2e8f0;
    --ink-100: #f1f5f9;
    --ink-50:  #f8fafc;
    --bg:      #f6f8fc;
    --white:   #ffffff;

    /* Sistem */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
    --shadow-md: 0 4px 12px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
    --shadow-lg: 0 24px 48px -12px rgba(15,23,42,.18);

    --sidebar-w: 252px;
    --topbar-h: 64px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--ink-900);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; }
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; }

/* ---------- App Shell ---------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: linear-gradient(180deg, var(--brand-900) 0%, #0a1539 100%);
    color: rgba(255,255,255,.86);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.sb-brand {
    height: var(--topbar-h);
    padding: 0 20px;
    display: flex; align-items: center; gap: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800; font-size: 17px;
    letter-spacing: -0.02em;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sb-brand .logo-tile {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #fff 0%, #dbe7ff 100%);
    color: var(--brand-700);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.sb-brand .suffix { color: var(--accent-400); }

.sb-user {
    padding: 16px 20px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sb-user .avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}
.sb-user .name { font-weight: 600; font-size: 13px; color: #fff; line-height: 1.3; }
.sb-user .role { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; }

.sb-section {
    padding: 16px 24px 6px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.38);
    font-weight: 700;
}
.sb-nav { padding: 0 12px 16px; flex: 1; }
.sb-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.72);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.sb-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-nav a.active {
    background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
    color: #fff;
    box-shadow: 0 4px 12px -2px rgba(59,109,240,.35);
}
.sb-nav a .badge {
    margin-left: auto;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
}
.sb-nav a.active .badge { background: rgba(0,0,0,.22); }
.sb-nav .ico { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--ink-200);
    display: flex; align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky; top: 0; z-index: 10;
}
.topbar .search { flex: 1; max-width: 480px; position: relative; }
.topbar .search input {
    width: 100%; height: 38px;
    background: var(--ink-100);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 0 12px 0 38px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.topbar .search input:focus {
    background: #fff;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(59,109,240,.1);
}
.topbar .search .ico {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--ink-400);
}
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    color: var(--ink-600);
    position: relative;
}
.icon-btn:hover { background: var(--ink-100); color: var(--ink-900); }
.icon-btn .ping {
    position: absolute; top: 7px; right: 8px;
    width: 8px; height: 8px;
    background: var(--red-500);
    border-radius: 50%;
    border: 2px solid #fff;
}
.topbar .me {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 14px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--ink-200);
}
.topbar .me .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
    color: #fff; font-weight: 700; font-size: 12px;
    display: grid; place-items: center;
}
.topbar .me .name { font-size: 12.5px; font-weight: 600; color: var(--ink-800); line-height: 1.2; }
.topbar .me .meta { font-size: 11px; color: var(--ink-500); }

/* ---------- Content & Page Head ---------- */
.content { padding: 28px; flex: 1; }
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-head h1 {
    font-size: 24px; font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
    color: var(--ink-900);
}
.page-head .crumb { font-size: 12.5px; color: var(--ink-500); }
.page-head .crumb a { color: var(--brand-600); font-weight: 500; }
.page-head .crumb .sep { margin: 0 6px; color: var(--ink-300); }

/* ---------- Buttons ---------- */
.btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 7px;
    font-family: inherit;
    transition: transform .12s, box-shadow .15s, filter .15s;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(42,85,214,.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-ghost {
    background: var(--white);
    color: var(--ink-700);
    border: 1.5px solid var(--ink-200);
}
.btn-ghost:hover { background: var(--ink-50); border-color: var(--ink-300); }
.btn-danger {
    background: #fff;
    color: var(--red-700);
    border: 1.5px solid #fecaca;
}
.btn-danger:hover { background: var(--red-50); }
.btn-success {
    background: var(--green-500);
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(34,197,94,.55);
}
.btn-success:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--ink-200);
    box-shadow: var(--shadow-sm);
}
.card-h {
    padding: 18px 22px;
    border-bottom: 1px solid var(--ink-100);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.card-h h3 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink-900);
}
.card-h .sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.card-b { padding: 22px; }

/* ---------- Stat Cards ---------- */
.stat {
    background: var(--white);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value {
    font-size: 28px; font-weight: 800;
    letter-spacing: -0.02em;
    margin: 8px 0 8px;
    line-height: 1;
}
.stat .delta {
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
}
.stat .delta.up { color: var(--green-700); background: var(--green-50); }
.stat .delta.down { color: var(--red-700); background: var(--red-50); }
.stat .ico-tile {
    position: absolute;
    top: 18px; right: 18px;
    width: 40px; height: 40px;
    border-radius: 12px;
    display: grid; place-items: center;
}
.stat .ico-tile.brand { background: var(--brand-50); color: var(--brand-600); }
.stat .ico-tile.green { background: var(--green-50); color: var(--green-700); }
.stat .ico-tile.amber { background: var(--amber-50); color: var(--amber-700); }
.stat .ico-tile.purple { background: var(--purple-50); color: var(--purple-700); }
.stat .ico-tile.sky { background: var(--sky-50); color: var(--sky-700); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-500);
    padding: 12px 16px;
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-200);
    white-space: nowrap;
}
.tbl td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--ink-800);
    border-bottom: 1px solid var(--ink-100);
}
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--ink-50); }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }

/* Cell helpers */
.cell-strong { font-weight: 600; color: var(--ink-900); }
.cell-mute { color: var(--ink-500); font-size: 12px; margin-top: 2px; }
.avatar-sm {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand-100); color: var(--brand-700);
    display: inline-grid; place-items: center;
    font-size: 11px; font-weight: 700;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.green  { background: var(--green-50);  color: var(--green-700);  }
.badge.green  .dot { background: var(--green-500); }
.badge.red    { background: var(--red-50);    color: var(--red-700);    }
.badge.red    .dot { background: var(--red-500); }
.badge.amber  { background: var(--amber-50);  color: var(--amber-700);  }
.badge.amber  .dot { background: var(--amber-500); }
.badge.sky    { background: var(--sky-50);    color: var(--sky-700);    }
.badge.sky    .dot { background: var(--sky-500); }
.badge.purple { background: var(--purple-50); color: var(--purple-700); }
.badge.purple .dot { background: var(--purple-500); }
.badge.slate  { background: var(--ink-100);   color: var(--ink-700);    }
.badge.slate  .dot { background: var(--ink-500); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > label {
    display: block;
    font-size: 12.5px; font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
}
.field > label .req { color: var(--red-500); }
.field input, .field select, .field textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--ink-900);
    background: #fff;
    border: 1.5px solid var(--ink-200);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: 100px; padding: 10px 12px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m3 5 4 4 4-4'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(59,109,240,.1);
}
.field-hint { font-size: 11.5px; color: var(--ink-500); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.section-title {
    font-size: 13px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-500);
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ink-100);
}
.section-title:first-child { margin-top: 0; }

/* ---------- Toolbar / Filters ---------- */
.toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ink-100);
    flex-wrap: wrap;
}
.toolbar .search-mini {
    position: relative; flex: 1; min-width: 220px; max-width: 360px;
}
.toolbar .search-mini input {
    width: 100%; height: 36px;
    background: var(--ink-50);
    border: 1.5px solid transparent;
    border-radius: 9px;
    padding: 0 12px 0 36px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
.toolbar .search-mini input:focus { background: #fff; border-color: var(--brand-500); }
.toolbar .search-mini .ico {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--ink-400);
}
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: var(--white);
    border: 1.5px solid var(--ink-200);
    border-radius: 9px;
    font-size: 12.5px; font-weight: 500;
    color: var(--ink-700);
    transition: border-color .12s, background .12s;
}
.chip:hover { border-color: var(--ink-300); background: var(--ink-50); }
.chip.active { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }

/* ---------- Pagination ---------- */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid var(--ink-100);
    font-size: 13px; color: var(--ink-500);
}
.pager .pages { display: inline-flex; gap: 4px; }
.pager .pages .pg {
    min-width: 32px; height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    display: inline-grid; place-items: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-700);
}
.pager .pages .pg:hover { background: var(--ink-100); }
.pager .pages .pg.active { background: var(--brand-600); color: #fff; }

/* ---------- Helpers ---------- */
.row { display: grid; gap: 18px; }
.row-2 { grid-template-columns: repeat(2, 1fr); }
.row-3 { grid-template-columns: repeat(3, 1fr); }
.row-4 { grid-template-columns: repeat(4, 1fr); }
.row-aside { grid-template-columns: 2fr 1fr; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 14px; } .gap-4 { gap: 18px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 18px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 18px; }
.text-mute { color: var(--ink-500); }
.text-strong { color: var(--ink-900); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .row-4 { grid-template-columns: repeat(2, 1fr); }
    .row-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .row-2, .row-aside { grid-template-columns: 1fr; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

/* ---------- Preview Banner ---------- */
.preview-banner {
    position: fixed;
    top: 12px; right: 12px;
    background: var(--ink-900);
    color: #fff;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-lg);
    z-index: 50;
}
.preview-banner a { color: var(--brand-200); margin-left: 8px; font-weight: 500; }
