/* css/style.css - ZOMBER ERP PRO */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --primary-glow: rgba(79, 70, 229, 0.25);
    --dark: #0c1222;
    --dark-soft: #151d32;
    --bg: #f1f5f9;
    --bg-gradient: linear-gradient(160deg, #f8fafc 0%, #eef2ff 50%, #f1f5f9 100%);
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --neutral: #64748b;
    --border: #e2e8f0;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(12, 18, 34, 0.04);
    --shadow-md: 0 8px 24px rgba(12, 18, 34, 0.06);
    --shadow-lg: 0 16px 40px rgba(12, 18, 34, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- HEADER --- */
header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
    color: white;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 64px;
    box-shadow: 0 4px 20px rgba(12, 18, 34, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-btn {
    font-size: 26px;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.menu-btn:hover { background: rgba(255, 255, 255, 0.08); }

.logo {
    font-size: 20px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px;
    cursor: pointer;
}
.logo span { color: #818cf8; }

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    left: -285px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, #0f172a 100%);
    color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 4000;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
}

.sidebar.active { left: 0 !important; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
}

.sidebar-link {
    display: block;
    padding: 14px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 700;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--primary);
    color: white;
}

.submenu {
    display: none;
    padding-left: 10px;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    margin: 5px 0 15px;
}
.submenu.show { display: flex !important; }

.sub-link {
    display: block;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
}
.sub-link:hover { color: white; background: rgba(255, 255, 255, 0.08); }

/* --- LAYOUT --- */
.container {
    padding: 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.panel {
    background: var(--card);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

/* --- FORMS --- */
input, select, textarea {
    width: 100%;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 800;
    cursor: pointer;
    padding: 15px 25px;
    transition: 0.2s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

/* --- STATS (SKT + dashboard) --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    padding: 20px 10px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border-bottom: 4px solid var(--primary);
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    border-bottom-width: 4px;
}

.stat-card.active {
    background: linear-gradient(180deg, #fafbff 0%, #eef2ff 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #c7d2fe;
}

.stat-card h3 { font-size: 24px; font-weight: 800; margin-bottom: 4px; line-height: 1; }
.stat-card p {
    font-size: 11px;
    font-weight: 700;
    color: var(--neutral);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-card .stat-bar {
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    margin-top: 10px;
    overflow: hidden;
}
.stat-card .stat-bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

/* Grafikler — yalnızca SKT & dashboard */
.analytics-panel { margin-bottom: 28px; }
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .charts-grid { grid-template-columns: 1fr 1.2fr; }
}
.chart-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.chart-card h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}
.chart-card .chart-sub {
    font-size: 11px;
    color: var(--neutral);
    font-weight: 600;
    margin-bottom: 16px;
}
.chart-wrap {
    position: relative;
    height: 220px;
    max-width: 280px;
    margin: 0 auto;
}
.chart-wrap-tall { height: 260px; max-width: none; }
.chart-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    text-align: center;
    pointer-events: none;
}
.chart-center-label strong {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}
.chart-center-label small {
    font-size: 10px;
    font-weight: 700;
    color: var(--neutral);
    text-transform: uppercase;
}

/* --- PRODUCT CARDS --- */
.urun-kart {
    background: var(--card);
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 8px solid var(--neutral);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left-width: 8px;
}
.renk-safe { border-left-color: var(--success) !important; }
.renk-warning { border-left-color: var(--warning) !important; }
.renk-expired { border-left-color: var(--danger) !important; animation: pulse-light 2s infinite; }

@keyframes pulse-light {
    0%, 100% { background-color: #fff; }
    50% { background-color: #fef2f2; }
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(12, 18, 34, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    padding: 35px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.close-modal {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    background: var(--bg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box {
    width: 100%;
    padding: 16px 25px;
    border-radius: 50px;
    border: 2px solid white;
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(12, 18, 34, 0.5);
    display: none;
    z-index: 3500;
}
.sidebar-overlay.active { display: block; }

/* --- TABLES --- */
.table-responsive { overflow-x: auto; margin-top: 15px; }
.evrak-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.evrak-table th {
    text-align: left;
    padding: 15px;
    background: var(--bg);
    color: var(--neutral);
    font-size: 12px;
    text-transform: uppercase;
}
.evrak-table td { padding: 15px; border-bottom: 1px solid var(--border); font-size: 14px; }

.old-price { text-decoration: line-through; color: var(--danger); font-size: 18px; margin-right: 8px; opacity: 0.6; }
.discount-badge {
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    display: inline-block;
}

footer {
    background: var(--dark);
    color: white;
    padding: 50px 5% 30px;
    margin-top: 60px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    transition: 0.2s;
}
.footer-links a:hover { color: white; }

#undo-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    transition: 0.4s;
    box-shadow: var(--shadow-lg);
}
#undo-toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 768px) {
    .container { padding: 15px; }
    .panel { padding: 20px; }
    .stat-card h3 { font-size: 20px; }
    .urun-kart { padding: 12px 15px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .urun-kart button { width: 100%; }
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield !important;
    appearance: none;
}

.evrak-table input {
    padding: 6px 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}
.evrak-table input:focus {
    border-color: var(--primary);
    background-color: #f8fafc;
}

.header-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    padding: 5px 5px 5px 12px;
    border-radius: 50px;
    transition: 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.header-profile-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #818cf8;
}
.header-profile-btn span {
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.header-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* Toggle switch (ayarlar) */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: 0.25s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(24px); }
