:root {
  --primary: #c92a2a;
  --primary-hover: #b02525;
  --primary-light: #ffe3e3;
  --secondary: #495057;
  --secondary-hover: #343a40;
  --bg-app: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --border-light: #e9ecef;
  --success: #2b8a3e;
  --success-light: #ebfbee;
  --warning: #f08c00;
  --danger: #e03131;
  --danger-light: #ffe3e3;
  --info: #1c7ed6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Connection & Protocol Banner */
.connection-banner {
  background-color: #fff3bf;
  border-bottom: 1px solid #fcc419;
  color: #8c5800;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 40;
}

.connection-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.connection-banner .banner-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.connection-banner a {
  color: #c92a2a;
  font-weight: 700;
  text-decoration: underline;
}

.connection-banner code {
  background: rgba(0, 0, 0, 0.07);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
}

/* Header */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  background: linear-gradient(135deg, #e03131, #f76707);
  color: #ffffff;
  padding: 0.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(224, 49, 49, 0.3);
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.brand .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(201, 42, 42, 0.3);
}

.btn-secondary {
  background-color: #f1f3f5;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #e9ecef;
}

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

.btn-outline:hover {
  background-color: #f1f3f5;
  border-color: #ced4da;
}

.btn-danger-outline {
  background-color: transparent;
  color: var(--danger);
  border-color: #ffc9c9;
}

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

.btn-micro {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.btn-micro:hover {
  background-color: var(--primary-light);
  text-decoration: underline;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Dropdown Menu */
.dropdown-menu-wrapper {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  min-width: 190px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  z-index: 100;
  overflow: hidden;
}

.dropdown-menu-wrapper:hover .dropdown-content,
.dropdown-menu-wrapper:focus-within .dropdown-content {
  display: block;
}

.dropdown-content a,
.dropdown-content button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-content a:hover,
.dropdown-content button:hover {
  background-color: #f1f3f5;
  color: var(--primary);
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

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

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Filters Card */
.filters-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.filters-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.span-2 {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .span-2 {
    grid-column: span 1;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #343a40;
}

.form-group label.required::after {
  content: " *";
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background-color: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.15);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  padding-left: 2.35rem;
}

/* Table Section */
.table-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.table-header-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.info-tag {
  font-size: 0.75rem;
  background-color: #e9ecef;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.table-container {
  overflow-x: auto;
  position: relative;
  min-height: 250px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background-color: #f8f9fa;
  color: #495057;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.text-right {
  text-align: right;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-fire {
  background: linear-gradient(135deg, #c92a2a, #e03131);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(201, 42, 42, 0.2);
}

.badge-system {
  background-color: #e7f5ff;
  color: #1971c2;
  font-weight: 500;
}

.badge-product {
  background-color: #f3f0ff;
  color: #6741d9;
  font-weight: 500;
}

.manufacturer-name {
  font-weight: 700;
  color: #212529;
}

.report-code {
  font-family: monospace;
  font-size: 0.825rem;
  background-color: #f1f3f5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #343a40;
}

.norm-tag {
  color: #495057;
  font-weight: 500;
}

.app-desc-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Action Buttons in Table */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #495057;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background-color: #f1f3f5;
  color: var(--primary);
  border-color: #ced4da;
}

.btn-icon.delete:hover {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: #ffc9c9;
}

/* Empty State */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* Modals */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 10px 10px -5px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-dialog.modal-lg {
  max-width: 800px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}

.modal-close:hover {
  color: var(--text-main);
  background-color: #f1f3f5;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-intro {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: #f8f9fa;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Category Management Tabs & Lists */
.categories-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

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

.tab-pane {
  display: none;
}

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

.add-category-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.add-category-bar input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.category-list-wrapper {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.category-list {
  list-style: none;
}

.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}

.category-list li:last-child {
  border-bottom: none;
}

.category-list li:hover {
  background-color: #f8f9fa;
}

/* Detail View */
.detail-item {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.detail-value {
  font-size: 0.95rem;
  color: #1a1a1a;
  font-weight: 500;
}

.detail-value.highlight {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: #343a40;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastSlideIn 0.25s ease-out;
  max-width: 350px;
}

.toast.toast-success {
  background: var(--success);
}

.toast.toast-error {
  background: var(--danger);
}

.toast.toast-info {
  background: var(--info);
}

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

/* Auth Badges and Controls */
.auth-controls {
  display: flex;
  align-items: center;
}

.auth-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-admin-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  border-color: #b2f2bb;
  background-color: #f4fbf6;
  color: #2b8a3e;
}

.btn-admin-user:hover {
  background-color: #ebfbee;
  border-color: #8ce99a;
  color: #237032;
}

.admin-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #40c057;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(64, 192, 87, 0.25);
}

.dropdown-content-right {
  right: 0;
  left: auto;
}

.dropdown-user-header {
  padding: 0.65rem 1rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.user-role-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2b8a3e;
}

.user-status-text {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.dropdown-btn-danger {
  color: var(--danger) !important;
}

.dropdown-btn-danger:hover {
  background-color: var(--danger-light) !important;
  color: var(--danger-hover) !important;
}

.dropdown-content a,
.dropdown-content button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.775rem;
}

.btn-danger-outline {
  border-color: #ffc9c9;
  color: var(--danger);
  background-color: transparent;
}

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

.badge-guest {
  background-color: #e9ecef;
  color: #495057;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 20px;
}

.badge-admin {
  background-color: #ebfbee;
  color: #2b8a3e;
  border: 1px solid #b2f2bb;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-sm {
  max-width: 420px;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-hint code {
  background: #f1f3f5;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--primary);
  font-weight: 600;
}

/* File Upload & Dropzone */
.attachment-upload-section {
  background: #fdfdfd;
  border: 1px dashed #ced4da;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.attachments-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
}

.attachments-header-title h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.section-help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.file-dropzone {
  border: 2px dashed #adb5bd;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: var(--transition);
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.hidden-file-input {
  display: none;
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.dropzone-text {
  font-size: 0.875rem;
  color: #343a40;
  margin-bottom: 0.25rem;
}

.dropzone-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Attachments preview list in form */
.attachments-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.attachment-preview-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.attachment-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background-color: #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.attachment-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.attachment-preview-info {
  flex-grow: 1;
  min-width: 0;
}

.attachment-preview-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-preview-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-remove-attachment {
  background: #f1f3f5;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-remove-attachment:hover {
  background: var(--danger-light);
}

/* Attachments badges in table */
.attachment-badges-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.badge-file-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}

.badge-file-img {
  background-color: #e7f5ff;
  color: #1971c2;
  border: 1px solid #a5d8ff;
}

.badge-file-pdf {
  background-color: #fff5f5;
  color: #e03131;
  border: 1px solid #ffc9c9;
}

.badge-no-files {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Detail Modal Enhanced Styles */
.detail-header-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin: 1.25rem 0 0.65rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.detail-image-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.detail-image-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.detail-image-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.detail-image-card-caption {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fafafa;
  border-top: 1px solid var(--border-light);
}

.detail-pdf-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.detail-pdf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff5f5;
  border: 1px solid #ffe3e3;
  border-radius: var(--radius);
  gap: 1rem;
}

.detail-pdf-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.detail-pdf-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.detail-pdf-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #c92a2a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-pdf-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Lightbox Modal */
.lightbox-backdrop {
  z-index: 1500;
  background-color: rgba(0, 0, 0, 0.85);
}

.lightbox-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.2rem;
  cursor: pointer;
}

.lightbox-image-wrapper img {
  max-width: 88vw;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: block;
}

.lightbox-caption {
  color: #ffffff;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* Print Mode */
@media print {
  .app-header,
  .filters-card,
  .stats-grid,
  .header-actions,
  .action-buttons,
  .btn,
  .modal-close,
  .modal-footer {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .main-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .table-section {
    border: none;
    box-shadow: none;
  }

  .modal-backdrop.open {
    position: static;
    background: none;
    padding: 0;
  }

  .modal-dialog {
    box-shadow: none;
    border: 1px solid #ccc;
    max-width: 100%;
  }
}
