/* =====================================================
   TY Panel — Ortak tema
   ===================================================== */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-bg-grad: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
    --sidebar-hover: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #64748b;
    --sidebar-active: #fd4056;
    --sidebar-active-bg: rgba(253, 64, 86, 0.12);
    --sidebar-border: #1e293b;

    --bg: #f5f6fa;
    --card: #ffffff;
    --border: #e5e7eb;
    --border-soft: #f1f3f7;
    --text: #1f2937;
    --text-soft: #374151;
    --muted: #6b7280;

    --primary: #fd4056;
    --primary-hover: #e63946;
    --primary-soft: rgba(253, 64, 86, 0.08);
    --primary-ring: rgba(253, 64, 86, 0.25);

    --success: #16a34a;
    --warning: #f59e0b;
    --info: #2563eb;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);

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

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* =====================================================
   Layout
   ===================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg-grad);
    color: var(--sidebar-text);
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    z-index: 50;
}

.sidebar__brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 16px;
}

.sidebar__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 6px 16px rgba(253, 64, 86, 0.35);
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__section {
    padding: 14px 14px 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--sidebar-text-muted);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
    text-decoration: none;
}

.sidebar__link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar__link.active {
    background-color: var(--sidebar-active-bg);
    color: #fff;
    position: relative;
}

.sidebar__link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--sidebar-active);
}

.sidebar__link .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: currentColor;
    opacity: .9;
}

.sidebar__footer {
    padding: 12px 14px 18px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 12px;
    color: var(--sidebar-text-muted);
}

/* ---------- Main / Topbar ---------- */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    z-index: 40;
}

.topbar__menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.topbar__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 500;
}

.topbar__user .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* ---------- Content ---------- */
.content {
    padding: 24px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-header__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.page-header__subtitle {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.card--flush { padding: 0; }

.card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card__body { padding: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-danger:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

/* ---------- Tables ---------- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
}

/* Dikey kaydırma + yapışkan başlık — geniş tablolar okunaklı */
.table-wrapper.table-wrapper--scroll {
    overflow: auto;
    max-height: min(72vh, 880px);
    border-radius: 0;
    border-top: 1px solid var(--border-soft);
}

table.data-table {
    width: 100%;
    min-width: 960px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    line-height: 1.35;
    background: var(--card);
    table-layout: fixed;
}

table.data-table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-soft);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border-soft);
}

.table-wrapper:not(.table-wrapper--scroll) table.data-table thead th {
    position: relative;
    top: auto;
    box-shadow: none;
}

table.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
    color: var(--text);
    font-size: 13px;
}

table.data-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

table.data-table tbody tr:hover td {
    background-color: #fff5f6 !important;
}

table.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Hücre tipleri — ID / tarih kırılmasın, metin kontrollü kısalsın */
td.cell-id {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text-soft);
    width: 5.5rem;
}

td.cell-date,
td.cell-date.dt-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--muted);
    width: 8.75rem;
}

td.cell-money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: right;
    width: 5.5rem;
}

td.cell-pct {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: center;
    vertical-align: middle;
}

td.cell-num {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

td.cell-url {
    max-width: 0;
    overflow: hidden;
}

table.data-table a.cell-link {
    color: var(--primary);
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    vertical-align: bottom;
}

td.cell-product {
    max-width: 0;
    overflow: hidden;
    vertical-align: middle;
}

.cell-product-inner {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    word-break: break-word;
}

td.cell-category {
    max-width: 0;
    overflow: hidden;
    font-size: 12px;
}

.cat-line {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.ellipsis-1 {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.cell-seller {
    max-width: 9rem;
}

.cell-desc-inner {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    word-break: break-word;
    color: var(--muted);
    font-size: 12px;
}

td.cell-desc {
    max-width: 0;
    overflow: hidden;
    vertical-align: middle;
}

td.cell-thumb {
    width: 3.75rem;
    text-align: center;
    vertical-align: middle;
}

td.cell-actions {
    width: 5.5rem;
    white-space: nowrap;
    text-align: right;
}

/* Fiyat takibi: DT2 tabloyu sıkıştırıyordu — kart ve tablo tam genişlik */
.price-track-layout .table-wrapper,
.price-track-layout .dt-container,
.price-track-layout .dt-layout-full,
.price-track-layout .dt-layout-cell,
.price-track-layout .dt-layout-table {
    width: 100%;
    box-sizing: border-box;
}

.price-track-layout table.data-table,
.price-track-layout table#priceTrackTable {
    width: 100% !important;
}

#priceTrackTable td.cell-url,
#priceTrackTable thead th:nth-child(1) {
    max-width: none;
    box-sizing: border-box;
}

#priceTrackTable td.cell-product {
    max-width: none;
}

#priceTrackTable td.cell-num,
#priceTrackTable thead th:nth-child(4) {
    padding-left: 8px;
    padding-right: 8px;
}

#priceTrackTable td.cell-actions {
    min-width: 5.75rem;
}

table.data-table img.thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f1f5f9;
    display: inline-block;
    vertical-align: middle;
    cursor: zoom-in;
}

.ty-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, 3vmin);
    box-sizing: border-box;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.ty-lightbox.is-open {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.ty-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    cursor: pointer;
}

.ty-lightbox__close {
    position: absolute;
    top: max(12px, 2vmin);
    right: max(12px, 2vmin);
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ty-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.ty-lightbox__inner {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 1280px);
    max-height: 92vh;
    cursor: default;
}

.ty-lightbox__inner img {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    cursor: zoom-out;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-soft);
    line-height: 1.4;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.muted { color: var(--muted); font-size: 12px; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
    margin: 18px 0 4px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-soft);
    background: var(--card);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s ease;
}

.pagination a:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    pointer-events: none;
    font-weight: 600;
}

/* ---------- DataTables tema overrides ---------- */
.dataTables_wrapper,
.dt-container {
    padding: 0;
    font-size: 13px;
}

/* DataTables 2 üst satır: sayfa boyutu + arama */
.dt-container > .dt-layout-row:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 12px 20px;
    margin: 0;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-soft);
}

.dt-container .dt-length,
.dt-container .dt-search,
.dt-container .dt-length label,
.dt-container .dt-search label {
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 500;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dt-container select.dt-input,
.dt-container input.dt-input,
.dt-container .dt-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    outline: none;
    min-height: 38px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.dt-container .dt-search .dt-input {
    min-width: min(320px, 85vw);
}

.dt-container .dt-search input.dt-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.dt-container input.dt-input:focus,
.dt-container select.dt-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Alt satır: bilgi + sayfalama */
.dt-container > .dt-layout-row:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border-soft);
    background: var(--card);
}

.dt-container .dt-info {
    color: var(--muted);
    font-size: 12px;
}

.dt-container .dt-paging .dt-paging-button {
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    background: var(--card) !important;
    color: var(--text-soft) !important;
    font-size: 12px !important;
    margin: 0 2px !important;
    min-width: 36px;
    transition: all .15s ease;
}

.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    background: var(--bg) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
}

/* DataTables 1.x uyumluluk */
.dataTables_wrapper {
    padding: 0;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 0;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-soft);
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    outline: none;
    min-height: 38px;
    min-width: 200px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}
.dataTables_wrapper .dataTables_info {
    color: var(--muted);
    font-size: 12px;
    padding: 12px 20px;
}
.dataTables_wrapper .dataTables_paginate {
    padding: 12px 20px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border) !important;
    background: var(--card) !important;
    color: var(--text-soft) !important;
    font-size: 12px;
    transition: all .15s ease;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #cbd5e1 !important;
    background: var(--card) !important;
    border-color: var(--border) !important;
    cursor: not-allowed;
}

table.dataTable thead th,
table.dataTable thead td {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: var(--text-soft) !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border) !important;
}
table.dataTable tbody td {
    padding: 10px 12px !important;
    color: var(--text);
    border-color: var(--border-soft) !important;
}
table.dataTable.no-footer { border-bottom: 1px solid var(--border-soft); }
table.dataTable tbody tr:nth-child(even) td { background-color: #fafbfc !important; }
table.dataTable tbody tr:hover td { background-color: #fff5f6 !important; }
table.dataTable tbody tr.odd > .sorting_1,
table.dataTable tbody tr.even > .sorting_1 { background: transparent !important; }

/* ---------- Auth (login) ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1000px 600px at 10% -10%, rgba(253, 64, 86, 0.16), transparent 60%),
        radial-gradient(800px 500px at 100% 110%, rgba(15, 23, 42, 0.18), transparent 60%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-card__brand .mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(253, 64, 86, 0.35);
}

.auth-card h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.auth-card p.lead {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 22px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn-block { width: 100%; }

.flash {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ---------- Empty / Stats ---------- */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.dashboard-section {
    margin-bottom: 22px;
}

.dashboard-heading {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--primary);
}
.stat-card__label,
.stat-card .label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    font-weight: 600;
}
.stat-card__value,
.stat-card .value {
    font-size: 21px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.stat-card__hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.charts-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}
.charts-grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.charts-grid--1 {
    grid-template-columns: 1fr;
    max-width: 100%;
}
.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.chart-card__title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-soft);
}
.chart-card__canvas {
    position: relative;
    height: 260px;
}

.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.filter-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
}
.filter-toolbar input,
.filter-toolbar select {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    min-width: 100px;
    background: var(--card);
}
.filter-toolbar input:focus,
.filter-toolbar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}
.filter-toolbar__grow {
    flex: 1;
    min-width: 120px;
}

/* ---------- Mobile ---------- */
.sidebar__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 45;
}

@media (max-width: 1024px) {
    .content { padding: 18px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar__menu-btn { display: inline-flex; }
    .sidebar__backdrop.is-open { display: block; }
    .topbar { padding: 0 16px; }
    .content { padding: 14px; }
    .page-header__title { font-size: 18px; }
}

/* ---------- Panel kullanıcılar + modal ---------- */
.panel-users-intro {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 52%);
}

.panel-users-intro h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.panel-users-intro p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
}

.panel-users-intro .filter-toolbar {
    padding: 0;
    gap: 12px;
    margin: 0;
}

.panel-users-table-wrap .filter-toolbar.muted-banner {
    background: var(--border-soft);
    border-bottom: 1px solid var(--border);
}

.panel-users-actions {
    vertical-align: middle;
    width: auto;
    min-width: 6.5rem;
    text-align: center;
}

#panelUsersTable .btn-user-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* Modal */
.ty-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.48);
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.ty-modal-overlay.is-open {
    display: flex;
}

.ty-modal-overlay.is-open *:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.ty-modal {
    width: 100%;
    max-width: 440px;
    max-height: min(92vh, 640px);
    overflow-y: auto;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: tyModalPop .22s ease;
}

@keyframes tyModalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: none; }
}

.ty-modal__hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 0;
}

.ty-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.ty-modal__tag {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.ty-modal__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--border-soft);
    color: var(--text-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.ty-modal__close:hover {
    background: var(--border);
    color: var(--text);
}

.ty-modal__bd {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ty-modal-fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.ty-modal-fieldset legend {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 0 0 8px;
    float: left;
}

.ty-modal-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    clear: both;
}

.ty-modal-fields label span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.ty-modal-fields input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.ty-modal-fields input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.ty-modal-fields .hint {
    font-size: 12px;
    color: var(--muted);
}

.ty-modal-actions {
    display: flex;
    gap: 8px;
}

.ty-modal-actions .btn {
    flex: 1;
}

.ty-modal__ft {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--border-soft);
    background: #fafbfd;
}

.ty-modal-footer-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.ty-modal-footer-btns form {
    flex: 1;
    min-width: 112px;
    display: flex;
}

.ty-modal-footer-btns form .btn {
    width: 100%;
    justify-content: center;
}

.btn-danger-soft {
    color: var(--primary);
    background: transparent;
    border: 1px solid rgba(253, 64, 86, 0.35);
}

.btn-danger-soft:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.btn-ghost-strong {
    background: var(--card);
    border: 1px solid var(--border);
    font-weight: 600;
}

body.ty-modal-lock {
    overflow: hidden;
}
