/* ============================================================
   İnşaat Pro - Ana CSS
   Tema: Modern / Growth
   Primary: #10b981 (Yeşil - Emerald)
   Accent:  #f97316 (Turuncu - Orange)
   ============================================================ */

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

:root {
  /* Ana Renkler - Yeşil & Turuncu */
  --ip-green:       #10b981;  /* Emerald Green - Ana yeşil */
  --ip-green-dark:  #059669;  /* Koyu yeşil - Hover */
  --ip-green-light: #34d399;  /* Açık yeşil - Vurgular */
  --ip-orange:      #f97316;  /* Vibrant Orange - Vurgu rengi */
  --ip-orange-dk:   #ea580c;  /* Koyu turuncu - Hover */
  --ip-orange-light:#fb923c;  /* Açık turuncu */
  
  /* Nötr Renkler */
  --ip-gray:        #f0f2f5;
  --ip-border:      #e5e7eb;
  --ip-text:        #1f2937;  /* Koyu gri - Metin */
  --ip-muted:       #6b7280;  /* Orta gri - İkincil metin */
  
  /* Sidebar için özel yeşil tonları */
  --ip-sidebar-bg:  #047857;  /* Koyu yeşil - Sidebar arka plan */
  --ip-sidebar-hover: #059669; /* Hover durumu */
  
  /* Boyutlar */
  --ip-sidebar-w:   250px;
  --ip-topbar-h:    60px;
  
  /* Gölgeler */
  --shadow-sm:      0 2px 8px rgba(16,185,129,.08);
  --shadow-md:      0 4px 20px rgba(16,185,129,.12);
  --shadow-orange:  0 4px 20px rgba(249,115,22,.15);
  
  /* Border Radius */
  --radius:         10px;
}

* { box-sizing: border-box; }
body {
  font-family: 'Quicksand', sans-serif;
  font-size: 14.5px;
  background: var(--ip-gray);
  color: var(--ip-text);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ---- SIDEBAR ---- */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--ip-sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--ip-sidebar-bg) 0%, var(--ip-sidebar-hover) 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 20px rgba(16,185,129,.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  background: rgba(0,0,0,.1);
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  color: var(--ip-orange);
  font-family: 'Quicksand', sans-serif;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.sidebar-brand-text {
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.sidebar-brand-text span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,.7);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.sidebar-section {
  padding: 12px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .2s;
}

.nav-item-link:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.nav-item-link.active {
  color: #fff;
  background: rgba(249,115,22,.15);
  border-left-color: var(--ip-orange);
  font-weight: 600;
}

.nav-item-link .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px;
}

.sub-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  letter-spacing: .5px;
}
.sub-badge.trial   { background: rgba(255,193,7,.2); color: #ffc107; }
.sub-badge.active  { background: rgba(25,135,84,.2); color: #28a745; }
.sub-badge.expired { background: rgba(220,53,69,.2); color: #dc3545; }

/* ---- TOPBAR ---- */
#topbar {
  position: fixed;
  top: 0;
  left: var(--ip-sidebar-w);
  right: 0;
  height: var(--ip-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--ip-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 999;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ip-green);
  margin-right: auto;
}

.topbar-avatar {
  width: 34px; height: 34px;
  background: var(--ip-orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  cursor: pointer;
}

/* ---- MAIN CONTENT ---- */
#main-content {
  margin-left: var(--ip-sidebar-w);
  padding-top: var(--ip-topbar-h);
  min-height: 100vh;
}

.page-wrapper {
  padding: 24px;
}

/* ---- CARDS ---- */
.card {
  border: 1px solid var(--ip-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

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

.card-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ip-green-dark);
  margin: 0;
}

/* ---- STAT CARDS ---- */
.stat-card {
  background: #fff;
  border: 1px solid var(--ip-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

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

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}

.stat-card .stat-value {
  font-family: 'Quicksand', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ip-green-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--ip-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

.stat-card .stat-stripe {
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- TABLES ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}

.table {
  margin: 0;
  font-size: 14px;
}

.table thead th {
  background: #f8f9fc;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ip-muted);
  border-bottom: 2px solid var(--ip-border);
  padding: 10px 14px;
  white-space: nowrap;
}

.table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f2f5;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background: #fafbff;
}

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--ip-orange) !important;
  border-color: var(--ip-orange) !important;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--ip-orange-dk) !important;
  border-color: var(--ip-orange-dk) !important;
}

.btn-navy {
  background: var(--ip-green);
  border-color: var(--ip-green);
  color: #fff;
  font-weight: 600;
}

.btn-navy:hover {
  background: var(--ip-green-dark);
  border-color: var(--ip-green-dark);
  color: #fff;
}

.btn-icon {
  width: 30px; height: 30px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 14px;
}

/* ---- FORMS ---- */
.form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ip-text);
  margin-bottom: 5px;
}

.form-control, .form-select {
  border-color: var(--ip-border);
  border-radius: 7px;
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ip-orange);
  box-shadow: 0 0 0 3px rgba(244,119,26,.12);
}

.required-mark { color: var(--ip-orange); }

/* ---- BADGES ---- */
.badge {
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 4px 9px;
}

/* ---- PROGRESS ---- */
.progress {
  height: 8px;
  border-radius: 10px;
  background: var(--ip-gray);
}

.progress-bar {
  background: var(--ip-orange);
}

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

.page-header h1 {
  font-size: 26px;
  color: var(--ip-green-dark);
  margin: 0;
}

.breadcrumb {
  font-size: 13px;
  margin: 0;
}

.breadcrumb-item a { color: var(--ip-orange); text-decoration: none; }

/* ---- ALERT ---- */
.alert {
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
}

/* ---- MODAL ---- */
.modal-header {
  background: linear-gradient(135deg, var(--ip-green) 0%, var(--ip-green-dark) 100%);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title { font-family: 'Quicksand', sans-serif; font-size: 18px; font-weight: 600; }
.modal-header .btn-close { filter: invert(1); }

/* ---- PRINT ---- */
@media print {
  #sidebar, #topbar, .no-print,
  .btn, nav, .breadcrumb { display: none !important; }
  #main-content { margin: 0 !important; padding: 0 !important; }
  .page-wrapper { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: #fff !important; font-size: 12px; }
  .print-header {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 3px solid #1a2744;
    margin-bottom: 20px;
  }
  .print-logo-box {
    width: 50px; height: 50px;
    background: #10b981;
    color: #f97316;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
    border-radius: 8px;
    font-family: 'Quicksand', sans-serif;
  }
  .print-company-name { font-size: 20px; font-weight: 700; color: #047857; }
  .print-doc-title { font-size: 16px; color: #666; margin-top: 2px; }
  .table thead th { background: #f0f2f5 !important; print-color-adjust: exact; }
  .badge { border: 1px solid #ddd; print-color-adjust: exact; }
  .signature-line { border-top: 1px solid #333; width: 200px; margin-top: 40px; padding-top: 6px; font-size: 11px; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  /* Sidebar - Hidden by default on mobile */
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  }
  #sidebar.show {
    transform: translateX(0);
  }
  
  /* Main content - Full width on mobile */
  #main-content {
    margin-left: 0;
  }
  
  /* Topbar - Full width */
  #topbar {
    left: 0;
    padding: 0 12px;
  }
  .topbar-title {
    font-size: 16px;
  }
  
  /* Page wrapper - Reduced padding */
  .page-wrapper { 
    padding: 12px; 
  }
  
  /* Page header - Stack vertically */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
  .page-header h1 {
    font-size: 20px;
  }
  .page-header .d-flex {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  /* Dashboard grid - Single column */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  /* Dashboard cards - Compact */
  .dashboard-card {
    padding: 16px;
  }
  .dashboard-card .value {
    font-size: 24px;
  }
  .dashboard-card .icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  /* Tables - Horizontal scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    font-size: 12px;
    min-width: 600px; /* Prevent table from being too narrow */
  }
  .table thead th,
  .table tbody td {
    padding: 8px;
    white-space: nowrap;
  }
  
  /* Buttons - Touch-friendly */
  .btn {
    font-size: 13px;
    padding: 8px 14px;
    min-height: 38px; /* Touch target size */
  }
  .btn-sm {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 32px;
  }
  .btn-icon {
    width: 38px;
    height: 38px;
  }
  
  /* Cards - Reduced spacing */
  .card {
    margin-bottom: 12px;
  }
  .card-body {
    padding: 12px;
  }
  .card-header {
    padding: 12px 16px;
  }
  
  /* Form elements - Touch-friendly */
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px; /* Touch target size */
  }
  
  /* Stat cards - Compact */
  .stat-card {
    padding: 16px;
  }
  .stat-card .stat-value {
    font-size: 22px;
  }
  .stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  /* Modals - Full screen on small devices */
  .modal-dialog {
    margin: 0;
    max-width: 100%;
  }
  .modal-content {
    min-height: 100vh;
    border-radius: 0;
  }
  
  /* Dropdowns - Better touch targets */
  .dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  /* Alerts - Compact */
  .alert {
    padding: 12px;
    font-size: 13px;
  }
  
  /* Badges - Slightly larger */
  .badge {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  /* Activity items - Better spacing */
  .activity-item {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  
  /* Section titles - Smaller */
  .section-title {
    font-size: 16px;
    margin-bottom: 16px;
  }
  
  /* Hide desktop-only elements */
  .d-none.d-lg-block {
    display: none !important;
  }
  
  /* Topbar elements - Compact */
  .topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  /* Calculator modal - Better mobile layout */
  #calculatorModal .modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  #calculatorModal .modal-content {
    min-height: auto;
  }
  
  /* Breadcrumb - Smaller */
  .breadcrumb {
    font-size: 12px;
  }
  
  /* Row gaps - Reduced */
  .row.g-3 {
    gap: 12px !important;
  }
  
  /* Chart containers - Responsive height */
  .chart-container {
    height: 180px;
  }
  canvas {
    max-height: 180px !important;
  }
}

/* Hamburger menu button */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--ip-green);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* Prevent body scroll when sidebar is open on mobile */
@media (max-width: 768px) {
  body.sidebar-open {
    overflow: hidden;
  }
}

/* ---- UTILS ---- */
.text-orange   { color: var(--ip-orange) !important; }
.text-green    { color: var(--ip-green) !important; }
.text-navy     { color: var(--ip-green-dark) !important; }
.bg-navy       { background: var(--ip-green) !important; }
.bg-green      { background: var(--ip-green) !important; }
.bg-orange     { background: var(--ip-orange) !important; }
.border-orange { border-color: var(--ip-orange) !important; }
.border-green  { border-color: var(--ip-green) !important; }
.fw-display    { font-family: 'Quicksand', sans-serif; font-weight: 600; }
.money         { font-family: 'Quicksand', sans-serif; font-weight: 600; }
.text-success-emp { color: #10b981; font-weight: 700; }
.text-danger-emp  { color: #dc3545; font-weight: 700; }

/* ---- PRINT HEADER (hidden except print) ---- */
.print-header { display: none; }

/* ---- SUBSCRIPTION BANNER ---- */
.sub-banner {
  background: linear-gradient(135deg, var(--ip-orange) 0%, var(--ip-orange-dk) 100%);
  color: #fff;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: var(--ip-topbar-h);
  left: var(--ip-sidebar-w);
  right: 0;
  z-index: 998;
}

.sub-banner + .page-wrapper {
  padding-top: 50px;
}

/* ---- QUOTE ITEMS TABLE ---- */
.quote-items-table input {
  border: 1px solid var(--ip-border);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 13px;
  width: 100%;
}

/* ---- TOTAL ROW ---- */
.total-row td {
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  background: #f8f9fc !important;
  border-top: 2px solid var(--ip-border) !important;
}

/* ---- DASHBOARD CHART ---- */
.chart-container {
  position: relative;
  height: 200px;
}

/* ---- YEŞİL-TURUNCU VURGU STİLLERİ ---- */
.stat-card.green .stat-icon {
  background: linear-gradient(135deg, var(--ip-green) 0%, var(--ip-green-dark) 100%);
  color: #fff;
}

.stat-card.orange .stat-icon {
  background: linear-gradient(135deg, var(--ip-orange) 0%, var(--ip-orange-dk) 100%);
  color: #fff;
}

.stat-card.green .stat-stripe {
  background: var(--ip-green);
}

.stat-card.orange .stat-stripe {
  background: var(--ip-orange);
}

/* Hover efektleri */
.btn-success {
  background: var(--ip-green) !important;
  border-color: var(--ip-green) !important;
}

.btn-success:hover {
  background: var(--ip-green-dark) !important;
  border-color: var(--ip-green-dark) !important;
  box-shadow: var(--shadow-sm);
}

.btn-warning {
  background: var(--ip-orange) !important;
  border-color: var(--ip-orange) !important;
  color: #fff !important;
}

.btn-warning:hover {
  background: var(--ip-orange-dk) !important;
  border-color: var(--ip-orange-dk) !important;
  box-shadow: var(--shadow-orange);
}

/* Badge renkleri */
.badge-success {
  background: var(--ip-green) !important;
}

.badge-warning {
  background: var(--ip-orange) !important;
  color: #fff !important;
}

/* Link renkleri */
a {
  color: var(--ip-green);
  text-decoration: none;
}

a:hover {
  color: var(--ip-green-dark);
  text-decoration: underline;
}

/* Topbar avatar turuncu */
.topbar-avatar {
  background: linear-gradient(135deg, var(--ip-orange) 0%, var(--ip-orange-dk) 100%);
  box-shadow: 0 2px 8px rgba(249,115,22,.3);
}

.topbar-avatar:hover {
  transform: scale(1.05);
  transition: transform .2s;
}


/* ---- UTILITY CLASSES - YEŞİL & TURUNCU ---- */
.text-green {
  color: var(--ip-green) !important;
}

.text-green-dark {
  color: var(--ip-green-dark) !important;
}

.text-orange {
  color: var(--ip-orange) !important;
}

.bg-green {
  background-color: var(--ip-green) !important;
}

.bg-green-light {
  background-color: var(--ip-green-light) !important;
}

.bg-orange {
  background-color: var(--ip-orange) !important;
}

.bg-orange-light {
  background-color: var(--ip-orange-light) !important;
}

/* Dashboard card color variants */
.dashboard-card.green {
  border-left: 4px solid var(--ip-green);
}

.dashboard-card.orange {
  border-left: 4px solid var(--ip-orange);
}

/* Summary card color variants */
.summary-card.green {
  border-left: 4px solid var(--ip-green);
}

.summary-card.orange {
  border-left: 4px solid var(--ip-orange);
}

/* Service card enhancements */
.service-card .icon {
  transition: transform .2s;
}

.service-card:hover .icon {
  transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-card {
    margin-bottom: 15px;
  }
  
  .summary-card {
    margin-bottom: 15px;
  }
}
