/* =============================================================
   site.css — project overrides on top of design-tokens + kit
   ============================================================= */

/* --- Base resets for app-shell --- */
html {
  font-size: var(--step-base, 14px);
}

body {
  margin: 0;
  min-height: 100vh;
}

/* --- Responsive: collapse sidebar on narrow screens --- */
@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .k-sidebar {
    position: fixed;
    left: -260px;
    z-index: 100;
    transition: left var(--duration-base, 160ms) var(--ease-standard, ease);
    width: 248px;
  }
  .k-sidebar.is-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
}

/* --- Grid helpers (extend cols beyond kit defaults) --- */
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 768px) {
  .k-grid.cols-2,
  .k-grid.cols-3,
  .k-grid.cols-4,
  .k-grid.cols-5 {
    grid-template-columns: 1fr;
  }
  .k-form-grid.cols-2,
  .k-form-grid.cols-3,
  .k-form-grid.cols-4 {
    grid-template-columns: 1fr;
  }
  .k-toplane {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .k-toplane {
    grid-template-columns: 1fr;
  }
}

/* --- Form tweaks for Tabler compatibility --- */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 2px var(--surface-card, #fff), 0 0 0 4px var(--brand-primary, #E40509);
  border-color: var(--brand-primary, #E40509);
  outline: none;
}

/* --- Inline form pattern for table cells --- */
.inline-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form .form-control-sm,
.inline-form .form-select-sm {
  min-width: 80px;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong, #e6ebf4);
  border-radius: 6px;
}

/* --- Pill nav text decoration override --- */
.k-pillnav a {
  text-decoration: none;
}

.k-pillnav a:hover {
  text-decoration: none;
}

/* --- Sidebar nav link text decoration override --- */
.k-navitem {
  text-decoration: none !important;
}

/* --- Ensure dropdown menus in topbar work --- */
.k-topbar .dropdown-menu {
  display: none;
}
.k-topbar .dropdown-menu.show {
  display: block;
}

/* --- Error page styles (shared) --- */
.k-error-page {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
}
