/* LMD İdari — temel stil. PL-TABLO Next.js sürümünün görsel diliyle uyumlu. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #94a3b8;
  --brand-50: #fef2f2;
  --brand-500: #ef4444;
  --brand-600: #dc2626;
  --success: #16a34a;
  --info: #2563eb;
  --warn: #ea580c;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; position: relative; }
.app-sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
  transition: transform 0.25s ease;
}
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 25;
}
.mobile-only { display: none; }

@media (max-width: 768px) {
  .mobile-only { display: inline-flex; }
  .app-sidebar {
    position: fixed; left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 4px 0 12px rgba(0,0,0,0.1);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop.is-open { display: block; }
  .app-content { padding: 0.875rem; }
  .app-header { padding: 0 0.75rem; }
}
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 20;
  height: 56px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
}
.app-header-left, .app-header-right { display: flex; align-items: center; gap: 0.5rem; }
.app-content { padding: 1.5rem; flex: 1; }

/* Sidebar */
.sidebar-brand {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 1.25rem 1.25rem 1rem;
}
.brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.brand-name { font-weight: 700; font-size: 14px; line-height: 1; }
.brand-sub  { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); margin-top: 4px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 0.75rem 1rem; display: flex; flex-direction: column; gap: 1.25rem; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-title {
  padding: 0 0.5rem 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-soft); font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px; font-size: 14px;
  color: var(--text-muted);
  transition: background-color 0.15s, color 0.15s;
  position: relative;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active {
  background: var(--brand-50); color: var(--brand-600);
  font-weight: 600;
}
.nav-link.is-active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: var(--brand-500); border-radius: 0 2px 2px 0;
}
.nav-icon { display: flex; align-items: center; }

.sidebar-foot {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 10px;
}

/* Chips */
.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
}
.chip-success { background: #dcfce7; color: #166534; }
.chip-info    { background: #dbeafe; color: #1e40af; }
.chip-warn    { background: #ffedd5; color: #9a3412; }
.chip-danger  { background: #fee2e2; color: #991b1b; }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-soft  { color: var(--text-soft); }
.hide-sm    { display: inline; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.card-pad { padding: 1.25rem; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 0.875rem; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  font: inherit;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-500);
  outline-offset: -1px;
  border-color: var(--brand-500);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600; font-size: 14px;
  cursor: pointer; border: 1px solid transparent;
  transition: opacity 0.15s, background 0.15s;
}
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-icon {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-muted); cursor: pointer;
}
.btn-icon:hover { background: var(--surface-2); color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Page titles */
h1.page-title { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.page-sub { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* Login page */
.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 1rem;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(15,23,42,0.04);
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 1.25rem; }
.alert {
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 1rem;
}
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* Installer */
.installer-shell {
  max-width: 640px; margin: 3rem auto; padding: 1rem;
}
.installer-shell .card { padding: 2rem; }
.installer-shell h1 { margin-top: 0; }
.step-title { font-size: 12px; text-transform: uppercase; color: var(--text-soft); letter-spacing: 0.05em; }

/* Header select */
.header-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 500;
  width: auto;
  cursor: pointer;
}

/* Grid table — Ciro / Envanter vb. */
.grid-table { font-size: 12px; }
.grid-table input[type="text"]:focus,
.grid-table input[type="number"]:focus {
  outline: 2px solid var(--brand-500);
  outline-offset: -2px;
  background: #fffbe6 !important;
}

/* Table */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; background: var(--surface-2); font-weight: 600; color: var(--text-muted); padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.table td { padding: 8px 12px; border-top: 1px solid var(--border); }
.table tbody tr:hover { background: var(--surface-2); }
