/* ================================================
   STOK YÖNETİM PANELİ — Özel Layout & Tasarım
   ================================================ */

:root {
    --stock-primary: #0f172a;
    --stock-primary-light: #1e293b;
    --stock-accent: #06b6d4;
    --stock-accent-light: #22d3ee;
    --stock-success: #10b981;
    --stock-warning: #f59e0b;
    --stock-danger: #ef4444;
    --stock-info: #3b82f6;
    --stock-bg: #f8fafc;
    --stock-sidebar-width: 260px;
}

.stock-panel-body {
    background: var(--stock-bg);
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* ---------- Stok Sidebar (tek sidebar) ---------- */
.stock-sidebar {
    width: var(--stock-sidebar-width);
    background: linear-gradient(180deg, var(--stock-primary) 0%, var(--stock-primary-light) 100%);
    color: #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.stock-sidebar__header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.stock-sidebar__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.stock-sidebar__back:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.stock-sidebar__title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.stock-sidebar__title-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--stock-accent) 0%, var(--stock-accent-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.stock-sidebar__title-main {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.stock-sidebar__title-sub {
    font-size: 11px;
    color: var(--stock-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 2px;
}

.stock-sidebar__nav {
    padding: 16px 12px;
}

.stock-nav-group {
    margin-bottom: 20px;
}
.stock-nav-group__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 0 12px 8px;
}

.stock-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s;
    position: relative;
}
.stock-nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.stock-nav-item.active {
    background: linear-gradient(135deg, rgba(6,182,212,0.18) 0%, rgba(34,211,238,0.08) 100%);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--stock-accent);
}
.stock-nav-item__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}
.stock-nav-item.active .stock-nav-item__icon {
    opacity: 1;
    color: var(--stock-accent-light);
}

/* ---------- Ana içerik alanı ---------- */
.stock-main {
    margin-left: var(--stock-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.stock-content {
    padding: 24px 32px;
    flex: 1;
}

/* ---------- Page header ---------- */
.stock-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.stock-page-header__breadcrumb {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}
.stock-page-header__breadcrumb a {
    color: var(--stock-accent);
    text-decoration: none;
    font-weight: 500;
}
.stock-page-header__breadcrumb a:hover { text-decoration: underline; }
.stock-page-header__sep { margin: 0 6px; color: #94a3b8; }

.stock-page-header__title {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}
.stock-page-header__subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 6px 0 0;
}

.stock-page-header__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---------- KPI kartları ---------- */
.stock-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stock-kpi-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.stock-kpi-card:hover {
    box-shadow: 0 4px 16px rgba(15,23,42,0.08);
    transform: translateY(-1px);
}
.stock-kpi-card__label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.stock-kpi-card__value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}
.stock-kpi-card__sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.stock-kpi-card__sub--up { color: var(--stock-success); }
.stock-kpi-card__sub--down { color: var(--stock-danger); }

.stock-kpi-card__icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}
.stock-kpi-card--primary .stock-kpi-card__icon { background: rgba(6,182,212,0.12); color: var(--stock-accent); }
.stock-kpi-card--success .stock-kpi-card__icon { background: rgba(16,185,129,0.12); color: var(--stock-success); }
.stock-kpi-card--warning .stock-kpi-card__icon { background: rgba(245,158,11,0.12); color: var(--stock-warning); }
.stock-kpi-card--danger  .stock-kpi-card__icon { background: rgba(239,68,68,0.12); color: var(--stock-danger); }
.stock-kpi-card--info    .stock-kpi-card__icon { background: rgba(59,130,246,0.12); color: var(--stock-info); }

/* ---------- Kartlar & kutular ---------- */
.stock-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    overflow: hidden;
}
.stock-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}
.stock-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}
.stock-card__body { padding: 20px; }

/* ---------- Grid layouts ---------- */
.stock-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.stock-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

/* ---------- Hızlı aksiyonlar ---------- */
.stock-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stock-quick-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    cursor: pointer;
}
.stock-quick-btn:hover {
    border-color: var(--stock-accent);
    box-shadow: 0 4px 12px rgba(6,182,212,0.15);
    transform: translateY(-1px);
    color: var(--stock-accent);
}
.stock-quick-btn__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(6,182,212,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stock-accent);
    flex-shrink: 0;
}

/* ---------- Tablo ---------- */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.stock-table thead th {
    background: #f8fafc;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.stock-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.stock-table tbody tr:hover { background: #f8fafc; }

/* ---------- Badge'ler ---------- */
.stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.stock-badge--success  { background: rgba(16,185,129,0.12); color: #047857; }
.stock-badge--warning  { background: rgba(245,158,11,0.14); color: #b45309; }
.stock-badge--danger   { background: rgba(239,68,68,0.12); color: #b91c1c; }
.stock-badge--info     { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.stock-badge--neutral  { background: #f1f5f9; color: #475569; }

/* ---------- Butonlar ---------- */
.stock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.stock-btn--primary {
    background: linear-gradient(135deg, var(--stock-accent) 0%, var(--stock-accent-light) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(6,182,212,0.25);
}
.stock-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(6,182,212,0.35);
    transform: translateY(-1px);
}
.stock-btn--secondary {
    background: #fff;
    border-color: #e2e8f0;
    color: #1e293b;
}
.stock-btn--secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.stock-btn--ghost {
    background: transparent;
    color: #64748b;
}
.stock-btn--ghost:hover { background: #f1f5f9; color: #1e293b; }
.stock-btn--danger {
    background: #fff;
    border-color: var(--stock-danger);
    color: var(--stock-danger);
}
.stock-btn--danger:hover { background: var(--stock-danger); color: #fff; }
.stock-btn--sm { padding: 6px 10px; font-size: 12px; }

/* ---------- Input & Form ---------- */
.stock-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    color: #0f172a;
    background: #fff;
    transition: all 0.15s;
}
.stock-input:focus {
    outline: none;
    border-color: var(--stock-accent);
    box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
}
.stock-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.stock-form-row { margin-bottom: 16px; }
.stock-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.stock-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ---------- Activity feed ---------- */
.stock-feed { max-height: 420px; overflow-y: auto; }
.stock-feed-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.stock-feed-item:last-child { border-bottom: none; }
.stock-feed-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--stock-accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.stock-feed-item__content { flex: 1; font-size: 13px; }
.stock-feed-item__content strong { color: #0f172a; }
.stock-feed-item__time {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ---------- Empty & Loading ---------- */
.stock-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}
.stock-empty__icon {
    margin: 0 auto 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}
.stock-empty__title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.stock-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 13px;
}

/* ---------- Filter bar ---------- */
.stock-filter-bar {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.stock-filter-bar__search {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.stock-filter-bar__search input {
    padding-left: 38px;
}
.stock-filter-bar__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

/* ---------- Pagination ---------- */
.stock-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #64748b;
    gap: 12px;
    flex-wrap: wrap;
}
.stock-pagination__pages {
    display: flex;
    gap: 4px;
}
.stock-pagination__btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
}
.stock-pagination__btn:hover:not(:disabled) { background: #f8fafc; }
.stock-pagination__btn:disabled { opacity: 0.5; cursor: not-allowed; }
.stock-pagination__btn.active {
    background: var(--stock-accent);
    color: #fff;
    border-color: var(--stock-accent);
}

/* ---------- Chart container ---------- */
.stock-chart-container {
    position: relative;
    height: 300px;
}

/* ---------- Modal ---------- */
.stock-modal-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,0.55);
    z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
    padding: 60px 20px 20px; overflow-y: auto;
    animation: stockFadeIn 0.15s ease;
}
.stock-modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 720px;
    box-shadow: 0 20px 60px rgba(15,23,42,0.3);
    animation: stockSlideUp 0.2s ease;
}
.stock-modal--sm { max-width: 480px; }
.stock-modal--lg { max-width: 960px; }
.stock-modal__header {
    padding: 18px 22px; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.stock-modal__header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--stock-primary); }
.stock-modal__close {
    background: transparent; border: 0; font-size: 18px; cursor: pointer;
    color: #64748b; width: 32px; height: 32px; border-radius: 8px;
}
.stock-modal__close:hover { background: #f1f5f9; color: #0f172a; }
.stock-modal__body { padding: 22px; max-height: calc(100vh - 220px); overflow-y: auto; }
.stock-modal__footer {
    padding: 14px 22px; border-top: 1px solid #e2e8f0;
    display: flex; justify-content: flex-end; gap: 8px; background: #f8fafc;
    border-radius: 0 0 14px 14px;
}
@keyframes stockFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes stockSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Error text ---------- */
.stock-error {
    color: var(--stock-danger); font-size: 12px; margin-top: 4px;
}

/* ---------- Toast ---------- */
.stock-toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.stock-toast {
    padding: 12px 18px; border-radius: 10px; background: #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,0.15); min-width: 280px;
    font-size: 13px; font-weight: 500; color: #0f172a;
    border-left: 4px solid var(--stock-accent); pointer-events: auto;
    animation: stockSlideIn 0.25s ease;
}
.stock-toast--success { border-left-color: var(--stock-success); }
.stock-toast--danger { border-left-color: var(--stock-danger); }
.stock-toast--warning { border-left-color: var(--stock-warning); }
@keyframes stockSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .stock-grid-2 { grid-template-columns: 1fr; }
    .stock-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .stock-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .stock-sidebar.is-open { transform: translateX(0); }
    .stock-main { margin-left: 0; }
    .stock-form-grid, .stock-form-grid-3 { grid-template-columns: 1fr; }
}
