/* ============================================================
   VYS — Admin Panel CSS
   Font: Inter (Google Fonts)
   Ana renk: #6366f1 (indigo)
   ============================================================ */

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

:root {
  --primary:        #6366f1;
  --primary-hover:  #4f46e5;
  --primary-light:  rgba(99,102,241,.12);
  --danger:         #ef4444;
  --success:        #22c55e;
  --warning:        #f59e0b;
  --info:           #3b82f6;

  /* Sidebar */
  --sidebar-bg:     #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  #1e293b;
  --sidebar-active: var(--primary);
  --sidebar-w:      260px;
  --sidebar-w-col:  64px;

  /* Content */
  --body-bg:        #f1f5f9;
  --card-bg:        #ffffff;
  --card-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --card-radius:    12px;
  --border-color:   #e2e8f0;

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;

  /* Navbar */
  --navbar-h:       60px;

  --transition: .2s ease;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

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

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

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-col); }

.sidebar-logo {
  padding: 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--navbar-h);
}
.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: transparent;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px; color: #fff; font-weight: 700;
}
.sidebar-logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; overflow: hidden; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #ffffff; border-radius: 4px; }

.nav-section-title {
  color: #475569;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 16px 16px 6px;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #cbd5e1; }
.nav-item.active { background: var(--primary-light); color: var(--primary); border-left: 3px solid var(--primary); }
.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}
.nav-item .nav-label { transition: opacity var(--transition); }
.sidebar.collapsed .nav-item .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }

/* Tooltip on collapsed */
.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-w-col) + 8px);
  background: #1e293b;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 100;
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  color: var(--sidebar-text);
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { transition: opacity var(--transition); overflow: hidden; }
.sidebar-user-name { font-size: .85rem; font-weight: 500; color: #cbd5e1; white-space: nowrap; }
.sidebar-user-role { font-size: .7rem; color: #64748b; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

/* ── MAIN WRAPPER ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-w-col); }

/* ── NAVBAR ── */
.top-navbar {
  height: var(--navbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 900;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.navbar-left { display: flex; align-items: center; gap: 12px; }
.navbar-toggle {
  width: 36px; height: 36px;
  background: none; border: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: background var(--transition);
}
.navbar-toggle:hover { background: var(--body-bg); }
.page-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

.navbar-right { display: flex; align-items: center; gap: 8px; }
.navbar-btn {
  width: 36px; height: 36px;
  background: none; border: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 1.1rem;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.navbar-btn:hover { background: var(--body-bg); color: var(--text-primary); }
.badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border: 2px solid var(--card-bg);
  border-radius: 50%;
}

/* ── CONTENT ── */
.content-area {
  flex: 1;
  padding: 24px;
}

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 24px; }

/* ── STAT CARDS (Dashboard) ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.indigo  { background: rgba(99,102,241,.12);  color: #6366f1; }
.stat-icon.green   { background: rgba(34,197,94,.12);   color: #22c55e; }
.stat-icon.amber   { background: rgba(245,158,11,.12);  color: #f59e0b; }
.stat-icon.blue    { background: rgba(59,130,246,.12);  color: #3b82f6; }
.stat-icon.red     { background: rgba(239,68,68,.12);   color: #ef4444; }
.stat-icon.purple  { background: rgba(168,85,247,.12);  color: #a855f7; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px; border: none;
  font-size: .875rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), transform .1s ease, box-shadow var(--transition);
}
.btn:active { transform: scale(.98); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-hover); }

/* Upload butonları deaktifken kırmızı olsun */
button:disabled:has(.bi-upload),
.btn:disabled:has(.bi-upload),
#importBtn:disabled {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
}

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover  { background: #16a34a; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover  { background: #d97706; }
.btn-secondary { background: var(--body-bg); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-outline-primary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 6px; }
.btn-icon { padding: 7px; }

/* Özel İçe Aktar Butonu */
.btn-import-xls {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff !important;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-import-xls::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: all 0.6s ease;
}
.btn-import-xls:hover::before {
  left: 100%;
}
.btn-import-xls:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.btn-import-xls i {
  font-size: 1.15rem;
}


/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .8rem; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: .75rem; color: var(--danger); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-span-2 { grid-column: span 2; }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table.vys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.vys-table thead th {
  background: var(--body-bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.vys-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.vys-table tbody tr:last-child td { border-bottom: none; }
.vys-table tbody tr:hover { background: #f8fafc; }
/* Satır renkleri (alarm / manuel) */
.vys-table tbody tr.row-primary  { background: rgba(59,130,246,.06); }
.vys-table tbody tr.row-info     { background: rgba(6,182,212,.06); }
.vys-table tbody tr.row-success  { background: rgba(34,197,94,.06); }
.vys-table tbody tr.row-warning  { background: rgba(245,158,11,.08); }
.vys-table tbody tr.row-danger   { background: rgba(239,68,68,.06); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .7rem; font-weight: 600;
}
.badge-primary { background: rgba(99,102,241,.12);  color: #6366f1; }
.badge-success { background: rgba(34,197,94,.12);   color: #16a34a; }
.badge-danger  { background: rgba(239,68,68,.12);   color: #dc2626; }
.badge-warning { background: rgba(245,158,11,.12);  color: #b45309; }
.badge-info    { background: rgba(59,130,246,.12);  color: #1d4ed8; }
.badge-gray    { background: rgba(100,116,139,.12); color: #475569; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  width: 90%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px;
  background: none; border: none;
  border-radius: 6px; font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--body-bg); }
.modal-body { padding: 20px 24px; }

/* ── TOAST ── */
#toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 280px; max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  animation: slideIn .25s ease;
}
.toast.removing { animation: slideOut .25s ease forwards; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0);   opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-danger  .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }
.toast-msg { font-size: .875rem; color: var(--text-primary); line-height: 1.4; }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .875rem;
  border-left: 4px solid;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: rgba(34,197,94,.08);  border-color: var(--success); color: #15803d; }
.alert-danger  { background: rgba(239,68,68,.08);  border-color: var(--danger);  color: #b91c1c; }
.alert-warning { background: rgba(245,158,11,.08); border-color: var(--warning); color: #92400e; }
.alert-info    { background: rgba(59,130,246,.08); border-color: var(--info);    color: #1e40af; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .9rem; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-bg);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,.2) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(168,85,247,.1) 0%, transparent 50%);
}
.login-box {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo-icon {
  width: 72px; height: 72px;
  background: transparent;
  border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; font-weight: 700;
  margin-bottom: 12px;
}
.login-title { color: #fff; font-size: 1.4rem; font-weight: 700; }
.login-subtitle { color: #64748b; font-size: .85rem; margin-top: 4px; }
.login-box .form-label { color: #94a3b8; }
.login-box .form-control {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: #fff;
}
.login-box .form-control:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,.08);
}
.login-box .form-control::placeholder { color: #475569; }
.login-submit {
  width: 100%; padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; margin-top: 8px;
  transition: background var(--transition), transform .1s;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
}
.login-submit:hover { background: var(--primary-hover); }
.login-submit:active { transform: scale(.98); }
.login-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  padding: 10px 14px; border-radius: 8px;
  font-size: .85rem; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── UTILITIES ── */
.d-flex      { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); font-size: .8rem; }
.text-sm    { font-size: .8rem; }
.fw-600     { font-weight: 600; }
.w-100      { width: 100%; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); width: var(--sidebar-w) !important; }
  
  /* Mobilken collapsed class'ını tamamen yoksay */
  .sidebar.collapsed { width: var(--sidebar-w) !important; }
  .sidebar.collapsed .sidebar-logo-text,
  .sidebar.collapsed .nav-item .nav-label,
  .sidebar.collapsed .sidebar-user-info { opacity: 1; width: auto; overflow: visible; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 16px; }
  .sidebar.collapsed .nav-item::after { display: none; }
  
  .main-wrapper { margin-left: 0 !important; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
