/* ========= TEMEL & RESET ========= */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: #2c3e50;
  background: #f5f7fb;
  line-height: 1.35;
}
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}

/* ========= GİRİŞ SAYFASI ========= */
body.auth {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-container {
  width: min(450px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.2);
}
.login-container h2 {
  text-align: center;
  margin: 0 0 16px;
  font-size: clamp(20px, 2.2vw, 28px);
}
.form-group { margin: 14px 0; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #34495e;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e9edf3;
  border-radius: 10px;
  background: #fafbff;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: #4c8bf5;
  box-shadow: 0 0 0 4px rgba(76,139,245,.12);
  background: #fff;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #4c8bf5 0%, #2d6cdf 100%);
  color: #fff;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(76,139,245,.28);
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.error, .warning, .success {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}
.error   { background:#fee;      color:#c53030; border:1px solid #feb2b2; }
.warning { background:#fffbeb;   color:#744210; border:1px solid #faf089; }
.success { background:#f0fff4;   color:#22543d; border:1px solid #9ae6b4; }

/* ========= LAYOUT: DASHBOARD ========= */
.dashboard-container {
  display: grid;
  grid-template-columns: 280px minmax(0,1fr);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
  box-shadow: 2px 0 12px rgba(0,0,0,.12);
  transition: transform .25s ease, width .25s ease;
  z-index: 20;
  width: 280px;
}
.sidebar-header {
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.1);
}
.sidebar-header h2 {
  margin: 0;
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 700;
}
.sidebar-menu { list-style: none; margin: 0; padding: 14px 0; }
.sidebar-menu li {
  margin: 5px 0;
  border-left: 4px solid transparent;
  transition: background .2s ease, border-left-color .2s ease;
}
.sidebar-menu li:hover { background: rgba(52,152,219,.12); border-left-color:#3498db; }
.sidebar-menu li.active { background: rgba(52,152,219,.22); border-left-color:#3498db; }
.sidebar-menu a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: #ecf0f1;
  text-decoration: none;
  font-weight: 600;
}
.sidebar-menu .icon { text-align: center; }

/* Sidebar collapsed (desktop) */
.sidebar.collapsed {
  width: %100px !important;
}
.sidebar.collapsed .sidebar-header h2 { display: none; }
.sidebar.collapsed .sidebar-menu a { grid-template-columns: 1fr; }
.sidebar.collapsed .sidebar-menu a::after { content: attr(data-title); display:none; }

/* Header */
.main-content {
  display: grid;
  grid-template-rows: 70px 1fr;
  min-width: 0;
  background: #f5f7fb;
}
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #eef1f6;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.header-left { display: inline-flex; align-items: center; gap: 10px; }
/* Desktop dar görünüm */
.sidebar.is-collapsed { width: 74px; }
.sidebar.is-collapsed .sidebar-header h2 { display:none; }
.sidebar.is-collapsed .sidebar-menu a { grid-template-columns: 1fr; justify-items: center; }

/* Mobil off-canvas */
@media (max-width: 768px) {
  .dashboard-container { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar.is-open { transform: translateX(0); }
}

/* Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 15;
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Mobil menü açıkken scroll kilidi */
body.noscroll { overflow: hidden; }
#sidebarToggle {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .2s ease;
}
#sidebarToggle:hover { background: #f1f3f8; }
.header-left h3 { margin: 0; font-size: clamp(16px,2.2vw,20px); font-weight: 800; }
.header-right { display: inline-flex; align-items: center; gap: 14px; }
.search-box { position: relative; }
.search-box input {
  width: min(260px, 42vw);
  padding: 10px 14px 10px 38px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 14px;
}
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  opacity: .7;
}
.username { font-weight: 700; }
.notifications { cursor: pointer; padding: 6px; border-radius: 50%; }
.notifications:hover { background:#f1f3f8; }

/* Content */
.content {
  padding: clamp(14px, 3vw, 28px);
  overflow: auto;
}

/* ========= KARTLAR (tam responsive) ========= */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.stat-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #eef1f6;
  box-shadow: 0 5px 18px rgba(0,0,0,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.10); }
.stat-icon {
  display: grid; place-items: center;
  font-size: 28px;
  width: 72px; height: 72px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.stat-info h4 { margin: 0 0 4px; color: #6b7280; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .2px; }
.stat-number { font-size: clamp(18px, 3.2vw, 26px); font-weight: 800; color: #111827; }

/* ========= FORM BLOKLARI ========= */
.form-section {
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #eef1f6;
  box-shadow: 0 5px 18px rgba(0,0,0,.06);
  margin-bottom: 18px;
}
.form-section h4 { margin: 0 0 12px; font-size: clamp(16px, 2.4vw, 18px); }
.turkcell-form, .western-union-form { display: grid; gap: 14px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.form-group textarea { min-height: 90px; resize: vertical; }

/* ========= TABLOLAR (mobil kaydırmalı) ========= */
.recent-transactions {
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #eef1f6;
  box-shadow: 0 5px 18px rgba(0,0,0,.06);
  margin-top: 18px;
}
.recent-transactions h4 { margin: 0 0 12px; }
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px; /* mobilde yatay kaydırma için */
}
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
  white-space: nowrap;
}
th {
  background: #f8fafc;
  font-weight: 800;
  color: #334155;
}
tr:hover { background: #f9fbff; }
.delete-btn {
  color: #dc3545; text-decoration: none; padding: 6px 8px; border-radius: 6px;
}
.delete-btn:hover { background: #fde2e2; }

/* ========= DÖVİZ BÖLÜMÜ ========= */
.exchange-rates { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.exchange-rate {
  border: 1px solid #eef1f6; background:#f8fafc;
  border-radius: 10px; padding: 12px; text-align:center; min-width: 160px;
}
.rate-value { font-weight: 800; font-size: 18px; color: #16a34a; }

/* ========= SAYFALAMA ========= */
.pagination {
  margin-top: 14px; display: flex; justify-content: center; gap: 10px; align-items: center;
}
.pagination a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none; color: #fff; background: #4c8bf5;
}
.pagination a:hover { background:#2d6cdf; }
.pagination span { color:#64748b; font-weight:700; }

/* ========= RESPONSIVE (Tablet & Telefon) ========= */

/* Tablet ve küçük laptop (<= 1024px) */
@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 240px minmax(0,1fr);
  }
  .search-box input { width: min(220px, 36vw); }
}

/* Telefon ve küçük tablet (<= 768px) */
@media (max-width: 768px) {
  .dashboard-container {
    grid-template-columns: 1fr; /* sidebar off-canvas */
  }
  /* Off-canvas sidebar */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
  }
  /* Toggle ile AÇ: .collapsed sınıfı mobilde "açık" anlamına gelsin */
  .sidebar.collapsed { transform: translateX(0); }

  /* Header sıkılsın */
  .header { grid-template-columns: 1fr auto; padding: 0 12px; }
  .search-box input { width: 46vw; }
  .username { display: none; } /* alan kazan */
  .content { padding: 14px; }

  /* Formlar tek sütun */
  .form-row { grid-template-columns: 1fr; }

  /* Kartlar zaten auto-fit, boşlukları sıkalım */
  .stats-cards { gap: 12px; }
  .stat-card { grid-template-columns: 60px 1fr; padding: 12px; }
  .stat-icon { width: 60px; height: 60px; font-size: 24px; }
}

/* Mini telefonlar (<= 380px) */
@media (max-width: 380px) {
  .search-box { display: none; }
}
