:root {
  /* Taurocreto Colors */
  --color-primary: #A93720;
  --color-header: #7E2819;
  --color-button: #832A1B;
  --color-surface: #F3F3F3;
  --color-input: #FFFFFF;
  --color-accent: #009D85;
  --color-text-light: #FFFFFF;
  --color-text-dark: #222222;

  /* Aliases for backwards compatibility */
  --primary-color: var(--color-primary);
  --primary-hover: var(--color-button);
  --secondary-color: #6c757d;
  --success-color: var(--color-accent);
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-color: var(--color-surface);
  --dark-color: var(--color-text-dark);
  
  --bg-color: #FFFFFF;
  --surface-color: var(--color-surface);
  --text-primary: var(--color-text-dark);
  --text-secondary: #666666;
  --border-color: #dddddd;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Spacing & Sizes */
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  --box-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout */
.container {
  width: 100%;
  padding: 1rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
}

/* Navigation */
.navbar {
  background-color: var(--color-header);
  box-shadow: var(--box-shadow);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 70px;
}

.profile-img-nav {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  max-height: 40px;
  width: auto;
}

.login-logo {
  max-width: 150px;
  height: auto;
  margin: 0 auto 1.5rem auto;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text-light);
  background-color: rgba(255,255,255,0.1);
}

.btn-logout {
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-text-light) !important;
  border-radius: 20px;
  padding: 0.4rem 1rem;
}

.btn-logout:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

/* Mobile Nav Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-light);
}

@media (max-width: 991.98px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-header);
    box-shadow: var(--box-shadow);
    padding: 1rem;
  }
  
  .btn-logout {
      margin-top: 1rem;
      text-align: center;
  }
  
  .nav-menu.show {
    display: flex;
  }
}

/* Nav Profile Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-hover);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 1050;
  overflow: hidden;
}

/* Notifications in Navbar */
.nav-notifications {
    position: relative;
    display: inline-block;
    margin-right: 0.5rem;
}

.notification-toggle {
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 50%;
}

.notification-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--color-accent); /* Greenish accent or Red */
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    border: 2px solid var(--color-header);
    min-width: 18px;
    text-align: center;
    display: none; /* Hidden if 0 */
}

.notification-badge.active {
    display: block;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-hover);
    width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1050;
    overflow: hidden;
}

.nav-notifications.active .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 1rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h3 {
    font-size: 1rem;
    margin: 0;
    color: var(--color-text-dark);
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notification-item.unread {
    background-color: rgba(169, 55, 32, 0.03);
    border-left: 3px solid var(--color-primary);
}

.notification-item.read,
.notification-card.read {
    opacity: 0.92;
    border-left-color: var(--tc-border, #E5E7EB);
}

.notif-accordion-item.expanded .notif-chevron {
    transform: rotate(180deg);
}

.notif-accordion-header {
    cursor: pointer;
    align-items: flex-start;
}

.notif-accordion-header:focus-visible {
    outline: 2px solid var(--color-primary, #A93720);
    outline-offset: 2px;
    border-radius: 4px;
}

.notif-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.notif-chevron {
    color: #9ca3af;
    transition: transform 0.2s ease;
    margin-top: 0.25rem;
}

.notif-accordion-body {
    padding: 0.75rem 0 0 2.75rem;
    border-top: 1px dashed var(--border-color, #E5E7EB);
    margin-top: 0.5rem;
}

.notif-estado-badge {
    font-size: 0.65rem;
    font-weight: 600;
}

.notif-badge-unread {
    background-color: #A93720 !important;
    color: #fff !important;
}

.notif-badge-read {
    background-color: #e5e7eb !important;
    color: #4b5563 !important;
}

.btn-tc-resolve {
    background-color: var(--color-primary, #A93720);
    color: #fff;
    border: none;
}

.btn-tc-resolve:hover {
    background-color: var(--color-primary-hover, #832A1B);
    color: #fff;
}

@media (max-width: 575.98px) {
    .notification-dropdown {
        width: min(100vw - 1.5rem, 360px);
        max-width: 100%;
    }

    .notif-accordion-body {
        padding-left: 0.5rem;
    }

    .notif-actions .btn {
        flex: 1 1 auto;
        min-height: 36px;
    }
}

.notif-actions .btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.notification-card .notif-actions {
    margin-top: 0.75rem;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--color-text-dark);
}

.notification-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.notification-time {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.4rem;
}

.notification-footer {
    padding: 0.75rem;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
}

.notification-footer a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.notification-footer a:hover {
    text-decoration: underline;
}

.nav-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 1.25rem 1rem;
  background-color: var(--color-primary);
  color: #fff;
  text-align: center;
}

.dropdown-header-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.dropdown-header-role {
  font-size: 0.85rem;
  opacity: 0.9;
}

.dropdown-item {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: #e9ecef;
  color: var(--primary-color);
}

.dropdown-item.logout {
  color: var(--danger-color);
}

.dropdown-item.logout:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

@media (max-width: 767px) {
  .dropdown-menu {
    position: static;
    box-shadow: none;
    transform: none;
    background-color: transparent;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
  }
  
  .dropdown-header {
    background-color: transparent;
    text-align: left;
    padding: 1rem 0.5rem;
  }
  
  .dropdown-item {
    color: rgba(255,255,255,0.85);
    border-bottom: none;
    padding: 0.75rem 0.5rem;
  }
  
  .dropdown-item:hover {
    background-color: transparent;
    color: #fff;
  }
  
  .dropdown-item.logout {
    color: #ffcccc;
  }
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: #f8f9fa;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: var(--color-input);
  box-shadow: 0 0 0 4px rgba(0, 157, 133, 0.15);
}

/* Combo / Dropdown Fields */
.combo-field {
  position: relative;
}

.combo-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow-y: auto;
  background: var(--color-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-hover);
  z-index: 50;
}

.combo-dropdown[hidden] {
  display: none !important;
}

.combo-option {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.combo-option:last-child {
  border-bottom: none;
}

.combo-option:hover,
.combo-option:focus {
  background: var(--surface-color);
  outline: none;
}

.combo-empty {
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.combo-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem; /* Large buttons for mobile */
  font-size: 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
  width: 100%; /* Full width on mobile by default */
}

@media (min-width: 768px) {
  .btn {
    width: auto;
  }
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(169, 55, 32, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  color: #fff;
  background-color: var(--danger-color);
}

.btn-danger:hover:not(:disabled) {
  background-color: #bb2d3b;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: #fff;
}

.report-btn {
  padding: 2rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  border: 2px solid #eee;
  border-radius: 16px;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-btn:hover {
  border-color: var(--color-primary);
  background: rgba(169, 55, 32, 0.02);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(169, 55, 32, 0.1);
}

.report-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.report-text {
  font-weight: 700;
  font-size: 1rem;
  color: #444;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

/* Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--surface-color);
  background-clip: border-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
  margin-bottom: 1rem;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* Loading Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: var(--transition);
}

.spinner-overlay.active {
  visibility: visible;
  opacity: 1;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border .75s linear infinite;
  color: var(--primary-color);
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

/* Toasts / Notifications */
#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  #toast-container {
    left: auto;
    width: 350px;
  }
}

#toast-container .toast {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  color: #fff !important;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: flex !important; /* Anular display: none de Bootstrap 5 */
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: none !important; /* Anular borde de Bootstrap */
  background-color: #333 !important; /* Fondo oscuro por defecto */
}

#toast-container .toast.success { background-color: var(--success-color) !important; }
#toast-container .toast.error { background-color: var(--danger-color) !important; }
#toast-container .toast.info { background-color: var(--info-color) !important; }
#toast-container .toast.warning {
  background-color: var(--warning-color) !important;
  color: #212529 !important; /* Texto oscuro para visibilidad en fondo amarillo */
}
#toast-container .toast.warning .toast-close {
  color: #212529 !important; /* Botón de cerrar oscuro en advertencias */
}

.toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  line-height: 1;
}

.toast-close:hover { opacity: 1; }

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#toast-container .toast.hiding {
  animation: toast-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

/* Login specific */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 6px;
}

.badge-activa { background-color: var(--success-color); color: white; }
.badge-inactiva { background-color: var(--secondary-color); color: white; }
.badge-en_mantenimiento { background-color: var(--warning-color); color: #000; }
.badge-fuera_servicio { background-color: var(--danger-color); color: white; }

/* Tool Badges */
.badge-disponible { background-color: var(--success-color) !important; color: white !important; }
.badge-prestada { background-color: var(--info-color) !important; color: #000 !important; }
.badge-danada { background-color: #ffc107 !important; color: #000 !important; }
.badge-extraviada { background-color: var(--danger-color) !important; color: white !important; }

/* Stock Badges */
.badge-stock-normal { background-color: var(--success-color); color: white; }
.badge-stock-bajo { background-color: var(--warning-color); color: #000; }
.badge-stock-agotado { background-color: var(--danger-color); color: white; }

/* Tabs */
.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  overflow-y: auto;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay .modal {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-hover);
  width: 100%;
  max-width: 600px;
  transform: scale(0.95) translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  margin-top: 2rem;
  margin-bottom: 2rem;
  opacity: 0;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-close:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 1.5rem;
}

/* Grids for cards */
.grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Dashboard specific grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr); /* 2x2 requested by user */
  }
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 576px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Detail view styling */
.detail-item {
  margin-bottom: 0.75rem;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: block;
}

.detail-value {
  font-size: 1rem;
  color: var(--text-primary);
}

/* Search bar big */
.search-container {
  margin-bottom: 1.5rem;
}

.search-input {
  font-size: 1.1rem;
  padding: 1rem;
  border-radius: 2rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Smart Search / Integrated Selector Styles */
.module-card {
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background: #fff;
    overflow: hidden;
}

.module-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
    background: rgba(169, 55, 32, 0.01);
}

.smart-search-container {
    position: relative;
    width: 100%;
}

@keyframes fadeInInline {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid-cards.mt-3 {
    animation: fadeInInline 0.3s ease-out;
}

/* ─── Responsive enhancements (see responsive.css for full layer) ─── */
@media (max-width: 991.98px) {
  .navbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
  }
}

.modal-overlay {
  align-items: flex-start;
  padding: 1rem;
}

@media (max-width: 575.98px) {
  .modal {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    max-height: 100dvh;
  }

  .modal-header,
  .modal-body {
    padding: 1rem 1.25rem;
  }
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.part-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  word-break: break-word;
}

@media (min-width: 768px) {
  .part-number {
    font-size: 1.25rem;
  }
}

