/* frontend/css/components.css */
/* Ek bileşen stilleri */

/* ── Expenses View ──────────────────────────── */
#view-expenses .expense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.expense-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expense-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.expense-amount {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--danger);
}

.expense-title { font-size: 0.875rem; font-weight: 600; }
.expense-date  { font-size: 0.72rem; color: var(--text-muted); }

/* ── Product Management Panel ────────────────── */
.product-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.product-manage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-manage-card:hover { border-color: var(--accent); }

.product-manage-name  { font-size: 0.875rem; font-weight: 600; }
.product-manage-price { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; }
.product-manage-stock { font-size: 0.72rem; color: var(--text-muted); }
.product-manage-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 600;
}
.badge-active   { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.badge-inactive { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger); }
.badge-qr       { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info); }

/* ── Stat Cards ──────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}

.stat-card.success::before { background: var(--success); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.info::before    { background: var(--info); }

.stat-icon  { font-size: 1.4rem; margin-bottom: 8px; }
.stat-value { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); }
.stat-label { font-size: 0.72rem; color: var(--text-secondary); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Timeline / Audit Log ────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 16px 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-base);
}

.timeline-time   { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 3px; font-family: var(--font-mono); }
.timeline-action { font-size: 0.82rem; font-weight: 600; }
.timeline-detail { font-size: 0.75rem; color: var(--text-secondary); }

/* ── Printer Receipt (Print CSS) ─────────────── */
@media print {
  body * { visibility: hidden; }
  #receiptPrint, #receiptPrint * { visibility: visible; }
  #receiptPrint {
    position: absolute;
    left: 0; top: 0;
    width: 80mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #000;
  }
}

/* ── Number Input Spinner Hide ───────────────── */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Helpers ─────────────────────────────────── */
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-accent  { color: var(--accent) !important; }
.mono         { font-family: var(--font-mono); }
.bold         { font-weight: 700; }
.text-center  { text-align: center; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.gap-8        { gap: 8px; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Overlay Sidebar (mobile) ────────────────── */
@media (max-width: 768px) {
  .sidebar.open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
  }
}

/* ── Focus Visible ───────────────────────────── */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Settings Tab Content ────────────────────── */
.settings-tab-content { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ── Data Table Wrapper ──────────────────────── */
.data-table-wrap { overflow-x:auto; }

/* ── Textarea ────────────────────────────────── */
textarea {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-main);
    transition: border-color var(--transition);
    outline: none;
    width: 100%;
}
textarea:focus { border-color: var(--border-focus); }

/* ── Color Input ─────────────────────────────── */
input[type="color"] {
    cursor: pointer;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    width: 100%;
}

/* ── Checkbox ────────────────────────────────── */
input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
}

/* ── Dolu form-group rows ────────────────────── */
.form-group[style*="grid-column"] { margin-bottom:0; }

/* ── Bill item cancel admin guard ────────────── */
.admin-cancel-note {
    font-size:0.68rem;
    color:var(--text-muted);
    text-align:center;
    padding:4px;
}
