/* MRG Alüminyum ERP — Ana Stil Dosyası */

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

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

:root {
  --blue-900: #1E3A8A;
  --blue-800: #1e40af;
  --blue-600: #2563eb;
  --blue-50:  #eff6ff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --bg:        #F5F7FA;
  --white:     #ffffff;
  --emerald:   #10b981;
  --amber:     #f59e0b;
  --red:       #ef4444;
}

html, body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--slate-900);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── Page wrapper ── */
.page { min-height: 100vh; background: linear-gradient(to bottom, #F5F7FA, #fff, #F5F7FA); }

/* ── Max width centering ── */
.container { max-width: 440px; margin: 0 auto; padding: 0 1rem 6rem; }

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
}
.header-inner { max-width: 440px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }

/* ── Sidebar ── */
#sidebar { position: fixed; inset: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.25s ease; }
#sidebar.open { transform: translateX(0); }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  padding: 14px;
}
.card-gradient {
  background: linear-gradient(135deg, #1E3A8A, #1e40af);
  border: none;
  border-radius: 16px;
  padding: 20px;
  color: white;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, #1E3A8A, #1e40af); color: white; }
.btn-secondary { background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--slate-200); }
.btn-danger { background: #ef4444; color: white; }
.btn-ghost { background: transparent; color: var(--slate-700); }
.btn-emerald { background: #10b981; color: white; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-full { width: 100%; }
.btn-icon { width: 44px; padding: 0; }

/* ── Inputs ── */
.input {
  width: 100%; height: 44px; padding: 0 12px;
  background: white; border: 1px solid var(--slate-200);
  border-radius: 10px; font-size: 14px; color: var(--slate-900);
  outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--blue-600); }
.textarea { min-height: 80px; height: auto; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 32px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; font-weight: 500; color: var(--slate-500); margin-bottom: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── KPI tiles ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.kpi {
  background: white; border: 1px solid var(--slate-200); border-radius: 14px;
  padding: 12px 14px;
}
.kpi-label { font-size: 10px; color: var(--slate-500); font-weight: 500; }
.kpi-value { font-size: 18px; font-weight: 800; color: var(--slate-900); margin-top: 2px; line-height: 1.2; }
.kpi-sub { font-size: 10px; color: var(--slate-400); margin-top: 2px; }
.kpi-blue .kpi-value { color: var(--blue-900); }
.kpi-emerald .kpi-value { color: #059669; }
.kpi-amber .kpi-value { color: #d97706; }
.kpi-red .kpi-value { color: #dc2626; }

/* ── Search bar ── */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-wrap { position: relative; flex: 1; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--slate-400); pointer-events: none; }
.search-wrap .input { padding-left: 36px; }

/* ── List items ── */
.list-item {
  background: white; border: 1px solid var(--slate-200); border-radius: 14px;
  padding: 12px; margin-bottom: 8px;
}
.list-item-row { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #1E3A8A, #1e40af);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
}
.avatar-sq { border-radius: 12px; }
.item-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--slate-200); }
.item-actions .btn { flex: 1; height: 32px; font-size: 11px; border-radius: 8px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; background: var(--slate-100); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tab { flex: 1; height: 36px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--slate-500); display: flex; align-items: center; justify-content: center; transition: all .15s; }
.tab.active { background: white; color: var(--blue-900); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ── Badge / Status ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.badge-blue { background: var(--blue-50); color: var(--blue-900); }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-slate { background: var(--slate-100); color: var(--slate-600); }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
#notif-modal.hidden { display: none !important; }
.modal-box {
  background: white; border-radius: 20px; width: 100%; max-width: 420px;
  padding: 20px; box-shadow: 0 25px 50px rgba(0,0,0,.2);
  max-height: 85vh; overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 8px; margin-top: 16px; }

/* ── Divider ── */
.divider { height: 1px; background: var(--slate-200); margin: 12px 0; }

/* ── Section header ── */
.section-hd { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 8px; padding: 0 2px; }
.section-hd-title { font-size: 13px; font-weight: 700; color: var(--slate-900); }
.section-hd-link { font-size: 11px; color: var(--blue-900); font-weight: 600; }

/* ── Pill filter ── */
.pill-filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; -ms-overflow-style: none; scrollbar-width: none; }
.pill-filter::-webkit-scrollbar { display: none; }
.pill { padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 600; background: white; color: var(--slate-500); border: 1px solid var(--slate-200); white-space: nowrap; }
.pill.active { background: var(--blue-900); color: white; border-color: var(--blue-900); }

/* ── Empty state ── */
.empty { text-align: center; padding: 40px 20px; color: var(--slate-500); font-size: 13px; }

/* ── Detail row ── */
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--slate-200); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-key { color: var(--slate-500); }
.detail-val { font-weight: 600; color: var(--slate-900); }

/* ── Danger text ── */
.text-red { color: #dc2626; }
.text-emerald { color: #059669; }
.text-blue { color: var(--blue-900); }
.text-amber { color: #d97706; }
.text-muted { color: var(--slate-400); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* ── Spacing ── */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex { display: flex; } .flex-1 { flex: 1; } .items-center { align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Warning card ── */
.warn-card { background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.warn-icon { width: 40px; height: 40px; border-radius: 10px; background: #fef3c7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.danger-card { background: #fff1f2; border: 1px solid #fecdd3; border-radius: 14px; padding: 12px; }

/* ═══════════════════════════════════════════════
   SHELL COMPONENTS
   ═══════════════════════════════════════════════ */

/* Header */
.shell-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; flex-shrink: 0;
  color: var(--slate-700); transition: background .15s;
}
.shell-icon-btn:hover { background: var(--slate-100); }
.header-title { flex: 1; font-weight: 700; font-size: 15px; color: var(--slate-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sidebar container */
#sidebar {
  position: fixed; inset: 0; z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}
#sidebar.open { transform: translateX(0); pointer-events: auto; }

/* Sidebar backdrop */
.sidebar-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.42);
}

/* Sidebar panel */
.sidebar-panel {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: min(85vw, 280px);
  background: white;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
  overflow: hidden;
}

/* Sidebar head */
.sidebar-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--slate-100), var(--slate-300));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-name { font-size: 14px; font-weight: 900; color: var(--slate-900); }
.sidebar-brand-sub  { font-size: 9px; color: var(--slate-500); letter-spacing: .1em; text-transform: uppercase; }

/* Sidebar nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-cat { margin-bottom: 4px; }
.sidebar-cat-label { font-size: 10px; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .08em; padding: 6px 12px 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--slate-700);
  text-decoration: none; transition: background .12s;
}
.sidebar-link:hover { background: var(--slate-100); }
.sidebar-link.active { background: var(--blue-50); color: var(--blue-900); font-weight: 600; }
.sidebar-link-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--blue-50); color: var(--blue-900);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.sidebar-link.active .sidebar-link-icon { background: var(--blue-900); color: white; }

/* Sidebar footer */
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--slate-200); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  color: white; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--slate-900); }
.sidebar-user-role { font-size: 11px; color: var(--slate-500); }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-info .sidebar-user-name,
.sidebar-user-info .sidebar-user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--slate-200); z-index: 40;
}
.bottom-nav-inner { display: flex; max-width: 520px; margin: 0 auto; }
.bottom-nav-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px; gap: 2px;
  color: var(--slate-500); text-decoration: none;
  font-size: 10px; font-weight: 500;
}
.bottom-nav-tab.active { color: var(--blue-900); }
.bottom-nav-fab { position: relative; }
.bottom-nav-fab-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-600));
  display: flex; align-items: center; justify-content: center;
  color: white; box-shadow: 0 4px 14px rgba(30,58,138,.45);
  margin-top: -16px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET (≥ 768px)
   ═══════════════════════════════════════════════ */
@media (min-width: 768px) {
  .container  { max-width: 720px; padding: 0 24px 80px; }
  .header-inner { max-width: 720px; padding: 0 20px; }

  /* Wider grids */
  .kpi-grid    { grid-template-columns: repeat(4, 1fr); }
  .field-row   { grid-template-columns: 1fr 1fr 1fr; }

  /* Sidebar slightly wider */
  .sidebar-panel { width: min(75vw, 320px); }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — DESKTOP (≥ 1024px)
   ═══════════════════════════════════════════════ */
@media (min-width: 1024px) {
  /* Sidebar always visible */
  #sidebar {
    transform: none !important;
    pointer-events: auto !important;
    z-index: 30;
    inset: 0 auto 0 0;
    width: 260px;
  }
  .sidebar-backdrop { display: none !important; }
  .sidebar-panel {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 260px !important;
    box-shadow: none;
    border-right: 1px solid var(--slate-200);
  }
  .sidebar-close-btn { display: none !important; }

  /* Content area shifts right */
  .header    { margin-left: 260px; }
  .header-inner { max-width: none; padding: 0 32px; margin: 0; }

  .container {
    margin-left: 260px;
    max-width: none;
    padding: 24px 40px 48px;
  }

  /* Hide mobile bottom nav */
  .bottom-nav { display: none !important; }

  /* Hamburger menu button hidden on desktop (sidebar always visible) */
  .sidebar-toggle-btn { display: none !important; }

  /* Wider grids on desktop */
  .kpi-grid    { grid-template-columns: repeat(4, 1fr); }
  .field-row   { grid-template-columns: 1fr 1fr 1fr; }
  .modal-box   { max-width: 560px; align-self: center; border-radius: 16px; }
  .modal-overlay { align-items: center; }
}
