/* ============================================
   Imesta V2 - Pure Bootstrap 5 Theme
   ============================================ */

:root {
  --bdc-sidebar-width: 256px;
  --bdc-navbar-height: 52px;
}

/* === Base === */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: .875rem;
  background: #f5f7fa;
  -webkit-font-smoothing: antialiased;
}


/* ============================================
   NAVBAR
   ============================================ */
.bdc-navbar {
  height: var(--bdc-navbar-height);
  background: #fff !important;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  z-index: 1040;
  padding-top: 0;
  padding-bottom: 0;
}
.bdc-navbar .navbar-brand {
  font-size: 1.1rem;
}


/* ============================================
   SIDEBAR
   ============================================ */
.bdc-sidebar {
  width: var(--bdc-sidebar-width) !important;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  top: var(--bdc-navbar-height);
  bottom: 0;
  position: fixed !important;
  z-index: 1050;
  overflow-y: auto;
}

/* Sidebar nav */
.bdc-sidebar-nav {
  padding: .75rem 0 3rem;
}

.bdc-sidebar-nav > .nav > .nav-item > .nav-link {
  color: #374151;
  font-size: .8125rem;
  font-weight: 500;
  padding: .5rem 1rem;
  margin: 1px .5rem;
  border-radius: .375rem;
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}

.bdc-sidebar-nav > .nav > .nav-item > .nav-link:hover {
  background: #f3f4f6;
  color: #111827;
}

.bdc-sidebar-nav > .nav > .nav-item > .nav-link.active {
  background: #eff6ff;
  color: #2563eb;
}

.bdc-sidebar-nav > .nav > .nav-item > .nav-link i.bi {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  opacity: .7;
}
.bdc-sidebar-nav > .nav > .nav-item > .nav-link.active i.bi {
  opacity: 1;
}

/* Arrow icon in parent links */
.bdc-arrow {
  margin-left: auto;
  font-size: .7rem;
  opacity: .4;
  transition: transform .2s;
}
.nav-link[aria-expanded="true"] .bdc-arrow {
  transform: rotate(180deg);
}

/* Category headers */
.bdc-nav-header {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  padding: 1.25rem 1rem .375rem 1.25rem;
}

/* Submenu */
.bdc-sub {
  padding: .125rem 0 .25rem 0;
}
.bdc-sub .nav-link {
  font-size: .8rem;
  color: #6b7280;
  padding: .35rem 1rem .35rem 2.75rem;
  margin: 0 .5rem;
  border-radius: .375rem;
  transition: background .15s, color .15s;
  position: relative;
}
.bdc-sub .nav-link::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d1d5db;
  transform: translateY(-50%);
  transition: background .15s;
}
.bdc-sub .nav-link:hover {
  background: #f9fafb;
  color: #374151;
}
.bdc-sub .nav-link:hover::before {
  background: #9ca3af;
}
.bdc-sub .nav-link.active {
  color: #2563eb;
  background: #eff6ff;
  font-weight: 500;
}
.bdc-sub .nav-link.active::before {
  background: #2563eb;
  width: 5px;
  height: 5px;
}

/* 2. seviye akordiyon (grup içi modüller) */
.bdc-sub > .nav-item > .bdc-sub-toggle {
  font-size: .78rem;
  font-weight: 600;
  color: #4b5563;
  padding: .4rem 1rem .4rem 2rem;
  margin: 0 .5rem;
  border-radius: .375rem;
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}
.bdc-sub > .nav-item > .bdc-sub-toggle:hover {
  background: #f9fafb;
  color: #111827;
}
.bdc-sub > .nav-item > .bdc-sub-toggle.active {
  color: #2563eb;
  background: #eff6ff;
}
.bdc-sub-nested {
  padding: .125rem 0 .25rem 0;
}
.bdc-sub-nested .nav-link {
  font-size: .78rem;
  padding: .32rem 1rem .32rem 3.25rem;
}
.bdc-sub-nested .nav-link::before {
  left: 2.35rem;
}

/* Sidebar scrollbar */
.bdc-sidebar::-webkit-scrollbar { width: 4px; }
.bdc-sidebar::-webkit-scrollbar-track { background: transparent; }
.bdc-sidebar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }


/* ============================================
   MAIN CONTENT
   ============================================ */
.bdc-main {
  margin-left: var(--bdc-sidebar-width);
  padding-top: var(--bdc-navbar-height);
  min-height: 100vh;
}

/* Ana sayfa / login gibi sidebar olmayan sayfalar için */
.bdc-main--no-sidebar {
  margin-left: 0;
}

/* Footer */
.bdc-footer {
  background: #fff;
  font-size: .75rem;
}


/* ============================================
   CARDS
   ============================================ */
.card {
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card .card-header {
  background: transparent;
  border-bottom: 1px solid #e5e7eb;
  padding: .75rem 1.25rem;
  font-weight: 600;
  font-size: .875rem;
}
.card .card-body {
  padding: 1.25rem;
}

/* Gradient stat cards */
.card.bg-gradient-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; border:none!important; }
.card.bg-gradient-info,
.card.bg-gradient-primary { background: linear-gradient(135deg, #3b82f6, #2563eb) !important; border:none!important; }
.card.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; border:none!important; }
.card.bg-gradient-success { background: linear-gradient(135deg, #10b981, #059669) !important; border:none!important; }

.card.card-img-holder { position: relative; overflow: hidden; }
.card.card-img-holder .card-body { position: relative; z-index: 1; }
.card.card-img-holder .card-img-absolute {
  position: absolute; top: -25%; right: -15%; width: 60%; opacity: .12; pointer-events: none;
}


/* ============================================
   TABLES
   ============================================ */
.table {
  font-size: .8125rem;
}
.table thead th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;
  border-bottom-width: 2px;
  white-space: nowrap;
}
.table-hover > tbody > tr:hover { background: #f0f5ff; }

/* DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #d1d5db;
  border-radius: .375rem;
  padding: .35rem .65rem;
  font-size: .8125rem;
}
.dataTables_wrapper .dataTables_length select {
  min-width: 4.5rem;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-size: .78rem;
  color: #6b7280;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: .375rem !important;
  font-size: .78rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}


/* ============================================
   FORMS
   ============================================ */
.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: #374151;
}
.form-control, .form-select {
  font-size: .8125rem;
  border-color: #d1d5db;
  border-radius: .375rem;
}
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}


/* ============================================
   ALERTS
   ============================================ */
.alert {
  font-size: .8125rem;
  border-radius: .5rem;
  border: none;
  border-left: 4px solid;
}
.alert-success { background: #ecfdf5; border-left-color: #10b981; color: #065f46; }
.alert-danger { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }
.alert-warning { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }
.alert-info { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }


/* ============================================
   PAGE HEADER (view'larda kullanılıyor)
   ============================================ */
.page-header {
  margin-bottom: 1.25rem;
}
.page-header .page-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.page-title-icon {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: .5rem;
  font-size: .95rem;
}
.page-title-icon.bg-gradient-primary { background: linear-gradient(135deg,#3b82f6,#2563eb)!important; }
.page-title-icon.bg-gradient-info { background: linear-gradient(135deg,#3b82f6,#2563eb)!important; }
.page-title-icon.bg-gradient-success { background: linear-gradient(135deg,#10b981,#059669)!important; }
.page-title-icon.bg-gradient-warning { background: linear-gradient(135deg,#f59e0b,#d97706)!important; }
.page-title-icon.bg-gradient-danger { background: linear-gradient(135deg,#ef4444,#dc2626)!important; }


/* ============================================
   BADGES
   ============================================ */
.badge {
  font-weight: 500;
  font-size: .7rem;
}


/* ============================================
   BUTTONS - small tune
   ============================================ */
.btn { font-size: .8125rem; }
.btn-sm { font-size: .78rem; }


/* ============================================
   MODAL
   ============================================ */
.modal-content { border-radius: .75rem; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.15); }


/* ============================================
   CHARTS (Univer vardiya çizelgesi #univerGrid hariç)
   ============================================ */
#assetStatusChart,
#monthlyMaintenanceChart,
#summaryChart,
#deptChart,
#mealFrequencyChart,
#chartByDepartment,
#chartByStock,
#entryChart,
#statusChart,
#criticalityChart,
#chartYearlyCount,
#chartTenure,
[id^="chart-field-"],
.sparkline-demo-chart canvas {
  max-height: 320px;
}
#univerGrid canvas,
#univerGrid .univer-render-canvas {
  max-height: none !important;
  height: auto !important;
}


/* ============================================
   MISC - compat for old views using mdi icons
   ============================================ */
.menu-icon { display: none; } /* eski sidebar icon class - gizle */
.menu-title { } /* eski sidebar title class */
.menu-arrow { display: none; } /* eski sidebar arrow - gizle */
.grid-margin { margin-bottom: 1.25rem; }
.stretch-card { display: flex; }
.stretch-card > .card { width: 100%; }
.display-6 { font-weight: 700 !important; font-size: 2rem !important; }

/* MDI icon sizing where used in views */
.mdi { font-size: inherit; }


/* ============================================
   CMMS – Varlık & Bakım Yönetimi
   ============================================ */
.cursor-pointer { cursor: pointer; }

/* Select2 Bootstrap 5 tweaks */
.select2-container--bootstrap-5 .select2-selection { font-size: .8125rem; min-height: calc(1.5em + .5rem + 2px); }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { line-height: 1.5; padding: .25rem .5rem; }
.select2-container--bootstrap-5 .select2-dropdown { font-size: .8125rem; }

/* FullCalendar overrides */
.fc .fc-toolbar-title { font-size: 1rem !important; font-weight: 600; }
.fc .fc-button { font-size: .78rem !important; padding: .25rem .5rem !important; }
.fc .fc-daygrid-event { font-size: .72rem; border-radius: .25rem; }
.fc .fc-col-header-cell-cushion { font-size: .75rem; font-weight: 600; }
.fc .fc-daygrid-day-number { font-size: .78rem; }

/* Nav tabs for detail pages */
.nav-tabs .nav-link { font-size: .8125rem; color: #6b7280; }
.nav-tabs .nav-link.active { font-weight: 600; color: #2563eb; }
.nav-tabs .nav-link:hover { color: #374151; }

/* Tab content card */
.tab-content > .tab-pane > .card.border-top-0 { border-top: none !important; border-top-left-radius: 0; border-top-right-radius: 0; }

/* Breadcrumb compact */
.breadcrumb { font-size: .78rem; }
.breadcrumb-item a { text-decoration: none; }

/* bg-orange custom color for criticality */
.bg-orange { background-color: #f97316 !important; color: #fff; }


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
  .bdc-sidebar {
    width: 280px !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0;
  }
  .bdc-main {
    margin-left: 0;
  }
}


/* ============================================
   PRINT
   ============================================ */
@media print {
  .bdc-navbar, .bdc-sidebar, .bdc-footer { display: none !important; }
  .bdc-main { margin-left: 0 !important; padding-top: 0 !important; }
}
