/* ============================================
   TecnoCampo Cosecha — Custom Theme
   Warm, modern UI with amber/stone palette
   ============================================ */

/* --- Logo (sidebar band — hidden, moved to pane) --- */
.s-site-logo-img.s-sidebar-band-logo {
  display: none;
}

.s-site-logo-img {
  content: url(../site/logo.png);
  max-height: 32px;
  object-fit: contain;
}

/* --- Logo in sidebar pane --- */
.s-sidebar-pane-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 0.75rem;
}

.s-sidebar-pane-logo-img {
  max-width: 160px;
  height: auto;
  object-fit: contain;
}

/* --- CSS Custom Properties (Theme Override) --- */
:root,
:root.theme-azure-light,
:root.theme-glassy-light {

  /* Typography — override ALL font variables */
  --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --s-tabular-font: 'Inter', system-ui, -apple-system, sans-serif;
  --header-font: 'Inter', system-ui, -apple-system, sans-serif;
  --bs-body-font-size: 13px;

  /* Primary palette — Amber/Warm */
  --bs-primary: #b45309;
  --bs-primary-rgb: 180, 83, 9;
  --bs-link-color: #b45309;
  --bs-link-hover-color: #92400e;

  /* Body */
  --bs-body-bg: #faf9f7;
  --bs-body-color: #292524;
  --bs-body-color-rgb: 41, 37, 36;
  --bs-body-bg-rgb: 250, 249, 247;

  /* Borders */
  --bs-border-color: #e7e5e4;
  --bs-border-radius: 0.5rem;

  /* Cards */
  --s-card-bg: #ffffff;
  --s-card-border: #e7e5e4;
  --s-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --s-card-title: #292524;

  /* Sidebar */
  --s-sidebar-band-bg: #292524;
  --s-sidebar-band-link: #78716c;
  --s-sidebar-band-link-active: #ffffff;
  --s-sidebar-band-title: #f5f5f4;
  --s-sidebar-band-title2: #a8a29e;
  --s-sidebar-link: #57534e;
  --s-sidebar-link-active: #92400e;
  --s-sidebar-icon: #a8a29e;
  --s-sidebar-icon-active: #92400e;

  /* Inputs */
  --s-input-bg: #fafaf9;
  --s-input-text: #292524;
  --s-input-readonly-bg: #f5f5f4;
  --s-input-outline: #b45309;
  --s-input-outline-error: #dc2626;

  /* Grid */
  --s-column-header: #78716c;
  --s-column-header-border: #e7e5e4;
  --s-column-header-hover-bg: #f5f5f4;
  --s-cell-border: #f5f5f4;
  --s-alt-row-bg: #fafaf9;

  /* Tabs */
  --s-tabs-border: #e7e5e4;
  --s-tabs-border-active: #b45309;
  --s-tabs-text: #78716c;
  --s-tabs-text-active: #b45309;

  /* Category titles */
  --s-category-title: #78716c;

  /* Pager */
  --s-pager-icon: #78716c;
  --s-pager-text: #78716c;

  /* Scrollbar */
  --s-scroll-thumb: #d6d3d1;
  --s-scroll-thumb-hover: #a8a29e;
  --s-scroll-track: #f5f5f4;

  /* Placeholder */
  --s-placeholder: #a8a29e;

  /* Modal */
  --s-modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* Bootstrap overrides */
  --bs-success: #16a34a;
  --bs-success-rgb: 22, 163, 74;
  --bs-warning: #d97706;
  --bs-warning-rgb: 217, 119, 6;
  --bs-danger: #dc2626;
  --bs-danger-rgb: 220, 38, 38;
  --bs-info: #0891b2;
  --bs-info-rgb: 8, 145, 178;
}

/* --- Global Typography --- */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Sidebar Enhancements --- */
.s-sidebar-pane {
  background: #ffffff;
  border-right: 1px solid #e7e5e4;
}

.s-sidebar-band {
  background: #292524;
}

/* Sidebar band icons — active state: white with subtle warm indicator */
.s-sidebar-band-groups li.active .s-sidebar-band-link {
  color: #ffffff;
  position: relative;
}

.s-sidebar-band-groups li.active .s-sidebar-band-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  background: #b45309;
  border-radius: 0 2px 2px 0;
}

.s-sidebar-band-link:hover {
  color: #d6d3d1 !important;
}

/* Sidebar band branding text */
.s-sidebar-band-branding {
  transform: scale(0.85) rotate(-90deg);
  white-space: nowrap;
}

.s-sidebar-band-title {
  font-size: 20px !important;
  font-weight: 600;
  color: #f5f5f4;
}

/* Sidebar pane — menu items */
.s-sidebar-group-title {
  display: none !important;
  font-size: 12px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #44403c;
  padding: 0.5rem 1rem;
  margin: 0;
}

.s-sidebar-link {
  font-size: 13px !important;
  padding: 0.4rem 0.75rem !important;
  color: #57534e;
  border-radius: 0.375rem;
  margin: 1px 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.s-sidebar-link:hover {
  background: #f5f5f4;
  color: #292524;
  border-radius: 0.375rem;
}

.s-sidebar-link.active,
.s-sidebar-item.active > .s-sidebar-link {
  background: rgba(146, 64, 14, 0.06);
  color: #92400e !important;
  border-radius: 0.375rem;
  font-weight: 600;
}

.s-sidebar-link-text {
  font-size: 13px !important;
}

/* Sidebar icons — smaller */
.s-sidebar-icon {
  font-size: 13px !important;
  width: 1.25rem;
  text-align: center;
}

/* Section titles */
.s-sidebar-section-title {
  color: #a8a29e;
  font-size: 13px !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 0.75rem 1.25rem 0.25rem;
  margin: 0;
}

/* Search input in sidebar */
.s-sidebar-search-input {
  font-size: 0.8rem !important;
  border-radius: 0.375rem;
}

/* --- Buttons --- */
.btn-primary,
.btn-primary:active {
  background: linear-gradient(135deg, #b45309, #92400e) !important;
  border-color: #92400e !important;
  color: #fff !important;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: none !important;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #92400e, #78350f) !important;
  border-color: #78350f !important;
  filter: brightness(1.05);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.2) !important;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #d6d3d1;
  color: #57534e;
  border-radius: 0.5rem;
  font-weight: 500;
}

.btn-secondary:hover {
  background: #f5f5f4;
  border-color: #a8a29e;
  color: #44403c;
}

.btn-info {
  background: linear-gradient(135deg, #b45309, #92400e);
  border-color: #92400e;
  color: #fff;
  border-radius: 0.5rem;
}

.btn-info:hover {
  background: linear-gradient(135deg, #92400e, #78350f);
  border-color: #78350f;
  color: #fff;
}

.btn-danger {
  border-radius: 0.5rem;
}

.btn-success {
  border-radius: 0.5rem;
}

/* --- Form Fields --- */
.form-control,
.form-select {
  border-radius: 0.5rem;
  border-color: #d6d3d1;
  background-color: #fafaf9;
  color: #292524;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
  background-color: #ffffff;
}

.form-control::placeholder {
  color: #a8a29e;
}

/* Labels */
.caption,
.field-label,
.s-PropertyGrid .category-title,
.editor-label label {
  color: #78716c;
  font-weight: 500;
  font-size: 0.8rem;
}

/* --- Data Grid (SlickGrid) — Complete Override --- */

/* Grid container */
.s-DataGrid {
  border-radius: 0 !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  background: #ffffff !important;
}

/* Grid viewport */
.slick-container {
  background: #ffffff !important;
  border: none !important;
}

.slick-container .slick-viewport {
  background: #ffffff !important;
}

/* Header */
.slick-container .slick-header {
  background: #f5f5f4 !important;
  border-bottom: 2px solid #d6d3d1 !important;
  box-shadow: none !important;
}

.slick-container .slick-header-columns {
  border-bottom: none !important;
}

.slick-container .slick-header-column {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #57534e !important;
  background: transparent !important;
  border-right: 1px solid #e7e5e4 !important;
  border-left: none !important;
  padding: 6px 10px !important;
  line-height: 1.5 !important;
  height: auto !important;
}

.slick-container .slick-header-column:hover {
  background: #e7e5e4 !important;
  color: #292524 !important;
}

.slick-container .slick-header-column.slick-header-column-sorted {
  color: #92400e !important;
  background: rgba(180, 83, 9, 0.06) !important;
}

.slick-container .slick-sort-indicator {
  color: #b45309 !important;
}

.slick-container .slick-resizable-handle {
  background: #d6d3d1 !important;
  width: 2px !important;
  right: 0 !important;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.slick-container .slick-header-column:hover .slick-resizable-handle {
  opacity: 1;
}

/* Rows — visible separators */
.slick-container .slick-row {
  border-bottom: 1px solid #e7e5e4 !important;
  font-size: 12px !important;
  transition: background-color 0.1s ease !important;
}

.slick-container .slick-row.odd {
  background: #fafaf9 !important;
}

.slick-container .slick-row:hover {
  background: rgba(146, 64, 14, 0.06) !important;
}

.slick-container .slick-row.active,
.slick-container .slick-row.selected {
  background: rgba(146, 64, 14, 0.06) !important;
}

/* Cells */
.slick-container .slick-cell {
  border-right: none !important;
  border-bottom: none !important;
  color: #292524 !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.slick-container .slick-cell.selected {
  background: rgba(180, 83, 9, 0.08) !important;
}

.slick-container .slick-cell.active {
  border-color: #b45309 !important;
}

.slick-container .slick-cell a {
  color: #b45309 !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

.slick-container .slick-cell a:hover {
  color: #92400e !important;
  text-decoration: underline !important;
}

/* Boolean/checkbox cells */
.slick-container .slick-cell .check-box,
.slick-container .slick-cell input[type="checkbox"] {
  accent-color: #b45309 !important;
}

/* Group rows */
.slick-container .slick-group {
  background: #f5f5f4 !important;
  border-bottom: 1px solid #e7e5e4 !important;
  font-weight: 600 !important;
  color: #44403c !important;
  font-size: 11px !important;
}

.slick-container .slick-group-title {
  font-weight: 600 !important;
  color: #44403c !important;
}

.slick-container .slick-group-toggle {
  color: #b45309 !important;
}

/* Grid toolbar — with subtle bottom separator */
.s-DataGrid .grid-toolbar,
.s-DataGrid .s-Toolbar {
  background: transparent !important;
  border-bottom: 1px solid #e7e5e4 !important;
  padding: 0.5rem 0.5rem !important;
  margin-bottom: 0 !important;
}

.s-DataGrid .grid-toolbar .btn,
.s-DataGrid .s-Toolbar .tool-button {
  border-radius: 0.5rem !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 0.35rem 0.75rem !important;
}

.s-DataGrid .s-Toolbar .tool-button .button-inner {
  font-size: 12px !important;
}

/* Quick search */
.quick-search-input,
.s-QuickSearchInput input {
  border-radius: 0.5rem !important;
  border: 1px solid #d6d3d1 !important;
  background: #ffffff !important;
  font-size: 12px !important;
  padding: 0.35rem 0.65rem !important;
}

.quick-search-input:focus,
.s-QuickSearchInput input:focus {
  border-color: #b45309 !important;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1) !important;
}

/* Pager — with better separation and spacing */
.s-SlickPager,
.slick-pg {
  border-top: 2px solid #e7e5e4 !important;
  background: #f5f5f4 !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  color: #57534e !important;
}

.s-SlickPager span,
.s-SlickPager a,
.s-SlickPager input,
.s-SlickPager select,
.slick-pg span,
.slick-pg a,
.slick-pg input,
.slick-pg select {
  font-size: 12px !important;
}

/* Column picker */
.slick-columnpicker {
  background: #ffffff !important;
  border: 1px solid #e7e5e4 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  font-size: 0.8rem !important;
}

/* Scrollbar inside grid */
.slick-container .slick-viewport::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.slick-container .slick-viewport::-webkit-scrollbar-track {
  background: #fafaf9;
}

.slick-container .slick-viewport::-webkit-scrollbar-thumb {
  background: #d6d3d1;
  border-radius: 3px;
}

.slick-container .slick-viewport::-webkit-scrollbar-thumb:hover {
  background: #a8a29e;
}

/* --- Dialogs --- */
.ui-dialog,
.s-Dialog,
.modal-content {
  border-radius: 1rem !important;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid #e7e5e4 !important;
}

.ui-dialog-titlebar,
.s-Dialog .s-DialogTitle,
.modal-header {
  background: #fafaf9 !important;
  border-bottom: 1px solid #e7e5e4 !important;
  color: #292524;
  font-weight: 700;
}

.ui-dialog-titlebar .ui-dialog-title,
.modal-title {
  font-weight: 700;
  color: #292524;
  font-size: 14px;
}

.ui-dialog-content,
.modal-body {
  background: #ffffff;
}

.s-Dialog .s-DialogContent .s-Form .category-title,
.s-PropertyGrid .category-title {
  color: #78716c;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-color: #e7e5e4;
}

/* Dialog — all text to 12px */
.s-PropertyGrid .caption,
.s-PropertyGrid label,
.s-PropertyGrid .field-label,
.s-PropertyGrid .editor-label label {
  font-size: 12px !important;
}

.s-PropertyGrid input,
.s-PropertyGrid select,
.s-PropertyGrid textarea,
.s-PropertyGrid .editor,
.s-PropertyGrid .editor input,
.s-PropertyGrid .form-control,
.s-Dialog input,
.s-Dialog select,
.s-Dialog textarea,
.s-Dialog .form-control {
  font-size: 12px !important;
}

.s-Dialog button,
.s-Dialog .btn,
.ui-dialog-buttonpane button,
.ui-dialog-buttonset .ui-button,
.modal-footer .btn {
  font-size: 12px !important;
}

.s-Dialog .s-Toolbar .tool-button,
.s-Dialog .s-Toolbar .tool-button .button-inner,
.s-Panel .s-Toolbar .tool-button,
.s-Panel .s-Toolbar .tool-button .button-inner {
  font-size: 12px !important;
}

.s-Dialog .nav-tabs .nav-link {
  font-size: 12px !important;
}

.ui-dialog-buttonpane,
.modal-footer {
  background: #fafaf9 !important;
  border-top: 1px solid #e7e5e4 !important;
  padding: 0.75rem 1.25rem !important;
}

/* Dialog close button */
.ui-dialog-titlebar-close,
.btn-close {
  border-radius: 0.5rem;
  opacity: 0.5;
}

.ui-dialog-titlebar-close:hover,
.btn-close:hover {
  opacity: 1;
  background-color: #f5f5f4;
}

/* --- Tabs (inside dialogs/panels) --- */
.nav-tabs .nav-link {
  color: #78716c;
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
  color: #44403c;
  border-bottom-color: #d6d3d1;
}

.nav-tabs .nav-link.active {
  color: #b45309;
  border-bottom-color: #b45309;
  font-weight: 600;
  background: transparent;
}

/* Serenity-style tabs */
.s-PropertyGrid .categories .category-anchor.active {
  color: #b45309;
  border-bottom-color: #b45309;
}

/* --- Cards & Panels --- */
.card {
  border-radius: 0.75rem;
  border-color: #e7e5e4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.card-header {
  background: #fafaf9;
  border-bottom-color: #e7e5e4;
  font-weight: 600;
  color: #292524;
}

/* --- Badges (Status pills) --- */
.badge {
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.25em 0.75em;
}

/* --- Dropdown Menus --- */
.dropdown-menu {
  border-radius: 0.75rem;
  border-color: #e7e5e4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 0.5rem;
}

.dropdown-item {
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #44403c;
  padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: #f5f5f4;
  color: #292524;
}

.dropdown-item.active,
.dropdown-item:active {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.08), rgba(217, 119, 6, 0.05));
  color: #b45309;
}

/* --- Alerts / Notifications --- */
.toast,
.s-toast {
  border-radius: 0.75rem;
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f4;
}

::-webkit-scrollbar-thumb {
  background: #d6d3d1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a29e;
}

/* --- Selection color --- */
::selection {
  background: rgba(180, 83, 9, 0.15);
  color: #292524;
}

/* --- Mobile header --- */
.s-mobile-header {
  background: #292524;
  border-bottom: none;
}

/* --- Content area background --- */
.s-main {
  background: #faf9f7;
}

.s-main .content {
  background: #faf9f7;
}

/* --- Page titles — more prominent --- */
.content-header h2,
.content-header h1,
.page-title,
.s-DataGrid .grid-title,
.s-DataGrid .title-text {
  color: #292524;
  font-weight: 700;
  font-size: 18px !important;
  letter-spacing: -0.01em;
}

