/* ================================================================
   Beppe Suite — Shared Styles
   Tüm uygulamaların paylaştığı değişkenler, reset, temel bileşenler
   ================================================================ */

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #16161f;
  --surface3: #1c1c28;
  --border: #1e1e2e;
  --border2: #2a2a3e;
  --text: #e8e8f0;
  --text2: #8888aa;
  --text3: #555570;
  --accent: #6c63ff;
  --accent2: #8b83ff;
  --accent-bg: rgba(108,99,255,.12);
  --accent-glow: rgba(108,99,255,0.15);
  --green: #22c55e;
  --green-bg: rgba(34,197,94,0.1);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245,158,11,0.1);
  --blue: #3b82f6;
  --blue-bg: rgba(59,130,246,0.1);
  --meta: #1877F2;
  --meta-bg: rgba(24,119,242,.12);
  --purple: #7c3aed;
  --purple-bg: rgba(124,58,237,.12);
  --ai: #06b6d4;
  --ai-bg: rgba(6,182,212,.10);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; border: none; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 20px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 100; display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border2); border-radius: 16px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow); animation: modalIn .2s ease;
}
.modal-lg { max-width: 720px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px; background: var(--surface2);
  border: 1px solid var(--border); cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text2);
  font-size: 16px; transition: all .15s;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── FORM ── */
.form-group { margin-bottom: 16px; }
label { font-size: 12px; font-weight: 500; color: var(--text2); display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text);
  font-size: 13px; font-family: inherit; transition: border-color .15s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 80px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-purple { background: var(--accent-glow); color: var(--accent2); }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: .4; }
.empty-text { font-size: 14px; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.alert-warn { background: var(--yellow-bg); border: 1px solid rgba(245,158,11,.2); color: var(--yellow); }
.alert-info { background: var(--blue-bg);   border: 1px solid rgba(59,130,246,.2);  color: var(--blue); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

/* ── PERFORMANCE: CSS Containment ── */
/* Kartlar arası layout/paint izolasyonu — reflow maliyetini azaltır */
.card          { contain: layout style paint; }
.kpi-card      { contain: layout style paint; }
.nav-item      { contain: layout style; }
.badge         { contain: layout style; }
.modal-overlay { contain: strict; }

/* GPU layer — animasyonlu elementler için önceden katman oluştur */
.modal         { will-change: transform; }
.modal-overlay { will-change: opacity; }
.sidebar       { will-change: transform; }

/* Table satırları için paint containment */
tr             { contain: layout; }

/* ── PWA SAFE AREA (Notch / Dynamic Island / Home Bar) ── */
:root {
  --sat: env(safe-area-inset-top,    0px);
  --sar: env(safe-area-inset-right,  0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
}

/* Sidebar uygulamalarında topbar üstten safe area kadar padding alır */
.topbar  { padding-top: max(0px, var(--sat)); }
/* Mobilde bottom nav bar / home bar için içerik padding */
.content { padding-bottom: max(24px, calc(24px + var(--sab))); }
/* Modal overlay tam ekran + safe area */
.modal-overlay { padding: max(16px, var(--sat)) max(16px, var(--sar)) max(16px, var(--sab)) max(16px, var(--sal)); }

/* ── UTILITY ── */
.divider      { height: 1px; background: var(--border); margin: 20px 0; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; gap: 8px; }
.gap-8        { gap: 8px; }
.w-full       { width: 100%; }
.font-mono    { font-family: monospace; }
.pos          { color: var(--green); }
.neg          { color: var(--red); }
.dot          { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
