:root {
    --bg: #f4f6fb;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --radius: 10px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ===== LAYOUT ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    padding: 22px 20px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand i { color: var(--primary); }

.menu { padding: 12px 0; flex: 1; }
.menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #cbd5e1;
    font-size: 14px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.menu a:hover { background: var(--sidebar-hover); color: #fff; }
.menu a.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
}
.menu a i { width: 18px; text-align: center; }
.menu-group {
    padding: 14px 20px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #64748b;
    text-transform: uppercase;
}

.main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--card-bg);
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 18px; }
.topbar-user small { color: var(--text-light); }
.btn-cikis {
    background: #fee2e2;
    color: var(--danger);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}
.btn-cikis:hover { background: #fecaca; }

.content { padding: 26px; flex: 1; }

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.card-title { font-size: 16px; font-weight: 600; }

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.stat-info .label { font-size: 12.5px; color: var(--text-light); margin-bottom: 3px; }
.stat-info .value { font-size: 22px; font-weight: 700; }
.bg-blue { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.bg-green { background: linear-gradient(135deg,#16a34a,#15803d); }
.bg-orange { background: linear-gradient(135deg,#f59e0b,#d97706); }
.bg-purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.bg-red { background: linear-gradient(135deg,#ef4444,#dc2626); }
.bg-teal { background: linear-gradient(135deg,#14b8a6,#0d9488); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
}
table.data th {
    text-align: left;
    padding: 11px 14px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border);
}
table.data td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
}
table.data tbody tr:hover { background: #f8fafc; }
table.data .text-right { text-align: right; }
table.data .text-center { text-align: center; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    border: none;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.92); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-light { background: #f1f5f9; color: var(--text); }
.btn-light:hover { background: #e2e8f0; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 13px 22px; font-size: 16px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
}
.form-control, select.form-control, textarea.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border 0.15s;
    background: #fff;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field-validation-error, .text-danger { color: var(--danger); font-size: 12.5px; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
}
.alert-success { background: #dcfce7; color: #15803d; }
.alert-danger { background: #fee2e2; color: #b91c1c; }

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.filter-bar .form-group { margin-bottom: 0; }

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.login-box {
    background: #fff;
    width: 380px;
    padding: 38px 34px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.login-logo {
    text-align: center;
    margin-bottom: 26px;
}
.login-logo i { font-size: 42px; color: var(--primary); }
.login-logo h1 { font-size: 22px; margin-top: 10px; }
.login-logo p { color: var(--text-light); font-size: 13px; margin-top: 3px; }

/* ===== POS / SICAK SATIS ===== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 114px);
}
.pos-left, .pos-right {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pos-search { padding: 18px; border-bottom: 1px solid var(--border); }
.pos-search input {
    font-size: 17px;
    padding: 13px 16px;
}
.pos-results { flex: 1; overflow-y: auto; padding: 12px; }
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.pos-product {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
}
.pos-product:hover { border-color: var(--primary); background: #f0f7ff; transform: translateY(-2px); }
.pos-product .pname { font-weight: 600; font-size: 13px; margin-bottom: 6px; min-height: 34px; }
.pos-product .pprice { color: var(--primary); font-weight: 700; font-size: 15px; }
.pos-product .pstock { font-size: 11px; color: var(--text-light); margin-top: 3px; }

.cart-header { padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-item {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.cart-item .ci-name { flex: 1; font-size: 13px; }
.cart-item .ci-name small { display: block; color: var(--text-light); }
.cart-item input.ci-qty {
    width: 56px; text-align: center; padding: 5px;
    border: 1px solid var(--border); border-radius: 6px;
}
.cart-item .ci-total { font-weight: 600; width: 80px; text-align: right; }
.cart-item .ci-remove { color: var(--danger); cursor: pointer; padding: 4px; }
.cart-footer { padding: 18px; border-top: 2px solid var(--border); background: #f8fafc; }
.cart-total-row {
    display: flex; justify-content: space-between;
    padding: 5px 0; font-size: 14px;
}
.cart-total-row.grand { font-size: 22px; font-weight: 700; color: var(--primary); border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 12px; }
.pay-buttons { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0; }
.pay-btn {
    padding: 12px; border: 2px solid var(--border); border-radius: 9px;
    background: #fff; cursor: pointer; font-weight: 600; font-size: 13px;
    text-align: center; transition: all 0.12s;
}
.pay-btn.selected { border-color: var(--primary); background: #eff6ff; color: var(--primary); }
.pos-empty { text-align: center; color: var(--text-light); padding: 50px 20px; }

.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } .pos-layout { grid-template-columns: 1fr; height: auto; } }

.muted { color: var(--text-light); }
.mt-2 { margin-top: 10px; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 10px; }

/* Fiş yazdırma */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
}
.fis {
    max-width: 320px; margin: 0 auto; background: #fff; padding: 20px;
    font-family: 'Courier New', monospace; font-size: 13px;
}
.fis-center { text-align: center; }
.fis hr { border: none; border-top: 1px dashed #999; margin: 10px 0; }
.fis table { width: 100%; }
.fis table td { padding: 2px 0; }

/* ===== EK BILESENLER (modul ekranlari) ===== */

/* Sayfa basligi */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.page-header h1 i { color: var(--primary); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* stat-grid: stats-grid ile ayni davranis (yeni ekranlar icin alias) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-body { display: flex; flex-direction: column; }
.stat-label { font-size: 12.5px; color: var(--text-light); margin-bottom: 3px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-body small { color: var(--text-light); font-size: 12px; }
.stat-link {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.stat-link:hover { text-decoration: underline; }

/* Bos tablo satiri */
table.data td.empty, td.empty {
    text-align: center;
    color: var(--text-light);
    padding: 28px 14px;
    font-style: italic;
}

/* Tutar renkleri */
.tutar-pozitif { color: var(--success); font-weight: 600; }
.tutar-negatif { color: var(--danger); font-weight: 600; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); font-size: 12px; }

/* Badge gri (alias) */
.badge-muted { background: #f1f5f9; color: #475569; }

/* Iki sutunlu grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 0;
}

/* Filtre formu (rapor ekranlari) */
.filter-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-form .form-group { margin-bottom: 0; }

/* Fatura ekrani */
.fatura-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .fatura-layout { grid-template-columns: 1fr; }
}
.fatura-ozet {
    margin-top: 16px;
    border-top: 2px solid var(--border);
    padding-top: 14px;
}
.ozet-satir {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}
.ozet-satir.ozet-genel {
    border-top: 1px dashed var(--border);
    margin-top: 6px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* Detay grid (fatura/cari detay) */
.detay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.detay-grid > div { display: flex; flex-direction: column; }
.detay-label { font-size: 12px; color: var(--text-light); margin-bottom: 3px; }
.detay-deger { font-size: 15px; font-weight: 600; }

/* Form aksiyon butonlari */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.btn-secondary { background: #f1f5f9; color: var(--text); }
.btn-secondary:hover { background: #e2e8f0; }

hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
