/* ================================================================
   Beppe OS — index.html özel stiller
   ================================================================ */

html, body { height: 100%; }
body { display: flex; overflow: hidden; height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 240px; height: 100vh; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0; z-index: 10; overflow-y: auto;
}
.logo {
  padding: 24px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.logo-icon {
  width: 36px; height: 36px; background: linear-gradient(135deg,var(--accent),var(--accent2));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
.logo-sub  { font-size: 11px; color: var(--text3); margin-top: 1px; }

nav { padding: 12px 10px; flex: 1; overflow-y: auto; min-height: 0; }
.nav-group { margin-bottom: 20px; }
.nav-label {
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em; padding: 0 10px; margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
  color: var(--text2); font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent2); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff; font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: 20px;
}

.sidebar-footer {
  padding: 14px 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#6c63ff,#22c55e);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-info { font-size: 12px; }
.avatar-name { font-weight: 600; color: var(--text); }
.avatar-role { color: var(--text3); font-size: 11px; }

/* ── MAIN ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0;
}
.page-title { font-size: 15px; font-weight: 700; color: var(--text); }
.page-sub   { font-size: 12px; color: var(--text3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── KUR SELECTOR ── */
.cur-selector {
  display: flex; align-items: center; gap: 0; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
}
.cur-btn {
  padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: transparent; border: none; color: var(--text3); transition: all .12s; white-space: nowrap;
}
.cur-btn:hover  { background: var(--surface2); color: var(--text); }
.cur-btn.active { background: var(--accent); color: #fff; }
.cur-rate-chips { display: flex; align-items: center; gap: 6px; }
.cur-chip {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text2);
  white-space: nowrap; cursor: pointer;
}
.cur-chip:hover { border-color: var(--accent); color: var(--accent2); }

/* ── KUR MODAL ── */
.kur-modal-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.kur-modal-row:last-child { border-bottom: none; }
.kur-flag  { font-size: 22px; width: 32px; text-align: center; }
.kur-name  { font-size: 13px; font-weight: 700; min-width: 60px; }
.kur-sub   { font-size: 11px; color: var(--text3); }
.kur-input-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.kur-input-wrap span  { font-size: 11px; color: var(--text3); }
.kur-input-wrap input { width: 100px; text-align: right; font-family: monospace; font-size: 13px; }

/* ── CONTENT / PAGES ── */
.content { flex: 1; overflow-y: auto; padding: 24px; min-height: 0; }
.page        { display: none; }
.page.active { display: block; }

/* ── KPI CARDS ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; overflow: hidden;
}
.kpi-card::before { content:''; position: absolute; top:0; left:0; right:0; height: 2px; }
.kpi-card.green::before  { background: linear-gradient(90deg,var(--green),transparent); }
.kpi-card.red::before    { background: linear-gradient(90deg,var(--red),transparent); }
.kpi-card.blue::before   { background: linear-gradient(90deg,var(--blue),transparent); }
.kpi-card.yellow::before { background: linear-gradient(90deg,var(--yellow),transparent); }
.kpi-card.purple::before { background: linear-gradient(90deg,var(--accent),transparent); }
.kpi-label  { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 8px; }
.kpi-value  { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.kpi-change { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-sub    { font-size: 11px; color: var(--text3); margin-top: 4px; }
.kpi-icon {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.kpi-icon.green  { background: var(--green-bg); }
.kpi-icon.red    { background: var(--red-bg); }
.kpi-icon.blue   { background: var(--blue-bg); }
.kpi-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.kpi-icon.purple { background: var(--accent-glow); color: var(--accent); }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── CARD ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-sub   { font-size: 12px; color: var(--text3); margin-top: 2px; }
.card-body  { padding: 20px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface2);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.td-primary { color: var(--text); font-weight: 500; }

/* ── SEARCH ── */
.search-bar { position: relative; flex: 1; max-width: 300px; }
.search-bar input { padding-left: 36px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 14px; }

/* ── ACTIVITY ── */
.activity-list { list-style: none; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border); contain: layout style;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot  { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.activity-text { font-size: 13px; color: var(--text2); }
.activity-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── CHART BARS ── */
.chart      { padding: 8px 0; }
.chart-row  { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.chart-label    { font-size: 12px; color: var(--text2); width: 60px; text-align: right; flex-shrink: 0; }
.chart-bar-wrap { flex: 1; background: var(--surface2); border-radius: 4px; height: 8px; overflow: hidden; }
.chart-bar      { height: 100%; border-radius: 4px; transition: width .6s ease; }
.chart-val      { font-size: 12px; color: var(--text3); width: 70px; text-align: left; flex-shrink: 0; }

/* ── STOCK INDICATOR ── */
.stock-bar  { height: 4px; background: var(--surface2); border-radius: 2px; margin-top: 4px; }
.stock-fill { height: 100%; border-radius: 2px; transition: width .3s; }

/* ── INVOICE ── */
.invoice-header { display: flex; justify-content: space-between; margin-bottom: 24px; }
.invoice-items th, .invoice-items td { padding: 8px 12px; }
.invoice-total { text-align: right; margin-top: 12px; }
.invoice-total .total-line { display: flex; justify-content: flex-end; gap: 20px; margin-bottom: 4px; font-size: 13px; }
.invoice-total .grand-total { font-size: 16px; font-weight: 700; color: var(--text); }
.invoice-print-header { display: none; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text2); cursor: pointer; transition: all .15s; text-align: center;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

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

@media(max-width:768px) {
  body { flex-direction: column; height: 100dvh; }
  .sidebar {
    width: 100%; height: auto; min-height: unset; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--border);
    flex-direction: row; align-items: center; padding: 0 12px; flex-shrink: 0;
  }
  .logo { padding: 10px 8px; border-bottom: none; }
  .logo-sub { display: none; }
  nav {
    display: flex; flex-direction: row; padding: 6px 4px;
    overflow-x: auto; flex: 1; gap: 2px;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .nav-item { flex-direction: column; gap: 3px; padding: 6px 10px; font-size: 10px; white-space: nowrap; min-width: fit-content; }
  .nav-icon { font-size: 18px; width: auto; }
  .nav-badge { display: none; }
  .sidebar-footer { display: none; }
  .main { overflow: hidden; min-height: 0; }
  .topbar { padding: 0 14px; height: 50px; }
  .topbar-right { gap: 6px; }
  .content { padding: 14px; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .modal { margin: 8px; max-width: calc(100vw - 16px) !important; max-height: 92vh; overflow-y: auto; }
  .modal-footer { flex-wrap: wrap; gap: 8px; }
  table { font-size: 12px; }
  .btn-sm { font-size: 11px; padding: 4px 8px; }
  .form-grid-2, .form-row { grid-template-columns: 1fr !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
}

@media(max-width:480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar .page-sub { display: none; }
  .modal { margin: 4px; max-width: calc(100vw - 8px) !important; }
  .topbar-right .btn:not(:last-child) { display: none; }
}

/* ── PRINT ── */
@media print {
  body { background: #fff !important; color: #000 !important; overflow: visible !important; }
  .sidebar, .topbar, .modal-close, #fatura-view-paid { display: none !important; }
  .modal-overlay { position: static !important; background: none !important; backdrop-filter: none !important; display: block !important; padding: 0 !important; }
  .modal { box-shadow: none !important; border: none !important; max-width: 100% !important; width: 100% !important; border-radius: 0 !important; }
  .modal-header { border-bottom: 1px solid #ccc !important; background: #fff !important; }
  .modal-header .modal-title { color: #000 !important; }
  .modal-footer { display: none !important; }
  .modal-body { padding: 24px !important; }
  .invoice-print-header { display: block !important; margin-bottom: 20px; border-bottom: 2px solid #6c63ff; padding-bottom: 12px; }
  .invoice-header { color: #000 !important; }
  .invoice-items th, .invoice-items td { border: 1px solid #ccc !important; padding: 6px 10px !important; color: #000 !important; background: #fff !important; }
  .invoice-items th { background: #f5f5f5 !important; }
  .invoice-total .total-line, .invoice-total .grand-total { color: #000 !important; }
  .badge { border: 1px solid #ccc !important; color: #000 !important; background: #f5f5f5 !important; }
}
