/* MARS GAYRİMENKUL CRM - Özel Tasarım Stilleri (Mars Kimliği: Siyah, Kırmızı, Beyaz) */
:root {
  --mars-red: #C41230;
  --mars-red-hover: #A50E28;
  --mars-red-light: #FDE8EC;
  --mars-black: #111111;
  --mars-dark: #1E232A;
  --mars-gray-100: #F8F9FA;
  --mars-gray-200: #E9ECEF;
  --mars-gray-300: #DEE2E6;
  --mars-gray-500: #6C757D;
  --mars-gray-700: #495057;
  --mars-gray-900: #212529;
  --mars-green: #2E7D32;
  --mars-green-bg: #E8F5E9;
  --mars-yellow: #B26A00;
  --mars-yellow-bg: #FFF8E1;
  --mars-blue: #1565C0;
  --mars-blue-bg: #E3F2FD;
  --sidebar-width: 250px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #F4F6F8;
  color: var(--mars-gray-900);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* APP LAYOUT */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: #FFFFFF;
  border-right: 1px solid var(--mars-gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--mars-gray-100);
}

.sidebar-logo img {
  height: 44px;
  width: auto;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: var(--mars-gray-700);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--mars-gray-100);
  color: var(--mars-black);
}

.nav-item.active {
  background: var(--mars-red-light);
  color: var(--mars-red);
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* MAIN CONTENT */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-navbar {
  height: var(--header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--mars-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--mars-gray-100);
  border: 1px solid var(--mars-gray-300);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  width: 420px;
  gap: 10px;
}

.search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 13.5px;
  outline: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--mars-gray-700);
  border-radius: 50%;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--mars-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--mars-red-light);
  color: var(--mars-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.page-content {
  padding: 28px 32px 60px;
  flex: 1;
}

/* CARDS & CONTAINERS */
.card {
  background: #FFFFFF;
  border: 1px solid var(--mars-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--mars-black);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--mars-red);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--mars-red-hover);
}

.btn-outline {
  background: #FFFFFF;
  border-color: var(--mars-gray-300);
  color: var(--mars-gray-900);
}

.btn-outline:hover {
  background: var(--mars-gray-100);
  border-color: var(--mars-gray-400);
}

.btn-success {
  background: var(--mars-green);
  color: #FFFFFF;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* BADGES & TAGS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--mars-green-bg);
  color: var(--mars-green);
}

.badge-danger {
  background: var(--mars-red-light);
  color: var(--mars-red);
}

.badge-warning {
  background: var(--mars-yellow-bg);
  color: var(--mars-yellow);
}

.badge-info {
  background: var(--mars-blue-bg);
  color: var(--mars-blue);
}

.badge-gray {
  background: var(--mars-gray-200);
  color: var(--mars-gray-700);
}

/* TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.crm-table th {
  background: var(--mars-gray-100);
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mars-gray-700);
  border-bottom: 1px solid var(--mars-gray-300);
}

.crm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mars-gray-200);
  font-size: 13.5px;
}

.crm-table tr:hover td {
  background: #FCFCFD;
}

/* FORMS */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mars-gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--mars-gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  background: #FFFFFF;
}

.form-control:focus {
  border-color: var(--mars-red);
  box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.12);
}

/* STATS KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--mars-gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mars-gray-500);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--mars-black);
}

.kpi-value.red {
  color: var(--mars-red);
}

/* STEPPER */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 25px 0;
}

.stepper::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: var(--mars-gray-200);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--mars-gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--mars-gray-500);
}

.step-item.active .step-circle {
  border-color: var(--mars-red);
  background: var(--mars-red);
  color: #FFFFFF;
}

.step-item.completed .step-circle {
  border-color: var(--mars-green);
  background: var(--mars-green);
  color: #FFFFFF;
}

.step-label {
  font-size: 12.5px;
  font-weight: 600;
}

/* TIMELINE */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 12px;
  width: 2px;
  background: var(--mars-gray-200);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-icon {
  position: absolute;
  left: -32px;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--mars-gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-icon.whatsapp {
  border-color: #25D366;
  color: #25D366;
}

.timeline-icon.pbx {
  border-color: var(--mars-blue);
  color: var(--mars-blue);
}

.timeline-content {
  background: #FFFFFF;
  border: 1px solid var(--mars-gray-200);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

/* MOBILE BOTTOM BAR */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #FFFFFF;
  border-top: 1px solid var(--mars-gray-200);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--mars-gray-500);
}

.mobile-nav-link.active {
  color: var(--mars-red);
  font-weight: 700;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

/* RESPONSIVE DESIGN (360px+) */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding-bottom: 80px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .top-navbar {
    padding: 0 16px;
    max-width: 100vw;
  }

  .search-box {
    width: 160px;
  }

  .page-content {
    padding: 16px 12px 90px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .card {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-hide {
    display: none !important;
  }

  .mobile-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-stack > * {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  form.mobile-stack {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  form.mobile-stack > div {
    width: 100% !important;
    max-width: 100% !important;
  }

  form.mobile-stack button {
    width: 100% !important;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Mobil Tabloları Kart Görünümüne Dönüştürme */
  .table-cards thead {
    display: none !important;
  }

  .table-cards tr {
    display: block !important;
    background: #FFFFFF;
    border: 1px solid var(--mars-gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .table-cards td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    padding: 8px 0 !important;
    border: none !important;
    border-bottom: 1px dashed var(--mars-gray-200) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .table-cards td:last-child {
    border-bottom: none !important;
  }

  .table-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--mars-gray-500);
    font-size: 13px;
  }
}
