/* === Local Inter font === */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-subtle: #eff6ff;
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --sidebar-bg: #f8fafc;
    --header-bg: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    --header-text: #f8fafc;
    --gundogmus-color: #7c3aed;
    --gundogmus-light: #ede9fe;
    --omerhirdavat-color: #0891b2;
    --omerhirdavat-light: #cffafe;
    --tokgoz-color: #c2410c;
    --tokgoz-light: #fff7ed;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

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

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

/* === Header === */
header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0 28px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-left h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.header-left h1 a { color: inherit; }
.header-left h1 a:hover { color: inherit; opacity: 0.9; }
.header-left .brand-sub {
    font-size: 11px;
    opacity: 0.6;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.header-right { display: flex; gap: 8px; align-items: center; }

/* === Layout === */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width, 260px) auto 1fr;
    min-height: calc(100vh - 56px);
    transition: grid-template-columns 0.25s ease;
}
.layout.sidebar-collapsed {
    grid-template-columns: 0px auto 1fr;
}

/* === Sidebar === */
.sidebar {
    background: var(--sidebar-bg);
    border-right: none;
    padding: 20px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    min-width: 0;
    max-width: 500px;
    transition: padding 0.25s ease, opacity 0.2s ease;
}
.layout.sidebar-collapsed .sidebar {
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

/* === Resize Handle === */
.sidebar-resize-handle {
    width: 5px;
    cursor: col-resize;
    background: var(--border);
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    transition: background var(--transition), width var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--primary);
}

/* Collapse toggle button on the handle */
.sidebar-toggle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    transition: all var(--transition);
    z-index: 2;
    box-shadow: var(--shadow);
    padding: 0;
    line-height: 1;
}
.sidebar-toggle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.layout.sidebar-collapsed .sidebar-toggle {
    left: 8px;
    transform: none;
}

body.sidebar-resizing {
    cursor: col-resize;
    user-select: none;
}
body.sidebar-resizing .layout * {
    pointer-events: none;
}
body.sidebar-resizing .sidebar-resize-handle {
    pointer-events: auto;
}

.sidebar-search-btn {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    letter-spacing: 0.8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    padding: 5px 0;
    font-size: 13px;
}

.sidebar-list .empty {
    color: var(--text-light);
    font-style: italic;
    font-size: 12px;
    padding: 4px 0;
}

.history-link {
    color: var(--text-secondary);
    display: block;
    padding: 4px 8px;
    border-radius: var(--radius);
    font-size: 13px;
    transition: all var(--transition);
}
.history-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.saved-search-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.saved-search-item .history-link {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.saved-search-item .btn-remove-sm {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition);
}
.saved-search-item:hover .btn-remove-sm {
    opacity: 1;
}

.btn-save-search {
    margin-left: auto;
}

.sidebar-list-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* === Main Content === */
.content {
    padding: 24px 28px;
    overflow-x: auto;
    min-width: 0;
}

/* === Search === */
.search-section {
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.search-bar {
    display: flex;
    gap: 10px;
}

.search-bar input[type="text"] {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: all var(--transition);
    background: var(--bg);
}
.search-bar input[type="text"]:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.search-options {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
    transition: color var(--transition);
}
.checkbox-label:hover { color: var(--text); }
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.htmx-indicator {
    display: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}
.htmx-indicator::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-flex;
    align-items: center;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === Results Toolbar === */
.results-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.toolbar-toggle {
    padding: 5px 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: 20px;
    background: var(--bg-card);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}
.toolbar-toggle.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.toolbar-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Column visibility */
#results-container.hide-fiyat [data-col="fiyat"] { display: none; }
#results-container.hide-kdv [data-col="kdv"] { display: none; }
#results-container.hide-stok [data-col="stok"] { display: none; }

/* === Results Grid === */
.results-header {
    margin-bottom: 14px;
}
.results-query {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.supplier-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}
.supplier-col:hover {
    box-shadow: var(--shadow-md);
}

.supplier-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--border);
}
.supplier-header h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.result-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 20px;
}

/* Supplier-specific header colors */
.supplier-col:nth-child(1) .supplier-header {
    border-bottom-color: var(--gundogmus-color);
    background: var(--gundogmus-light);
}
.supplier-col:nth-child(2) .supplier-header {
    border-bottom-color: var(--omerhirdavat-color);
    background: var(--omerhirdavat-light);
}
.supplier-col:nth-child(3) .supplier-header {
    border-bottom-color: var(--tokgoz-color);
    background: var(--tokgoz-light);
}

.table-wrap {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
}

/* === Product Table === */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.product-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.product-table th {
    background: var(--bg);
    padding: 10px 8px;
    text-align: left;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.product-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.product-table tbody tr {
    transition: background var(--transition);
}
.product-table tbody tr:hover {
    background: var(--primary-subtle);
}

/* Zebra striping */
.product-table tbody tr:nth-child(even) {
    background: #fafbfd;
}
.product-table tbody tr:nth-child(even):hover {
    background: var(--primary-subtle);
}

.col-kod {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-muted);
}
.col-ad { min-width: 130px; max-width: 220px; line-height: 1.4; }
.col-price {
    white-space: nowrap;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.col-stok { white-space: nowrap; text-align: center; font-weight: 500; }
.col-actions { white-space: nowrap; text-align: center; }
.col-adet { width: 65px; }
.col-total {
    white-space: nowrap;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
}
.col-notes { min-width: 110px; }

/* Out of stock */
tr.stoksuz {
    opacity: 0.4;
}
tr.stoksuz td {
    color: var(--text-light);
}
tr.stoksuz .col-stok {
    color: var(--danger);
    font-weight: 600;
    font-size: 11px;
}
tr.stoksuz:hover {
    opacity: 0.6;
}

/* Kampanya badge */
.kampanya-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 5px;
    cursor: help;
    box-shadow: 0 1px 2px rgba(217,119,6,.3);
}

/* JS tooltip */
.tooltip {
    position: fixed;
    z-index: 9999;
    background: #1e293b;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    max-width: 280px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    white-space: normal;
    word-break: break-word;
}

.kampanya-text {
    font-size: 11px;
    color: var(--warning);
    margin-top: 3px;
    line-height: 1.3;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: #fff;
    background: var(--primary);
    white-space: nowrap;
}
.btn:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.btn-primary { background: var(--primary); }
.btn-secondary { background: var(--text-muted); }
.btn-secondary:hover { background: var(--text-secondary); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    background: transparent;
    transition: all var(--transition);
}

.btn-add-list { color: var(--success); }
.btn-add-list:hover {
    background: var(--success-light);
    border-color: var(--success);
    transform: scale(1.1);
}
.btn-fav { color: var(--warning); }
.btn-fav:hover {
    background: var(--warning-light);
    border-color: var(--warning);
    transform: scale(1.1);
}
.btn-remove, .btn-remove-sm { color: var(--danger); font-size: 16px; }
.btn-remove:hover, .btn-remove-sm:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

/* === Supplier badges (sidebar) === */
.item-supplier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.item-supplier-badge.gundogmus { background: var(--gundogmus-color); }
.item-supplier-badge.omerhirdavat { background: var(--omerhirdavat-color); }
.item-supplier-badge.tokgoz { background: var(--tokgoz-color); }

.list-item-mini, .fav-item-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}
.item-name-mini {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-word;
}
.item-adet-mini {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 4px;
}
.more-items {
    color: var(--text-light);
    font-size: 12px;
    font-style: italic;
    padding-top: 2px;
}

/* === Input fields === */
.input-adet {
    width: 58px;
    padding: 5px 4px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    transition: border-color var(--transition);
    background: var(--bg);
}
.input-adet:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37,99,235,.1);
    background: #fff;
}
.input-notes {
    width: 100%;
    padding: 5px 8px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    transition: border-color var(--transition);
    background: var(--bg);
}
.input-notes:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
}
.input-sm {
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    transition: border-color var(--transition);
}
.input-sm:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37,99,235,.1);
}

/* === Shopping List Page === */
.liste-page { max-width: 1200px; }

.liste-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}
.liste-name-wrapper {
    flex: 1;
    min-width: 0;
}
.liste-name-display {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.liste-name-edit-icon {
    font-size: 14px;
    color: var(--text-light);
    opacity: 0;
    transition: opacity var(--transition);
}
.liste-name-display:hover .liste-name-edit-icon {
    opacity: 1;
}
.liste-name-edit-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.liste-name-input {
    font-size: 18px;
    font-weight: 600;
    width: 300px;
}

.liste-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.export-buttons {
    display: flex;
    gap: 6px;
}

.liste-controls {
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 500;
}
.liste-controls select {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-card);
    cursor: pointer;
}

.liste-supplier-section {
    margin-bottom: 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.supplier-section-title {
    font-size: 15px;
    padding: 12px 16px;
    margin: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.supplier-section-title .supplier-item-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Supplier section colors */
.liste-supplier-section[data-supplier="gundogmus"] .supplier-section-title {
    background: var(--gundogmus-light);
    border-bottom: 2px solid var(--gundogmus-color);
}
.liste-supplier-section[data-supplier="omerhirdavat"] .supplier-section-title {
    background: var(--omerhirdavat-light);
    border-bottom: 2px solid var(--omerhirdavat-color);
}
.liste-supplier-section[data-supplier="tokgoz"] .supplier-section-title {
    background: var(--tokgoz-light);
    border-bottom: 2px solid var(--tokgoz-color);
}

.liste-table { font-size: 13px; }
.liste-table td { padding: 10px 8px; }
.liste-table th { padding: 10px 8px; }

.totals-row td {
    background: var(--bg) !important;
    border-top: 2px solid var(--border-strong);
    font-size: 13px;
}

.grand-total {
    margin-top: 28px;
    padding: 20px 24px;
    background: var(--primary-subtle);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.grand-total h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--primary-hover);
}
.total-summary td {
    padding: 5px 16px 5px 0;
    font-size: 16px;
}

.empty-liste {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-liste p {
    margin-bottom: 20px;
    font-size: 15px;
}


/* === Error / empty messages === */
.error-msg {
    padding: 20px;
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    background: var(--danger-light);
    border-radius: var(--radius);
    margin: 12px;
}
.empty-msg {
    padding: 32px 16px;
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
}

/* === Toast === */
#toast-container {
    position: fixed;
    top: 68px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 420px;
    border-left: 4px solid transparent;
}
.toast-info { background: #eff6ff; color: #1e40af; border-left-color: #2563eb; }
.toast-success { background: #f0fdf4; color: #166534; border-left-color: #059669; }
.toast-warning { background: #fffbeb; color: #92400e; border-left-color: #d97706; }
.toast-error { background: #fef2f2; color: #991b1b; border-left-color: #dc2626; }
.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: opacity var(--transition);
    margin-left: auto;
}
.toast-close:hover { opacity: 1; }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Listeler (All Lists) page === */
.listeler-page {
    max-width: 1000px;
}
.listeler-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}
.listeler-header h2 {
    font-size: 22px;
    font-weight: 700;
}
.listeler-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.listeler-table th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.listeler-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.listeler-table tbody tr {
    transition: background var(--transition);
}
.listeler-table tbody tr:hover {
    background: var(--primary-subtle);
}
.listeler-active {
    background: var(--primary-subtle) !important;
}
.listeler-name-cell {
    min-width: 200px;
}
.listeler-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.listeler-name:hover {
    color: var(--primary);
}
.listeler-edit-icon {
    font-size: 13px;
    color: var(--text-light);
    opacity: 0;
    transition: opacity var(--transition);
}
.listeler-name:hover .listeler-edit-icon {
    opacity: 1;
}
.listeler-edit-form {
    display: flex;
    gap: 6px;
    align-items: center;
}
.listeler-active-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}
.listeler-count {
    font-weight: 600;
    color: var(--text-secondary);
}
.listeler-date {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}
.listeler-actions {
    white-space: nowrap;
    text-align: center;
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* === Settings page === */
.settings-page {
    max-width: 520px;
    background: var(--bg-card);
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.settings-page h2 {
    font-size: 20px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.form-group .help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* === Column loading spinner === */
.loading-spinner-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.supplier-col-body {
    min-height: 80px;
}

/* === Responsive: stack columns vertically === */
@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: 1fr 1fr;
    }
    .results-grid .supplier-col:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    .results-grid .supplier-col:nth-child(3) {
        grid-column: auto;
    }
    .table-wrap {
        max-height: 50vh;
    }
}

@media (max-width: 700px) {
    .layout {
        grid-template-columns: 0px 0px 1fr;
    }
    .sidebar, .sidebar-resize-handle {
        display: none;
    }
    .content {
        padding: 16px;
    }
    header {
        padding: 0 16px;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
