/* ============================================================
   Eybey Medya CRM — Ana Stil Dosyası
   ============================================================ */

:root {
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-light:  #eff6ff;
  --sidebar-bg:     #0f172a;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  #1e293b;
  --sidebar-active: #2563eb;
  --sidebar-width:  260px;
  --topbar-h:       64px;
  --body-bg:        #f8fafc;
  --card-bg:        #ffffff;
  --border:         #e2e8f0;
  --text-main:      #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --info:           #0284c7;
  --info-light:     #e0f2fe;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition:     .18s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-icon svg { width: 20px; height: 20px; color: #fff; }

.sidebar-logo-text {
  display: flex; flex-direction: column;
}

.sidebar-logo-text strong {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -.2px;
  line-height: 1.2;
}

.sidebar-logo-text small {
  font-size: 11px;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--sidebar-hover); }

.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: background var(--transition);
}

.topbar-toggle:hover { background: var(--body-bg); }
.topbar-toggle svg { width: 22px; height: 22px; display: block; }

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-date {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-date svg { width: 14px; height: 14px; }

/* ── Page content ────────────────────────────────────────── */
.page-content {
  padding: 28px 28px 40px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.card-title svg { width: 18px; height: 18px; color: var(--primary); }
.card-body { padding: 20px; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon svg { width: 22px; height: 22px; }

.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -.5px;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* ── Stat color variants ─────────────────────────────────── */
.stat-green  .stat-card-accent { background: var(--success); }
.stat-green  .stat-card-icon   { background: var(--success-light); color: var(--success); }
.stat-red    .stat-card-accent { background: var(--danger); }
.stat-red    .stat-card-icon   { background: var(--danger-light); color: var(--danger); }
.stat-blue   .stat-card-accent { background: var(--primary); }
.stat-blue   .stat-card-icon   { background: var(--primary-light); color: var(--primary); }
.stat-amber  .stat-card-accent { background: var(--warning); }
.stat-amber  .stat-card-icon   { background: var(--warning-light); color: var(--warning); }
.stat-sky    .stat-card-accent { background: var(--info); }
.stat-sky    .stat-card-icon   { background: var(--info-light); color: var(--info); }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-paid    { background: var(--success-light); color: var(--success); }
.badge-unpaid  { background: var(--danger-light);  color: var(--danger); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-issued  { background: var(--info-light);    color: var(--info); }
.badge-draft   { background: #f1f5f9;              color: #64748b; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
}

.crm-table thead th {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.crm-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.crm-table tbody tr:last-child { border-bottom: none; }
.crm-table tbody tr:hover { background: #f8fafc; }

.crm-table td {
  padding: 13px 16px;
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--text-main);
}

.crm-table .td-muted { color: var(--text-muted); font-size: 12.5px; }
.crm-table .td-bold  { font-weight: 700; }
.crm-table .td-mono  { font-family: 'Courier New', monospace; font-size: 12.5px; }

/* ── Customer name cell ──────────────────────────────────── */
.customer-cell { display: flex; align-items: center; gap: 10px; }
.customer-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.customer-name { font-weight: 600; font-size: 13.5px; }
.customer-company { font-size: 12px; color: var(--text-muted); }

/* ── Action buttons ──────────────────────────────────────── */
.action-btns { display: flex; gap: 6px; align-items: center; }

.btn-icon {
  width: 30px; height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.btn-icon svg { width: 15px; height: 15px; }

.btn-icon-blue  { background: var(--primary-light); color: var(--primary); }
.btn-icon-blue:hover  { background: var(--primary); color: #fff; }
.btn-icon-green { background: var(--success-light); color: var(--success); }
.btn-icon-green:hover { background: var(--success); color: #fff; }
.btn-icon-red   { background: var(--danger-light); color: var(--danger); }
.btn-icon-red:hover   { background: var(--danger); color: #fff; }
.btn-icon-amber { background: var(--warning-light); color: var(--warning); }
.btn-icon-amber:hover { background: var(--warning); color: #fff; }
.btn-icon-gray  { background: #f1f5f9; color: var(--text-muted); }
.btn-icon-gray:hover  { background: #e2e8f0; color: var(--text-main); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37,99,235,.3);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #15803d; color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--body-bg); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control, .form-select {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .input-group-text {
  background: #f1f5f9;
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex; align-items: center;
  white-space: nowrap;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-left { display: flex; flex-direction: column; gap: 2px; }

.page-header-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -.4px;
}

.page-header-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Filter / Search bar ─────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-input-wrap svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-light);
  pointer-events: none;
}

.search-input-wrap .form-control {
  padding-left: 34px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .18s ease;
}

.modal-box.modal-lg { max-width: 780px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg { width: 18px; height: 18px; color: var(--primary); }

.modal-close {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 30px; height: 30px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition);
}

.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 22px; }

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   INVOICE ITEMS TABLE (in modal)
   ============================================================ */
.items-table-wrap { overflow-x: auto; }

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.items-table th {
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.items-table tbody tr:last-child td { border-bottom: none; }

.items-table .form-control,
.items-table .form-select {
  padding: 6px 9px;
  font-size: 13px;
  min-width: 80px;
}

.remove-row-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  padding: 4px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}

.remove-row-btn:hover { background: var(--danger-light); }
.remove-row-btn svg { width: 15px; height: 15px; }

/* ── Totals box ──────────────────────────────────────────── */
.totals-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 12px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.totals-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fde68a;
}

.alert-info {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid #bae6fd;
}

.alert .btn-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: .6;
  padding: 0 4px;
  color: inherit;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 60px; height: 60px;
  background: var(--primary-light);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}

.empty-state-icon svg { width: 30px; height: 30px; color: var(--primary); }

.empty-state h5 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}

.empty-state p {
  font-size: 13.5px;
  margin: 0 0 20px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0,0,0,.3);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 36px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  text-align: center;
}

.login-logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(37,99,235,.4);
}

.login-logo-icon svg { width: 32px; height: 32px; color: #fff; }

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px;
  letter-spacing: -.4px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.login-form .form-label {
  font-size: 13px;
  font-weight: 600;
}

.login-form .form-control {
  padding: 11px 14px;
  font-size: 14px;
}

.login-form .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  justify-content: center;
}

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-light);
}

/* ============================================================
   DASHBOARD RECENT TABLE
   ============================================================ */
.recent-section { margin-top: 28px; }

/* ============================================================
   REPORT CARDS
   ============================================================ */
.report-period-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.report-period-btn:hover, .report-period-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   MOBILE OVERLAY
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open { display: block; }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .topbar-toggle { display: flex; }

  .page-content { padding: 20px 16px 32px; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .stat-card-value { font-size: 22px; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-input-wrap { max-width: 100%; }

  .crm-table thead { display: none; }
  .crm-table tbody tr {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    position: relative;
  }
  .crm-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 4px;
    border-bottom: none;
  }
  .crm-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .05em;
    flex-shrink: 0;
    margin-right: 10px;
  }
}

@media (max-width: 575.98px) {
  .login-card { padding: 28px 20px; }
  .page-content { padding: 16px 12px 28px; }
}

/* ============================================================
   PRINT INVOICE
   ============================================================ */
@media print {
  .sidebar, .topbar, .page-header .btn, .action-btns, .filter-bar { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 0; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.fw-bold   { font-weight: 700 !important; }
.fw-medium { font-weight: 500 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.gap-2 { gap: 8px !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-wrap { flex-wrap: wrap !important; }

/* ============================================================
   EK STİLLER — Yeni özellikler
   ============================================================ */

/* ── Yeşil buton ──────────────────────────────────────── */
.btn-success {
  background: var(--success);
  color: #fff;
  border: 1.5px solid var(--success);
}
.btn-success:hover { background: #15803d; border-color: #15803d; }

/* ── Modal boyutları ──────────────────────────────────── */
.modal-lg  { max-width: 720px !important; }
.modal-xl  { max-width: 960px !important; }

/* ── Tablo yardımcıları ───────────────────────────────── */
.td-muted  { color: var(--text-muted) !important; font-size: 13px; }
.td-bold   { font-weight: 600 !important; }

/* ── Yeşil aksiyon butonu ─────────────────────────────── */
.action-btn-success {
  color: var(--success) !important;
  background: var(--success-light) !important;
}
.action-btn-success:hover { background: #bbf7d0 !important; }

/* ── Sidebar nav badge ────────────────────────────────── */
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
  min-width: 20px;
  text-align: center;
}

/* ── Btn küçük ────────────────────────────────────────── */
.btn-sm {
  padding: 5px 12px !important;
  font-size: 12.5px !important;
}

/* ── Hızlı ay buton grubu hover ──────────────────────── */
.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* ── Gecikmiş satır ───────────────────────────────────── */
.row-overdue,
.row-overdue td {
  background: #fff7f7 !important;
  border-bottom-color: #fecaca !important;
}
.row-overdue:hover,
.row-overdue:hover td { background: #ffecec !important; }
.td-danger { color: var(--danger) !important; font-weight: 600; }

/* ── Sayfa header filtre kartı ───────────────────────── */
.card.mb-3 { margin-bottom: 16px; }

/* ── action-btn ──────────────────────────────────────── */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  border: none;
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.action-btn svg, .action-btn i { width: 15px; height: 15px; }
.action-btn:hover { background: var(--primary-light); color: var(--primary); }

.action-btn-danger { background: var(--danger-light) !important; color: var(--danger) !important; }
.action-btn-danger:hover { background: var(--danger) !important; color: #fff !important; }

/* ── td-actions ──────────────────────────────────────── */
.td-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

/* ── btn-secondary ───────────────────────────────────── */
.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #e2e8f0; border-color: #cbd5e1; color: var(--text-main); }

/* ── WhatsApp link ───────────────────────────────────── */
.wa-link {
  color: #16a34a;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}
.wa-link::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316a34a'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  flex-shrink: 0;
}
.wa-link:hover { color: #15803d; }

/* ── Hizmet filtre pilleri ────────────────────────────── */
.service-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.service-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.service-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.spill-count {
  background: rgba(255,255,255,.25);
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.service-pill.active .spill-count { background: rgba(255,255,255,.3); }
.service-pill:not(.active) .spill-count { background: var(--border); color: var(--text-muted); }
