:root {
    --primary: #1a237e;
    --accent: #42a5f5;
    --danger: #ef5350;
    --warning: #ff9800;
    --success: #66bb6a;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #212121;
    --text-light: #757575;
    --border: #e0e0e0;
    --sidebar: 230px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar);
    background: linear-gradient(180deg, #1a237e 0%, #283593 100%);
    color: white;
    position: fixed;
    height: 100vh;
    box-shadow: 3px 0 10px rgba(0,0,0,0.2);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 22px 18px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.15);
}

.logo i { font-size: 26px; color: var(--accent); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.25s;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--accent);
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; }

/* ── ANA İÇERİK ── */
.main-content {
    margin-left: var(--sidebar);
    flex: 1;
    padding: 24px;
}

.sayfa { display: none; }
.sayfa.aktif { display: block; }

/* ── HEADER ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    color: var(--primary);
    font-weight: 700;
}

.page-header h1 i { color: var(--accent); margin-right: 8px; }

.tarih-filtre {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 14px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tarih-filtre input {
    border: 1px solid var(--border);
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.tarih-filtre button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.tarih-filtre button:hover { opacity: 0.85; }

/* ── ÖZET KARTLAR ── */
.kart-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.kart {
    background: white;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.2s;
}

.kart:hover { transform: translateY(-3px); }

.kart-ikon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.kart-mavi   .kart-ikon { background: linear-gradient(135deg,#42a5f5,#1e88e5); }
.kart-kirmizi .kart-ikon { background: linear-gradient(135deg,#ef5350,#c62828); }
.kart-turuncu .kart-ikon { background: linear-gradient(135deg,#ffa726,#e65100); }
.kart-yesil  .kart-ikon { background: linear-gradient(135deg,#66bb6a,#2e7d32); }

.kart-bilgi { display: flex; flex-direction: column; }

.kart-deger {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.kart-baslik {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* ── GRAFİKLER ── */
.grafik-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.grafik-kart {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.grafik-kart.genis { grid-column: 1 / -1; }

.grafik-kart h3 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg);
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ── TABLOLAR ── */
.tablo-kart {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tablo-kart h3 {
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg);
    display: flex;
    align-items: center;
    gap: 7px;
}

.veri-tablo {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.veri-tablo th {
    background: var(--primary);
    color: white;
    padding: 11px 10px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.veri-tablo th:first-child { border-radius: 6px 0 0 0; }
.veri-tablo th:last-child  { border-radius: 0 6px 0 0; }

.veri-tablo td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.veri-tablo tr:last-child td { border-bottom: none; }
.veri-tablo tr:hover td { background: #f8f9ff; }

.toplam-satir td {
    background: #e8eaf6 !important;
    font-weight: bold;
    border-top: 2px solid var(--primary);
}

/* ── FİLTRE PANELİ ── */
.filtre-panel {
    background: white;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.filtre-grup { display: flex; flex-direction: column; gap: 4px; }

.filtre-grup label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtre-grup input,
.filtre-grup select {
    border: 1px solid var(--border);
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
    transition: 0.2s;
    background: white;
}

.filtre-grup input:focus,
.filtre-grup select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66,165,245,0.1);
}

.btn-filtrele, .btn-excel {
    padding: 8px 16px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.btn-filtrele { background: var(--primary); color: white; }
.btn-filtrele:hover { opacity: 0.85; }
.btn-excel { background: #1b5e20; color: white; }
.btn-excel:hover { opacity: 0.85; }

.toplam-bar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 11px 18px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 500;
}

/* ── FORM ── */
.form-kart {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    margin-bottom: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.form-grup { display: flex; flex-direction: column; gap: 6px; }
.form-grup.full-width { grid-column: 1 / -1; }

.form-grup label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-grup input,
.form-grup select,
.form-grup textarea {
    border: 1px solid var(--border);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    font-family: inherit;
    background: white;
}

.form-grup input:focus,
.form-grup select:focus,
.form-grup textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66,165,245,0.12);
}

.readonly-input {
    background: #f0f4ff !important;
    font-weight: 700;
    color: var(--primary);
    font-size: 18px !important;
    text-align: center;
}

/* Toggle */
.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding-top: 5px;
}

.toggle input { display: none; }

.slider {
    width: 48px; height: 25px;
    background: #ccc;
    border-radius: 13px;
    position: relative;
    transition: 0.3s;
    flex-shrink: 0;
}

.slider::before {
    content: '';
    position: absolute;
    width: 19px; height: 19px;
    background: white;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle input:checked + .slider { background: var(--success); }
.toggle input:checked + .slider::before { left: 26px; }

.toggle-label { font-size: 13px; color: var(--text-light); }

.form-butonlar {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.btn-kaydet {
    background: linear-gradient(135deg, var(--primary), #3949ab);
    color: white;
    border: none;
    padding: 11px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-kaydet:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-temizle {
    background: white;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-temizle:hover { background: var(--bg); }

.bugun-toplam {
    margin-top: 10px;
    padding: 10px 14px;
    background: #e8eaf6;
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

/* ── RAPORLAR ── */
.rapor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.rapor-kart {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.rapor-kart h3 {
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg);
    display: flex;
    align-items: center;
    gap: 7px;
}

.rapor-filtre {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.rapor-filtre input {
    border: 1px solid var(--border);
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 13px;
    flex: 1;
    min-width: 120px;
    outline: none;
}

.rapor-filtre button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.rapor-filtre button:hover { opacity: 0.85; }

/* ── BADGE ── */
.badge {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-mekanik  { background:#ffebee; color:#c62828; }
.badge-elektrik { background:#fff3e0; color:#e65100; }
.badge-operator { background:#fce4ec; color:#880e4f; }
.badge-bakim    { background:#e8f5e9; color:#2e7d32; }
.badge-hammadde { background:#e3f2fd; color:#1565c0; }
.badge-mola     { background:#f3e5f5; color:#6a1b9a; }
.badge-diger    { background:#f5f5f5; color:#424242; }

/* ── BUTONLAR ── */
.btn-sil {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 15px;
    padding: 4px 7px;
    border-radius: 5px;
    transition: 0.2s;
}

.btn-sil:hover { background: #ffebee; }

/* ── BİLDİRİM ── */
.bildirim {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 13px 20px;
    border-radius: 9px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bildirim-basari { background: var(--success); }
.bildirim-hata   { background: var(--danger);  }

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

/* ── PROGRESS BAR ── */
.progress-bar {
    background: #e0e0e0;
    border-radius: 4px;
    height: 8px;
    width: 120px;
    overflow: hidden;
}

.progress-fill {
    background: var(--primary);
    border-radius: 4px;
    height: 100%;
    transition: width 0.4s;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
    .kart-grid { grid-template-columns: repeat(2,1fr); }
    .grafik-grid { grid-template-columns: 1fr 1fr; }
    .grafik-kart.genis { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    :root { --sidebar: 55px; }
    .sidebar span { display: none; }
    .logo span    { display: none; }
    .main-content { padding: 14px; }
    .kart-grid    { grid-template-columns: 1fr 1fr; }
    .form-grid    { grid-template-columns: 1fr; }
    .rapor-grid   { grid-template-columns: 1fr; }
    .grafik-grid  { grid-template-columns: 1fr; }
}