/* ===================== RESET & VARIABLES ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a56db;
  --primary-dark: #1e429f;
  --primary-light: #ebf2ff;
  --secondary: #0e9f6e;
  --danger: #e02424;
  --danger-light: #fde8e8;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --success: #0e9f6e;
  --success-light: #def7ec;
  --sidebar-w: 240px;
  --sidebar-bg: #111827;
  --sidebar-hover: #1f2937;
  --sidebar-active: #1d4ed8;
  --topbar-h: 60px;
  --body-bg: #f3f4f6;
  --card-bg: #ffffff;
  --text-1: #111827;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --radius: 10px;
  --radius-sm: 6px;
  --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);
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 14px; color: var(--text-1); background: var(--body-bg); line-height: 1.5; }

/* ===================== LAYOUT ===================== */
#app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  transition: transform .25s ease;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

/* ===================== SIDEBAR ===================== */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 8px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg { width: 20px; height: 20px; color: #fff; }

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
}

.logo-text span { color: var(--primary); }

.sidebar-nav { flex: 1; padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #9ca3af;
  text-decoration: none;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #f9fafb; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-version { font-size: 11px; color: #4b5563; }

/* ===================== TOPBAR ===================== */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px 0 20px;
  gap: 16px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-2);
  border-radius: var(--radius-sm);
}

.menu-toggle svg { width: 22px; height: 22px; }

.breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}

.breadcrumb-item { color: var(--text-2); text-decoration: none; }
.breadcrumb-item:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-1); font-weight: 600; }
.breadcrumb-sep { color: var(--text-3); }

.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-date { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* ===================== PAGE HEADER ===================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header-left h1 { font-size: 22px; font-weight: 700; color: var(--text-1); }
.page-header-left p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.page-header-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===================== STATS CARDS ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: #eff6ff; color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.teal { background: #f0fdfa; color: #0f766e; }

.stat-value { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }

/* ===================== CARD ===================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title { font-size: 15px; font-weight: 600; color: var(--text-1); }

.card-body { padding: 20px; }

/* ===================== TABLE ===================== */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }

tbody td {
  padding: 13px 16px;
  color: var(--text-1);
  vertical-align: middle;
}

.td-muted { color: var(--text-2); font-size: 12.5px; }
.td-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; color: var(--text-2); }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-aktif { background: var(--success-light); color: #065f46; }
.badge-pasif { background: #f3f4f6; color: #4b5563; }
.badge-suresi-dolmus { background: var(--danger-light); color: #991b1b; }
.badge-iptal { background: #f3f4f6; color: var(--text-2); }
.badge-yaklasan { background: var(--warning-light); color: #92400e; }
.badge-az { background: var(--success-light); color: #065f46; }
.badge-orta { background: var(--warning-light); color: #92400e; }
.badge-cok { background: var(--danger-light); color: #991b1b; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #0a7a56; }

.btn-outline {
  background: #fff;
  color: var(--text-1);
  border: 1px solid var(--border-2);
}
.btn-outline:hover { background: #f9fafb; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c81e1e; }

.btn-ghost { background: transparent; color: var(--text-2); padding: 6px 8px; }
.btn-ghost:hover { background: #f3f4f6; color: var(--text-1); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-icon { padding: 7px; }

/* ===================== SEARCH BAR ===================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-1);
  background: #fff;
  transition: border .15s;
}

.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-1);
  background: #fff;
  cursor: pointer;
}

.filter-select:focus { outline: none; border-color: var(--primary); }

/* ===================== FORM ===================== */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }

label { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
label span.req { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-1);
  background: #fff;
  transition: border .15s;
  font-family: inherit;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ===================== DETAIL LAYOUT ===================== */
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: 11px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-value { font-size: 13.5px; color: var(--text-1); font-weight: 500; }
.info-value.muted { color: var(--text-2); }

/* ===================== EMPTY STATE ===================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon { width: 56px; height: 56px; color: var(--text-3); }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-2); }
.empty-state p { font-size: 13px; color: var(--text-3); max-width: 300px; }

/* ===================== HIZMET TABLE ===================== */
.hizmet-table-wrap { }

.hizmet-row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .15s; }
tbody tr:hover .hizmet-row-actions { opacity: 1; }

.totals-row td { font-weight: 700; background: #f9fafb; font-size: 14px; }

/* ===================== DASHBOARD GRID ===================== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.timeline-dot.red { background: var(--danger); }
.timeline-dot.orange { background: var(--warning); }

.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-sub { font-size: 12px; color: var(--text-2); }

.days-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.days-badge.critical { background: var(--danger-light); color: #991b1b; }
.days-badge.warning { background: var(--warning-light); color: #92400e; }
.days-badge.ok { background: var(--success-light); color: #065f46; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay[style*="display:none"], .modal-overlay[style*="display: none"] {
  display: none !important;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .2s ease;
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1200px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px;
  border-radius: 6px;
  transition: all .15s;
}

.modal-close:hover { background: #f3f4f6; color: var(--text-1); }
.modal-close svg { width: 18px; height: 18px; display: block; }

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

/* ===================== TOAST ===================== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--text-1);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  min-width: 240px;
  max-width: 380px;
}

.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
.toast.warning { background: #92400e; }

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ===================== LOADING ===================== */
.loading-spinner { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== AVATAR ===================== */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

.name-cell { display: flex; align-items: center; gap: 10px; }

/* ===================== TABS ===================== */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.tab-btn:hover { color: var(--text-1); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.tab-badge.orange { background: var(--warning-light); color: var(--warning); }
.tab-badge.green  { background: var(--success-light); color: var(--success); }

/* ===================== PERSONEL BADGES ===================== */
.badge-ih  { background: #dbeafe; color: #1e40af; }
.badge-igu { background: #fef9c3; color: #854d0e; }
.badge-dsp { background: #dcfce7; color: #166534; }

/* ===================== FATURA BADGES ===================== */
.badge-taslak  { background: #f3f4f6; color: #374151; }
.badge-kesildi { background: var(--primary-light); color: var(--primary-dark); }
.badge-odendi  { background: var(--success-light); color: #065f46; }
.badge-iptal   { background: var(--danger-light);  color: #991b1b; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .page-content { padding: 20px 18px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .form-group.span-2, .form-group.span-3 { grid-column: span 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  #rotaBody > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal { max-height: 95vh; }
  .page-header { flex-direction: column; }
  .page-header-right { width: 100%; }
  .page-header-right .btn { flex: 1; justify-content: center; }
}

/* ===================== CARİ: MOBİL KART GÖRÜNÜMÜ ===================== */
.cari-cards-mobile { display: none; }

@media (max-width: 640px) {
  .cari-table-desktop { display: none; }
  .cari-cards-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
}

.cari-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  background: var(--bg-card, #fff);
  transition: box-shadow .15s ease;
}
.cari-card:active { box-shadow: inset 0 0 0 1px var(--primary); }

.cari-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cari-card-info { flex: 1; min-width: 0; }

.cari-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cari-card-sub {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cari-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.cari-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cari-card-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cari-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.cari-card-stat-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* ===================== İSG BELGE TAKİBİ ===================== */
.belge-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.belge-row:last-child { border-bottom: none; }

.belge-row-main { flex: 1; min-width: 0; }

.belge-row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}

.belge-row-aciklama {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
}

.belge-row-file {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-top: 5px;
  color: var(--text-2);
}

.belge-row-file a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.belge-row-file a:hover { text-decoration: underline; }

.belge-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ===================== UYUM RAPORU ===================== */
.uyum-bar {
  background: #f3f4f6;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  width: 100px;
}

.uyum-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* ===================== MAP ===================== */
.map-container {
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  z-index: 0;
}

.map-container-lg { height: 520px; }
.map-container-sm { height: 280px; }

.map-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.map-coords {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 6px;
  font-family: monospace;
}

.map-marker-popup h4 { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.map-marker-popup p  { font-size: 12px; color: #555; margin: 0; line-height: 1.5; }

/* ===================== CALENDAR DAY VIEW ===================== */
.cal-day-view {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cal-day-header-bar {
  background: #f9fafb;
  padding: 14px 20px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-day-header-bar .day-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}

.cal-day-header-bar .day-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.cal-day-body {
  display: grid;
  grid-template-columns: 64px 1fr;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

.cal-day-time-col {
  border-right: 1px solid var(--border);
}

.cal-day-time-slot {
  height: 72px;
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.cal-day-events-col {
  position: relative;
}

.cal-day-hour-row {
  height: 72px;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  cursor: pointer;
}

.cal-day-hour-row:hover { background: #f8faff; }

.cal-day-event {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: opacity .12s, box-shadow .12s;
}

.cal-day-event:hover {
  opacity: .92;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.cal-day-event .ev-time   { font-size: 11px; font-weight: 700; opacity: .85; }
.cal-day-event .ev-person { font-size: 13px; font-weight: 700; }
.cal-day-event .ev-loc    { font-size: 11.5px; opacity: .9; }
.cal-day-event .ev-note   { font-size: 11px; opacity: .75; margin-top: 2px; }
.cal-day-event .ev-badge  {
  display: inline-block;
  background: rgba(255,255,255,.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  margin-top: 3px;
}

.cal-day-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-3);
  text-align: center;
}

.cal-now-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: #e02424;
  z-index: 3;
  pointer-events: none;
}

.cal-now-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e02424;
}

/* ===================== CALENDAR ===================== */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cal-toolbar h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  min-width: 200px;
  text-align: center;
}

.cal-view-toggle {
  display: flex;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cal-view-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}

.cal-view-btn.active { background: var(--primary); color: #fff; }
.cal-view-btn:not(.active):hover { background: #f3f4f6; }

/* Month View */
.cal-month {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.cal-weekday {
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cal-weekday.weekend { color: #ef4444; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-cell {
  min-height: 110px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}

.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: #f8faff; }

.cal-cell.other-month { background: #fafafa; }
.cal-cell.other-month .cal-day-num { color: var(--text-3); }

.cal-cell.today { background: #eff6ff; }

.cal-day-num {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}

.cal-cell.today .cal-day-num {
  background: var(--primary);
  color: #fff;
}

.cal-cell.weekend-day .cal-day-num { color: #ef4444; }

.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  transition: opacity .12s;
  user-select: none;
}

.cal-event:hover { opacity: .88; }

.cal-event-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  flex-shrink: 0;
}

.cal-event-more {
  font-size: 11px;
  color: var(--text-3);
  padding: 1px 4px;
  cursor: pointer;
}

.cal-event-more:hover { color: var(--primary); }

.cal-add-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: .8;
  transition: opacity .15s;
}

.cal-cell:hover .cal-add-btn { display: flex; }
.cal-add-btn:hover { opacity: 1; }

/* Week View */
.cal-week {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cal-week-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: #f9fafb;
  border-bottom: 2px solid var(--border);
}

.cal-week-time-gutter { border-right: 1px solid var(--border); }

.cal-week-day-header {
  padding: 8px 6px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.cal-week-day-header .wday-name {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
}

.cal-week-day-header .wday-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.2;
}

.cal-week-day-header.today .wday-num {
  background: var(--primary);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-week-body {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  position: relative;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

.cal-time-col {
  border-right: 1px solid var(--border);
}

.cal-time-slot {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding: 3px 6px;
  font-size: 11px;
  color: var(--text-3);
}

.cal-day-col {
  border-right: 1px solid var(--border);
  position: relative;
}

.cal-hour-line {
  height: 56px;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
}

.cal-hour-line:nth-child(2n) { background: rgba(0,0,0,.01); }

.cal-week-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: opacity .12s;
  min-height: 20px;
}

.cal-week-event:hover { opacity: .85; }

/* Personel legend */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s;
}

.cal-legend-item.muted { opacity: .4; }

.cal-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===================== MISC ===================== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

.currency { font-variant-numeric: tabular-nums; font-weight: 600; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.link-btn:hover { color: var(--primary-dark); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 49;
}
.sidebar-overlay.open { display: block; }

/* ===================== LOGIN ===================== */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1f35 0%, #1e429f 60%, #1a56db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.login-logo svg {
  width: 36px;
  height: 36px;
  stroke: var(--primary);
}
.login-logo span {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.5px;
}
.login-logo strong { color: var(--primary); font-weight: 700; }

.login-subtitle {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
}

.btn-full { width: 100%; justify-content: center; }

.login-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 24px;
}

/* ===================== SIDEBAR USER / LOGOUT ===================== */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #f9fafb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: #9ca3af;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: #9ca3af;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* ===================== ADMIN NAV ===================== */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #6b7280;
  text-transform: uppercase;
  padding: 16px 16px 6px;
}

/* ===================== FILTER BAR ===================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar .form-input { max-width: 280px; }
.filter-bar .filter-select { max-width: 200px; }

/* ===================== KANBAN (TEKLİFLER) ===================== */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}
.kanban-column {
  flex: 0 0 270px;
  background: var(--body-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}
.kanban-column.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kanban-column-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--body-bg);
  border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-column-title { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.kanban-column-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: .4; }
.kanban-card-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.kanban-card-sub { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.kanban-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-2); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.kanban-empty { padding: 20px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; }


.sidebar-overlay.open { display: block; }
