@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: #111827;      
    --panel-bg: #1f2937;     
    --border: #374151;       
    --text-main: #f8fafc;    
    --text-muted: #94a3b8;   
    --accent-blue: #0ea5e9;  
    --accent-green: #10b981; 
    --accent-orange: #ea580c;
    --accent-red: #ef4444;   
    --accent-purple: #6366f1;
    
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-base); color: var(--text-main); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* NAVBAR */
.top-nav { background-color: var(--panel-bg); display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; border-bottom: 1px solid var(--border); }
.nav-left { display: flex; align-items: center; gap: 20px; }
.logo { font-size: 24px; font-weight: 800; color: var(--accent-blue); display: flex; align-items: center; gap: 10px; }
.logo span { color: white; }
.nav-badges { display: flex; gap: 10px; }
.badge { background: rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 20px; font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-link { background: transparent; color: var(--text-muted); border: none; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.3s; border-radius: 20px; white-space: nowrap; }
.nav-link:hover { color: white; }
.nav-link.active { background: rgba(255,255,255,0.1); color: white; border: 1px solid var(--border); }
.btn-exit { background: transparent; color: var(--accent-red); border: 1px solid var(--accent-red); padding: 10px 20px; border-radius: 20px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-exit:hover { background: var(--accent-red); color: white; }

/* GENEL YAPILAR */
.content-wrapper { flex: 1; padding: 20px 30px; overflow-y: auto; }
.screen { display: none; height: 100%; animation: fadeIn 0.3s ease; }
.screen.active { display: flex; gap: 20px; width: 100%; }
.screen.active.reports-layout { flex-direction: column; } 
.panel { background-color: var(--panel-bg); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; }

/* TABLOLAR VE STOK RENKLERİ */
.table-container { flex: 1; overflow-y: auto; margin-top: 15px; width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 15px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel-bg); z-index: 10; }
td { padding: 15px 10px; font-size: 14px; color: var(--text-main); border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.2s;}
tr:hover td { background-color: rgba(255,255,255,0.05); }

.stock-zero { background-color: var(--accent-red) !important; color: white !important; }
.stock-zero td { color: white !important; border-bottom: 1px solid rgba(255,255,255,0.2) !important; }
.stock-zero .table-btn { background-color: rgba(0,0,0,0.3) !important; color: white !important; border: 1px solid rgba(255,255,255,0.5); }
.stock-zero:hover td { background-color: rgba(0,0,0,0.1) !important; }

.table-btn { background: var(--accent-blue); color: white; border: none; padding: 6px 12px; border-radius: 6px; font-weight: bold; font-size: 12px; cursor: pointer; }

/* FORM ELEMANLARI */
.form-input { width: 100%; background: var(--bg-base); border: 1px solid var(--border); color: white; padding: 14px 15px; border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: 0.3s; margin-bottom: 15px; }
.form-input:focus { border-color: var(--accent-orange); }
.form-input:disabled { opacity: 0.7; cursor: not-allowed; }
.search-bar { background: var(--bg-base); display: flex; align-items: center; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); width: 100%; }
.search-bar i { color: var(--text-muted); }
.search-bar input { border: none; background: transparent; padding: 15px; width: 100%; color: white; outline: none; }

/* BUTONLAR */
.btn-primary { width: 100%; background: var(--accent-blue); color: white; border: none; padding: 15px; border-radius: var(--radius-sm); font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 15px; }
.btn-primary:active { transform: scale(0.98); }
.bg-green { background-color: var(--accent-green) !important; }
.bg-blue { background-color: var(--accent-blue) !important; }
.bg-orange { background-color: var(--accent-orange) !important; color: white !important; }
.bg-red { background-color: var(--accent-red) !important; }
.bg-purple { background-color: var(--accent-purple) !important; }
.bg-gray { background-color: #475569 !important; color: white !important; }

/* SATIŞ EKRANI SPESİFİK */
.sales-left { flex: 7; width: 100%; }
.sales-right { flex: 3; justify-content: space-between; min-width: 320px; }
.summary-box { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); margin-bottom: 10px; }
.summary-total { display: flex; justify-content: space-between; font-size: 28px; font-weight: 800; color: white; margin-top: 15px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-btn { padding: 20px 10px; border: none; border-radius: var(--radius-sm); color: white; font-weight: bold; font-size: 14px; cursor: pointer; transition: 0.2s; box-shadow: var(--shadow); }
.action-btn:active { transform: scale(0.96); }

/* GELİR GİDER EKRANI */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; width: 100%; }
.stat-card { background: var(--panel-bg); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.stat-title { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.stat-value { font-size: 24px; font-weight: bold; color: var(--accent-green); }
.stat-value.danger { color: var(--accent-red); }
.reports-bottom { display: flex; gap: 20px; flex: 1; min-height: 0; width: 100%; }
.report-tabs { display: flex; gap: 5px; background: rgba(0,0,0,0.2); padding: 4px; border-radius: 8px;}
.r-tab { padding: 8px 16px; background: transparent; color: var(--text-muted); border: none; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.r-tab.active { background: var(--accent-blue); color: white; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; align-items: center; width: 100%; }
.f-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.f-btn.active { border-color: var(--accent-blue); color: white; background: rgba(14, 165, 233, 0.2); }
.f-btn.green.active { border-color: var(--accent-green); color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }
.f-btn.red.active { border-color: var(--accent-red); color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }
.report-acc-item { background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; width: 100%; }
.report-acc-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; cursor: pointer; background: rgba(255,255,255,0.02); transition: 0.2s; font-weight: bold; }
.report-acc-header:hover { background: rgba(255,255,255,0.05); }
.report-acc-body { display: none; padding: 0 15px 15px 15px; border-top: 1px solid var(--border); }
.r-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed rgba(255,255,255,0.1); }
.r-row:last-child { border-bottom: none; }

/* STOKLAR & CARİ EKRANI SPESİFİK */
.two-col-layout { width: 100%; gap: 20px; }
.col-small { flex: 3; width: 100%; min-width: 300px; }
.col-large { flex: 7; width: 100%; }

/* MODALLAR */
.modal-overlay { display: none; position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 9999; justify-content: center; align-items: center; }
.modal-box { background: var(--panel-bg); width: 100%; max-width: 500px; border-radius: var(--radius-md); padding: 30px; border: 1px solid var(--border); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); animation: popIn 0.3s; color: white; max-height: 95vh; overflow-y: auto;}
.modal-header-orange { font-size: 20px; font-weight: bold; color: var(--accent-orange); border-bottom: 1px solid var(--border); padding-bottom: 15px; margin-bottom: 20px; margin-top: 0; text-align: center; position: sticky; top: 0; background: var(--panel-bg); z-index: 10;}
.modal-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.m-tab { flex: 1; padding: 12px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: var(--radius-sm); font-weight: bold; cursor: pointer; transition: 0.3s; }
.m-tab.active { background: var(--accent-orange); color: white; border-color: var(--accent-orange); }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-submit { flex: 2; color: white; border: none; padding: 15px; border-radius: var(--radius-sm); font-weight: bold; font-size: 15px; cursor: pointer; transition: 0.2s;}
.btn-submit:active { transform: scale(0.96); }
.btn-cancel { flex: 1; background: var(--border); color: white; border: none; padding: 15px; border-radius: var(--radius-sm); font-weight: bold; font-size: 15px; cursor: pointer; transition: 0.2s;}
.btn-cancel:active { transform: scale(0.96); }

/* AYARLAR MODALI İÇİN SEKME VE TOGGLE YAPILARI */
.settings-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.s-tab { padding: 12px 15px; font-size: 13px; font-weight: bold; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: 0.3s; white-space: nowrap; }
.s-tab:hover { color: white; }
.s-tab.active { color: var(--accent-orange); border-bottom-color: var(--accent-orange); }
.settings-pane { display: none; animation: fadeIn 0.3s ease; }
.settings-pane.active { display: block; }
.user-card { background: rgba(0,0,0,0.2); padding: 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 15px; }
.user-card h4 { margin-top: 0; margin-bottom: 15px; font-size: 14px; color: var(--accent-blue); display: flex; justify-content: space-between; align-items: center; }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-green); }
input:checked + .slider:before { transform: translateX(20px); }

/* KAMERA VE DİĞERLERİ */
.modal-top-img { width: 100%; height: 100%; border-radius: var(--radius-md); background-color: var(--bg-base); border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); background-size: contain; background-position: center; background-repeat: no-repeat; cursor: pointer; transition: 0.3s; }
.modal-top-img:hover { border-color: var(--accent-blue); }
#scanner-modal .modal-box { padding: 20px; max-width: 400px; text-align: center; }
#reader { width: 100%; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--border); margin-bottom: 15px; min-height: 250px; background: black; }
#reader video { object-fit: cover; border-radius: var(--radius-sm); }

/* SNACKBAR */
#login-screen { position: fixed; inset: 0; background: var(--bg-base); z-index: 99999; display: flex; justify-content: center; align-items: center; }
.login-box { background: var(--panel-bg); padding: 40px; border-radius: var(--radius-md); border: 1px solid var(--border); text-align: center; width: 350px; }
#snackbar { visibility: hidden; min-width: 250px; background-color: var(--accent-blue); color: #fff; text-align: center; border-radius: 8px; padding: 16px; position: fixed; z-index: 100000; left: 50%; bottom: 30px; transform: translateX(-50%); font-weight: bold; box-shadow: var(--shadow); }
#snackbar.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
#snackbar.success { background-color: var(--accent-green); }
#snackbar.error { background-color: var(--accent-red); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes fadein { from { bottom: 0; opacity: 0; } to { bottom: 30px; opacity: 1; } }
@keyframes fadeout { from { bottom: 30px; opacity: 1; } to { bottom: 0; opacity: 0; } }

@media (max-width: 768px) {
    body { height: 100vh; overflow-y: auto; display: block; }
    .top-nav { flex-direction: column; align-items: flex-start; padding: 15px; gap: 15px; position: sticky; top: 0; z-index: 100; }
    .nav-left { width: 100%; justify-content: space-between; }
    .nav-right { width: 100%; overflow-x: auto; padding-bottom: 5px; justify-content: flex-start; }
    .nav-right::-webkit-scrollbar { display: none; }
    .content-wrapper { padding: 15px; height: auto; overflow: visible; }
    .screen.active { flex-direction: column; gap: 15px; }
    .sales-left, .sales-right, .col-small, .col-large { width: 100%; flex: none; }
    .table-container { overflow-x: auto; white-space: nowrap; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; } 
    .modal-box { width: 95%; padding: 20px; margin: 10px auto; }
}