/* Table Controls (Filter Row) */
.table-controls {
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.table-filter-label {
  font-weight: 500;
  font-size: var(--font-size-btn);
  margin: 0;
  padding: 0;
  line-height: 1.2;
}
/* Modular Dropdown (Select) Styles */
select, .dropdown, .dropdown-select {
  background: #fff;
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.7em 2.2em 0.7em 1em;
  font-size: var(--font-size-btn);
  appearance: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 2px rgba(30,40,90,0.03);
  cursor: pointer;
  min-width: 120px;
}
select:focus, .dropdown:focus, .dropdown-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(214,23,39,0.08);
}
select:disabled, .dropdown:disabled, .dropdown-select:disabled {
  background: var(--brand-grey-lightest);
  color: var(--brand-grey-lighter);
  cursor: not-allowed;
}
/* Optional: custom arrow for select */
select {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23484848" height="16" viewBox="0 0 20 20" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 7.293a1 1 0 011.414 0L10 8.586l1.293-1.293a1 1 0 111.414 1.414l-2 2a1 1 0 01-1.414 0l-2-2a1 1 0 010-1.414z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.9em center;
  background-size: 1em;
}
/* Data Table Styles */
.data-table {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 12px rgba(30,40,90,0.07);
  margin-bottom: 2em;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2em 1.5em 1em 1.5em;
  border-bottom: 1px solid var(--border-color);
  background: #fafbfc;
}
.table-header h2 {
  margin: 0;
  font-size: var(--font-size-header);
  display: flex;
  align-items: center;
}
.table-scroll {
  overflow-x: auto;
}
.data-table table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  table-layout: fixed;
}
/* Audit logs table needs auto layout to respect min-width on columns */
.section .data-table table {
  table-layout: auto;
}
.data-table th, .data-table td {
  padding: 0.85em 1em;
  text-align: left;
  font-size: var(--font-size-table);
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: var(--text-primary);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: #f9fafb;
}
/* ===== BUTTON STYLES ===== */
/* All buttons use these centralized styles for site-wide consistency */

.btn,
.button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.7em 1.1em;
  font-size: var(--font-size-btn);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  height: 2.6em;
  min-height: 2.6em;
  box-sizing: border-box;
}

/* Primary Button - Red with bold text, hover to lighter red */
.btn-primary,
.btn {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover:not(:disabled),
.btn:hover:not(:disabled),
.btn:focus-visible:not(:disabled),
.button:hover:not(:disabled) {
  background: var(--primary-light);
}

/* Secondary Button - Grey, hover to lighter grey */
.btn-secondary {
  background: #d0d0d0;
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:focus-visible:not(:disabled) {
  background: #b8b8b8;
}

/* Small Button Variant */
.btn-small {
  font-size: var(--font-size-btn-sm);
  padding: 0.5em 0.9em;
  height: 2.4em;
  min-height: 2.4em;
}

/* Warning Button (inherits primary styling) */
.btn-warning {
  background: var(--warning-color);
  color: #fff;
}

.btn-warning:hover:not(:disabled) {
  background: var(--primary-light);
}

/* Disabled State - All buttons */
.btn:disabled,
.btn[disabled],
.button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-warning:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Back Button - Special case for sidebar back buttons */
.location-back-btn {
  background: var(--primary-color);
  color: #fff;
}

.location-back-btn:hover,
.location-back-btn:focus-visible {
  background: var(--primary-light);
}

/* ===== HEADING STYLES ===== */
/* Centralized heading styles for site-wide consistency */

h1 {
  font-size: 2em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1em 0;
}

h2 {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1em 0;
}

h3 {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.8em 0;
}

h4 {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.7em 0;
}

h5 {
  font-size: 1em;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.6em 0;
}

h6 {
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.5em 0;
}

/* ===== FORM CONTROLS ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 0.85em 1em;
  font-size: var(--font-size-base);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  background: #fff;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  box-sizing: border-box;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(214,23,39,0.08);
}
label {
  display: block;
  margin-bottom: 0.45em;
  font-weight: 500;
  font-size: var(--font-size-btn);
  color: var(--text-primary);
}
/* Reusable component styles */
.button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5em 1.2em;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.button:hover {
  background: var(--primary-light);
}
.badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-error { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fff3cd; color: #856404; }
.audit-logs-heading {
  color: var(--primary-color, #d61727);
  font-size: 1.3em;
  font-weight: bold;
  margin: 0;
  display: flex;
  align-items: center;
}
.audit-logs-heading .fa-shield-alt {
  color: #10b981;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* ===== SEARCH FORM BASE STYLES ===== */
/* Shared pattern used by access-codes, users, and locations search forms */
.search-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5em;
}
.search-header-row h2,
.search-header-row h3 {
  margin: 0;
  flex: 1;
}
/* Standard form for search functionality with 2-column grid layout */
.access-code-search-form,
.user-search-form,
.location-search-form {
  background: #fff;
  padding: 1.5em;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 2em;
}

/* ===== FORM LAYOUT UTILITY CLASSES ===== */
/* Reusable flex utilities for form layouts */

.form-group-flex {
  flex: 1;
}

.form-group-min-width-150 {
  min-width: 150px;
}

.form-group-min-width-200 {
  min-width: 200px;
}

.form-group-min-width-250 {
  min-width: 250px;
}

.form-row-end {
  justify-content: flex-end;
}

.form-row-gap {
  margin-top: 0.7em;
}

.form-group-column-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7em;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
}
