* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  /* Use only the background image so it's fully visible */
  background: url("bg.jpg") center / cover fixed no-repeat;
  background-color: #000; /* fallback if image missing */
  background-attachment: fixed;
  min-height: 100vh;
  color: #0b1220;
}

/* =====================
   LOGO
===================== */
.logo-wrapper {
  text-align: center;
  padding: 40px 0 20px;
}

.logo {
  max-width: 200px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

/* =====================
   CARD LAYOUT (dark green background for readability)
===================== */
.card {
  max-width: 1400px;
  margin: 20px auto 60px;
  background: rgba(13, 36, 23, 0.80);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(8, 10, 20, 0.25);
  backdrop-filter: blur(12px) saturate(130%);
  color: #f5f5f5;
}

.hidden {
  display: none !important;
}

/* =====================
   TYPOGRAPHY
===================== */
h1, h2, h3, h4 {
  margin: 0 0 16px 0;
  font-weight: 600;
}

h2 {
  font-size: 28px;
  color: #f5f5f5;
}

h3 {
  font-size: 20px;
  color: #e8e8e8;
}

h4 {
  font-size: 16px;
  color: #d8d8d8;
  margin-bottom: 12px;
}

p {
  color: #e0e0e0;
}

/* =====================
   FORM ELEMENTS
===================== */
input, select, textarea, button {
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  transition: all 0.18s ease;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08);
  background: rgba(255, 255, 255, 0.12);
}

input::placeholder, textarea::placeholder {
  color: #888;
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%2310b981" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select option {
  background-color: #0d2417;
  color: #f5f5f5;
  padding: 10px;
}

select:invalid {
  color: #9ca3af;
}

select option[value=""] {
  color: #9ca3af;
}

.form-group {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.form-row input,
.form-row select {
  margin-top: 0;
}

button {
  width: 100%;
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

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

.primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
}

.primary:hover:not(:disabled) {
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

.secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.25);
}

.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

.warning {
  background: #f59e0b;
  color: #fff;
  border: none;
}

.warning:hover:not(:disabled) {
  background: #d97706;
}

.success {
  background: #10b981;
  color: #fff;
  border: none;
}

.success:hover:not(:disabled) {
  background: #059669;
}

.danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.danger:hover:not(:disabled) {
  background: #dc2626;
}

.small {
  width: auto;
  margin: 4px 4px 4px 0;
  padding: 8px 14px;
  font-size: 13px;
}

/* =====================
   ADMIN LAYOUT
===================== */
.admin-header,
.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
}

.admin-header h2,
.user-header h2 {
  margin: 0;
  flex-shrink: 0;
}

.global-search-input {
  flex: 1;
  min-width: 250px;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  color: #fff !important;
  font-size: 14px !important;
  transition: all 0.3s ease;
  margin: 0 !important;
}

.global-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.global-search-input:focus {
  outline: none !important;
  border-color: #10b981 !important;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

.admin-header button,
.user-header button {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

/* =====================
   TABS
===================== */
.admin-tabs,
.filter-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  flex: 1;
  min-width: 120px;
  text-align: center;
  font-weight: 600;
  color: #f5f5f5;
  transition: all 0.18s ease;
}

.tab:hover {
  background: rgba(255,255,255,0.20);
  color: #fff;
  transform: translateY(-2px);
}

.tab.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: #10b981;
}

.admin-content {
  background: rgba(13, 36, 23, 0.35);
  border-radius: 12px;
  padding: 24px;
  min-height: 500px;
}

.tab-view {
  animation: fadeIn 0.3s ease;
}

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

/* =====================
   STATS CARD
===================== */
.stats-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.stats-card span {
  display: block;
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stats-card strong {
  display: block;
  font-size: 20px;
  color: #10b981;
  margin-top: 4px;
}

.text-success {
  color: #10b981;
}

.text-warning {
  color: #f59e0b;
}

.text-danger {
  color: #ef4444;
}

/* =====================
   TOOL CARDS
===================== */
.category-section {
  margin-bottom: 28px;
}

.tool-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  color: #f5f5f5;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tool-card:hover {
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card.available {
  border-left: 4px solid #10b981;
}

.tool-card.borrowed {
  border-left: 4px solid #f59e0b;
  background: rgba(255, 255, 255, 0.06);
}

.tool-card.tool-broken {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.tool-card.tool-broken:hover {
  border-color: #ef4444;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.tool-card.tool-broken::before {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.tool-card.tool-service {
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

.tool-card.tool-service:hover {
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.tool-card.tool-service::before {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}

.tool-header strong {
  font-size: 16px;
  flex: 1;
}

.tool-name {
  font-size: 16px;
  flex: 1;
}

.tool-desc.muted {
  color: #a0a0a0;
}

.icon-btn.edit-tool-btn {
  background: none;
  border: none;
  color: #4caf50;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.icon-btn.edit-tool-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.available {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.status-badge.borrowed {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.status-badge.works {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.status-badge.service {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.status-badge.broken {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);

}

.tool-status-notes {
  background: rgba(245, 158, 11, 0.15);
  border-left: 3px solid #f59e0b;
  padding: 10px 12px;
  margin: 10px 0;
  border-radius: 6px;
  font-size: 13px;
  color: #fcd34d;
  line-height: 1.5;
}

.tool-card.tool-broken .tool-status-notes {
  background: rgba(239, 68, 68, 0.15);
  border-left-color: #ef4444;
  color: #fca5a5;
}

.tool-desc {
  font-size: 13px;
  color: #c8c8c8;
  margin: 8px 0;
  font-style: italic;
}

.tool-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.tool-actions button {
  flex: 1;
  min-width: 140px;
}

/* =====================
   TOOLS SEARCH & FILTERS
===================== */
.tools-filters {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.search-input {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  color: #fff !important;
  font-size: 15px !important;
  flex: 1;
  min-width: 200px;
  transition: all 0.3s ease;
  display: block !important;
  margin: 0 !important;
}

.search-input:focus {
  outline: none !important;
  border-color: #10b981 !important;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.filter-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-select {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
  display: block !important;
  margin: 0 !important;
}

.filter-select:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background: rgba(0, 0, 0, 0.35) !important;
}

.filter-select:focus {
  outline: none !important;
  border-color: #10b981 !important;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

.filter-select option {
  background: #0d241a;
  color: #fff;
  padding: 8px;
}

/* Tools grid for admin Verktyg tab */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

/* Report badge positioned */
.tool-card {
  position: relative;
}

.report-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f5f5f5;
}

.report-badge .small {
  padding: 6px 8px;
  font-size: 12px;
}

.report-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #b0b0b0;
}

/* =====================
   ITEM CARDS
===================== */
.item-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
  color: #f5f5f5;
}

.item-card:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.12);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.item-header strong {
  font-size: 15px;
  color: #f5f5f5;
}

.meta {
  font-size: 13px;
  color: #b0b0b0;
  margin: 6px 0;
}

.note {
  font-size: 13px;
  background: rgba(16, 185, 129, 0.15);
  padding: 10px 12px;
  border-left: 3px solid #10b981;
  margin-top: 8px;
  border-radius: 4px;
  color: #d8d8d8;
}

.date-badge {
  font-size: 12px;
  background: rgba(16, 185, 129, 0.25);
  color: #86efac;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.role-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.role-admin {
  background: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.role-user {
  background: rgba(6, 182, 212, 0.25);
  color: #67e8f9;
}

.item-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* User management - stats and grouping */
.users-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.users-stats .stat-box {
  background: rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.users-stats .stat-box strong {
  display: block;
  font-size: 28px;
  color: #10b981;
  margin-top: 8px;
}

.users-stats .stat-box span {
  display: block;
  font-size: 12px;
  color: #b0b0b0;
  margin-top: 4px;
}

.user-role-section {
  margin-bottom: 32px;
}

.user-role-section h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 14px;
  color: #f5f5f5;
}

.user-role-section h4 .count {
  display: inline-block;
  background: #10b981;
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: auto;
}

.user-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.user-item-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  transition: all 0.3s ease;
  color: #f5f5f5;
}

.user-item-card:hover {
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.user-item-card.admin {
  border-left: 4px solid #f59e0b;
  background: rgba(255, 255, 255, 0.06);
}

.user-item-card.user {
  border-left: 4px solid #10b981;
  background: rgba(255, 255, 255, 0.08);
}

.user-item-card .item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.user-item-card .status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 8px;
}

.user-item-card .status-indicator.active {
  background: #10b981;
}

.user-item-card .status-indicator.inactive {
  background: #ef4444;
}

.user-item-card .meta {
  font-size: 12px;
  color: #a0a0a0;
  margin: 8px 0;
}

.user-item-card .meta code {
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #86efac;
}

/* Users search and filter */
.users-filter {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  margin-top: 0;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
}

.search-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  background: rgba(255, 255, 255, 0.12);
}

.search-input::placeholder {
  color: #888;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  color: #d0d0d0;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #10b981;
}

.chip.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: #10b981;
}

.export-section-secondary {
  background: rgba(255, 255, 255, 0.06);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.export-title {
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 14px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.export-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.export-btn {
  padding: 11px 14px;
  border: 1.5px solid #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #86efac;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.3s ease;
  width: 100%;
}

.export-btn:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.export-btn:active {
  transform: translateY(0);
}

/* Filter buttons */
.filter-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-buttons .small {
  margin: 0;
  padding: 9px 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
  min-width: 100px;
}

.filter-buttons .small:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #10b981;
}

.filter-buttons .status-works {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: #10b981;
}

.filter-buttons .status-service {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: #f59e0b;
}

.filter-buttons .status-broken {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: #ef4444;
}

/* Loan history cards */
.item-card.loan-history {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  color: #f5f5f5;
}

.item-card.loan-history:hover {
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.item-card.loan-history .category-meta {
  font-size: 12px;
  color: #888;
  margin: 4px 0 0 0;
  font-style: italic;
}

/* =====================
   STATES
===================== */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: #b8b8b8;
  font-size: 16px;
}

.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
  padding: 14px;
  border-radius: 8px;
  margin: 10px 0;
  border-left: 4px solid #ff6b6b;
}

/* =====================
   NOTIFICATIONS
===================== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-weight: 500;
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.notification.success {
  background: #10b981;
}

.notification.error {
  background: #ef4444;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes highlightFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    background-color: rgba(16, 185, 129, 0.15);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(16, 185, 129, 0.3);
    background-color: rgba(16, 185, 129, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    background-color: transparent;
  }
}

.highlight-flash {
  animation: highlightFlash 2s ease-out;
}

/* =====================
   RESPONSIVE - MOBILE FIRST (< 640px)
===================== */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .card {
    max-width: 100%;
    margin: 10px;
    padding: 16px;
    border-radius: 12px;
  }

  .logo {
    max-width: 150px;
  }

  .logo-wrapper {
    padding: 20px 0 12px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 16px;
  }

  h4 {
    font-size: 14px;
  }

  p {
    font-size: 13px;
  }

  input, select, textarea, button {
    padding: 9px 10px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px; /* Touch-friendly */
  }

  .small {
    padding: 6px 10px;
    font-size: 12px;
    margin: 4px 2px 4px 0;
  }

  .admin-header,
  .user-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
  }

  .admin-header button,
  .user-header button {
    align-self: stretch;
    width: 100%;
  }

  .admin-tabs,
  .filter-buttons {
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .tab {
    flex: 1;
    min-width: 60px;
    font-size: 11px;
    padding: 6px 8px;
    margin: 2px;
  }

  .form-group {
    gap: 10px;
    margin-bottom: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .form-row input {
    margin-top: 0;
  }

  .admin-content {
    padding: 12px;
    min-height: 300px;
  }

  .item-card {
    padding: 12px !important;
  }

  .item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .item-header strong {
    font-size: 13px;
  }

  .meta {
    font-size: 12px;
  }

  .tool-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tool-actions {
    flex-direction: column;
    gap: 6px;
  }

  .tool-actions button {
    width: 100%;
  }

  .tools-filters {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .search-input {
    min-width: auto;
    width: 100%;
  }

  .filter-controls {
    width: 100%;
  }

  .filter-select {
    flex: 1;
    min-width: 100%;
  }

  .stats-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .stats-card span {
    padding: 10px;
    font-size: 12px;
  }

  .stats-card strong {
    font-size: 16px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-filter {
    flex-direction: column;
    gap: 8px;
  }

  .projects-filter input {
    max-width: 100% !important;
  }

  .sort-controls {
    width: 100%;
    justify-content: space-between;
  }

  .sort-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 11px;
    margin: 0 2px;
  }

  .project-card {
    padding: 14px;
  }

  .project-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-value {
    font-size: 14px;
  }

  .modal {
    margin: 10px;
    max-width: 90vw;
    padding: 16px;
  }

  .modal h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .modal-buttons button {
    width: 100%;
  }

  .search-input {
    max-width: 100% !important;
    padding: 8px 10px;
    font-size: 14px;
  }

  .users-filter {
    flex-direction: column;
    gap: 8px;
  }

  .filter-chips {
    flex-wrap: wrap;
  }

  .chip {
    padding: 6px 10px;
    font-size: 12px;
  }

  table {
    font-size: 12px !important;
  }

  th, td {
    padding: 6px 4px !important;
  }

  .user-role-section h4 {
    font-size: 14px;
  }

  .user-card-grid {
    grid-template-columns: 1fr;
  }

  /* User section responsive */
  .available-tool-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .tool-info h4 {
    font-size: 16px;
  }

  .tool-category,
  .tool-description {
    font-size: 12px;
  }

  .tool-action {
    justify-content: stretch;
  }

  .borrow-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
  }

  .loan-card {
    padding: 14px;
  }

  .loan-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .loan-info h4 {
    font-size: 16px;
  }

  .loan-project,
  .loan-duration {
    font-size: 13px;
  }

  .loan-action {
    justify-content: stretch;
  }

  .return-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* =====================
   RESPONSIVE - TABLET (640px - 1024px)
===================== */
@media (min-width: 641px) and (max-width: 1024px) {
  .card {
    max-width: 95%;
    margin: 12px auto 40px;
    padding: 24px;
  }

  .logo {
    max-width: 160px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 18px;
  }

  input, select, button {
    font-size: 15px;
  }

  .admin-tabs,
  .filter-buttons {
    gap: 6px;
  }

  .tab {
    flex: 1;
    min-width: 100px;
    font-size: 14px;
    padding: 8px 12px;
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-header,
  .user-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header h2 {
    width: 100%;
    text-align: left;
  }

  .global-search-input {
    min-width: auto !important;
    width: 100%;
    flex: none;
    order: -1;
  }

  .admin-header button,
  .user-header button {
    align-self: flex-end;
  }

  .stats-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .project-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .user-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .modal {
    max-width: 80vw;
  }

  table {
    font-size: 13px;
  }
}

/* =====================
   RESPONSIVE - DESKTOP (1025px+)
===================== */
@media (min-width: 1025px) {
  .card {
    max-width: 1100px;
    margin: 20px auto 60px;
    padding: 30px;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .user-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .stats-card {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .modal {
    max-width: 70vw;
  }
}

/* =====================
   MODALS
===================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: rgba(13, 36, 23, 0.98);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}

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

.modal h2 {
  margin-top: 0;
  color: #f5f5f5;
}

.modal p {
  color: #d0d0d0;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.modal-buttons {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
}

.modal-buttons.full {
  grid-template-columns: 1fr;
}

.modal-buttons button {
  margin: 0;
}

/* =====================
   RETURN TOOL MODAL
===================== */
.return-options {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.return-option {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
}

.return-option:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  transform: translateX(4px);
}

.return-option.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  box-shadow: inset 0 0 0 2px #10b981;
}

.return-option h4 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: #f5f5f5;
}

.return-option p {
  margin: 0;
  font-size: 13px;
  color: #b0b0b0;
}

.return-option.works h4 {
  color: #10b981;
}

.return-option.service h4 {
  color: #f59e0b;
}

.return-option.broken h4 {
  color: #ef4444;
}

textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 90px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  color: #f5f5f5;
}

textarea::placeholder {
  color: #fbbf24;
  font-style: italic;
}

textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

/* =====================
   LOAN SECTION
===================== */
#userToolsView,
#userCarsView {
  background: rgba(13, 36, 23, 0.35);
  border-radius: 12px;
  padding: 24px;
}

.user-loans-container {
  margin-top: 20px;
}

.loan-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 2px solid rgba(245, 158, 11, 0.5);
  transition: all 0.3s ease;
  color: #f5f5f5;
}

.loan-card:hover {
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: #f59e0b;
}

.loan-card.borrowed {
  border-color: rgba(245, 158, 11, 0.5);
}

.loan-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.loan-info {
  min-width: 0;
}

.loan-info h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #f5f5f5;
  font-weight: 600;
}

.loan-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loan-project,
.loan-duration {
  font-size: 14px;
  color: #b0b0b0;
  display: block;
}

.loan-action {
  display: flex;
  align-items: center;
}

.return-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.return-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.return-btn:active {
  transform: translateY(0);
}

/* =====================
   CATEGORY GROUPS
===================== */
.category-group {
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.category-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.category-toggle {
  font-size: 12px;
  color: #a0aec0;
  transition: transform 0.2s ease;
  display: inline-block;
}

.category-group.collapsed .category-toggle {
  transform: rotate(-90deg);
}

.category-group.collapsed .category-tools {
  display: none;
}

.category-name {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

.category-count {
  font-size: 12px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.category-tools {
  padding: 12px;
}

/* =====================
   AVAILABLE TOOLS
===================== */
.available-tool-card {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(16, 185, 129, 0.5);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  transition: all 0.3s ease;
  color: #f5f5f5;
}

.category-tools .available-tool-card:last-child {
  margin-bottom: 0;
}

.available-tool-card:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: #10b981;
}

.tool-info {
  min-width: 0;
}

.tool-info h4 {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: #f5f5f5;
  font-weight: 600;
}

.tool-category {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #a0a0a0;
  display: block;
}

.tool-description {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: #c0c0c0;
  font-style: italic;
  line-height: 1.4;
}

.tool-action {
  display: flex;
  align-items: center;
}

.borrow-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.borrow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.borrow-btn:active {
  transform: translateY(0);
}

.borrow-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =====================
   TEAM LOANS TABLE
===================== */
.user-team-loans-container {
  margin-top: 32px;
}

.team-loans-table {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.team-loans-header {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.2fr 0.8fr;
  gap: 16px;
  background: rgba(59, 130, 246, 0.15);
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  padding: 14px 16px;
  font-weight: 600;
  color: #60a5fa;
  font-size: 13px;
}

.team-loans-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.2fr 0.8fr;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
  transition: all 0.2s ease;
}

.team-loans-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.team-loans-row.overdue {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.team-loans-col-user {
  color: #f5f5f5;
  font-weight: 500;
  font-size: 14px;
}

.team-loans-col-tool {
  color: #a0aec0;
  font-size: 14px;
}

.team-loans-col-date {
  color: #a0aec0;
  font-size: 13px;
}

.team-loans-col-days {
  text-align: center;
}

@media (max-width: 640px) {
  .team-loans-header,
  .team-loans-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .team-loans-col-date,
  .team-loans-col-tool {
    font-size: 12px;
    grid-column: 1 / -1;
  }

  .team-loans-col-days {
    grid-column: 2;
    justify-self: end;
  }
}

/* =====================
   EXPORT OPTIONS
===================== */
.export-section {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.export-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #f5f5f5;
}

.export-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.export-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #d0d0d0;
}

.export-filters input[type="checkbox"] {
  cursor: pointer;
  width: auto;
  margin: 0;
}

.export-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.loan-history {
  border-left: 4px solid #10b981;
}

.loan-history .item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.category-meta {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #999;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.filter-buttons .small {
  margin: 0;
}

/* =====================
   PROJECTS TAB STYLING
===================== */
.projects-filter {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-input {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sort-controls {
  display: flex;
  gap: 6px;
}

.sort-btn {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  color: #d0d0d0;
}

.sort-btn:hover {
  border-color: #10b981;
  color: #86efac;
  background: rgba(16, 185, 129, 0.15);
}

.sort-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: #10b981;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  color: #f5f5f5;
}

.project-card:hover {
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
  transform: translateY(-4px);
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.12);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.project-header h4 {
  margin: 0;
  font-size: 16px;
  color: #f5f5f5;
  flex: 1;
  word-break: break-word;
  font-weight: 600;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.project-description {
  font-size: 13px;
  color: #b0b0b0;
  margin-bottom: 14px;
  line-height: 1.4;
}

.project-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 6px;
}

.stat-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #6ee7b7;
}

.project-reports {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.report-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.report-tag.service {
  background: rgba(255, 193, 7, 0.1);
  color: #f57c00;
}

.report-tag.broken {
  background: rgba(244, 67, 54, 0.1);
  color: #d32f2f;
}

.project-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.project-actions .small {
  flex: 1;
}

.project-actions .small.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.small.disabled:hover {
  transform: none;
}

.small.status-works {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
}

.small.status-works:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.small.status-service {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

.small.status-service:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.small.status-broken {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
}

.small.status-broken:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* =====================
   NOTES TAB
===================== */
.note-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  transition: all 0.3s ease;
  color: #f5f5f5;
  border-left: 4px solid #10b981;
}

.note-card:hover {
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.note-header h4 {
  margin: 0 0 8px 0;
  font-size: 17px;
  color: #f5f5f5;
}

.note-category-badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.25);
  color: #86efac;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.note-actions {
  display: flex;
  gap: 6px;
}

.note-content {
  font-size: 14px;
  color: #d0d0d0;
  line-height: 1.6;
  margin: 12px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.note-meta {
  font-size: 12px;
  color: #888;
  margin: 8px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

/* =====================
   DASHBOARD TAB
===================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card.yellow {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
  border-color: rgba(245, 158, 11, 0.5);
}

.stat-card.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
  border-color: rgba(16, 185, 129, 0.5);
}

.stat-card.orange {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(194, 65, 12, 0.1));
  border-color: rgba(249, 115, 22, 0.5);
}

.stat-card.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  border-color: rgba(59, 130, 246, 0.5);
}

.stat-card.purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(126, 34, 206, 0.1));
  border-color: rgba(168, 85, 247, 0.5);
}

.stat-card.teal {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(8, 145, 178, 0.1));
  border-color: rgba(6, 182, 212, 0.5);
}

.stat-icon {
  font-size: 32px;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #f5f5f5;
}

.stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-section {
  margin-bottom: 32px;
}

.dashboard-section h4 {
  font-size: 16px;
  color: #f5f5f5;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-section.critical-alert {
  background: rgba(220, 38, 38, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 20px;
}

.dashboard-section.critical-alert h4 {
  color: #fca5a5;
}

.attention-list,
.borrowed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attention-item.critical {
  background: rgba(220, 38, 38, 0.15);
  border-left-color: #dc2626;
  animation: pulse 2s ease-in-out infinite;
}

.attention-status.critical {
  background: rgba(220, 38, 38, 0.3);
  color: #ff6b6b;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.attention-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 14px;
  transition: all 0.3s ease;
}

.attention-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-left-color: #fbbf24;
}

.attention-tool {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.attention-tool strong {
  color: #f5f5f5;
}

.attention-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.attention-status.service {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.attention-status.broken {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.borrowed-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
}

.borrowed-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(16, 185, 129, 0.5);
}

.borrowed-rank {
  font-size: 18px;
  font-weight: 700;
  color: #10b981;
  min-width: 40px;
  text-align: center;
}

.borrowed-info {
  flex: 1;
}

.borrowed-name {
  font-size: 14px;
  color: #f5f5f5;
  font-weight: 500;
}

.borrowed-count {
  font-size: 12px;
  color: #86efac;
  margin-top: 2px;
}

/* =====================
   USER LOAN STATISTICS
===================== */
.user-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-loan-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.user-loan-stat:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(59, 130, 246, 0.4);
}

.user-name {
  color: #f5f5f5;
  font-weight: 500;
  font-size: 14px;
}

.user-loan-count {
  color: #60a5fa;
  font-weight: 600;
  font-size: 13px;
  background: rgba(59, 130, 246, 0.15);
  padding: 4px 12px;
  border-radius: 6px;
}

/* =====================
   TOOL AVAILABILITY
===================== */
.tool-borrowed {
  font-size: 12px;
  color: #f59e0b;
  margin-top: 6px;
}

.tool-available {
  font-size: 12px;
  color: #10b981;
  margin-top: 6px;
}

/* =====================
   ACTIVE LOANS TAB
===================== */
.loans-table {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.loans-header {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1.5fr 0.8fr;
  gap: 16px;
  background: rgba(16, 185, 129, 0.15);
  border-bottom: 2px solid rgba(16, 185, 129, 0.3);
  padding: 14px 16px;
  font-weight: 600;
  color: #34d399;
  font-size: 13px;
}

.loans-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1.5fr 0.8fr;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
  transition: all 0.2s ease;
}

.loans-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.loans-row.overdue {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.loans-col-tool {
  color: #f5f5f5;
  font-weight: 500;
}

.loans-col-user {
  color: #a0aec0;
  font-size: 14px;
}

.loans-col-date {
  color: #a0aec0;
  font-size: 13px;
}

.loans-col-project {
  color: #60a5fa;
  font-size: 13px;
}

.days-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.days-badge.normal {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.days-badge.warning {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.days-badge.critical {
  background: rgba(220, 38, 38, 0.3);
  color: #ff6b6b;
  border: 1px solid rgba(239, 68, 68, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@media (max-width: 1024px) {
  .loans-header,
  .loans-row {
    grid-template-columns: 1.5fr 1.5fr 1fr 1fr 0.8fr;
  }
}

@media (max-width: 640px) {
  .loans-header,
  .loans-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .loans-col-date,
  .loans-col-project {
    font-size: 12px;
    grid-column: 1;
  }

  .loans-col-project::before {
    content: "📋 ";
  }

  .loans-col-days {
    grid-column: 2;
    justify-self: end;
  }
}

/* =====================
   SETTINGS TAB
===================== */
.settings-section {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.settings-section h4 {
  font-size: 16px;
  color: #f5f5f5;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-buttons button {
  padding: 12px 20px;
}

input[type="file"] {
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  cursor: pointer;
  transition: all 0.3s ease;
}

input[type="file"]:hover {
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.1);
}

input[type="file"]::file-selector-button {
  padding: 8px 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-right: 12px;
}

/* =====================
   TOAST NOTIFICATIONS
===================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  padding: 16px 20px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
}

.toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-left: 4px solid #34d399;
}

.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border-left: 4px solid #f87171;
}

.toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-left: 4px solid #60a5fa;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    padding: 12px 16px;
  }
}
/* =====================
   MAINTENANCE ALERT BANNER
===================== */
.maintenance-alert-banner {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
  border: 2px solid rgba(254, 202, 202, 0.3);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 0 4px 30px rgba(220, 38, 38, 0.5);
  }
}

.maintenance-alert-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.maintenance-alert-icon {
  font-size: 48px;
  line-height: 1;
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.maintenance-alert-info h3 {
  margin: 0 0 6px 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.maintenance-alert-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 15px;
  font-weight: 500;
}

.btn-manage-maintenance {
  padding: 14px 28px;
  background: #fff;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn-manage-maintenance:hover {
  background: #fef2f2;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-manage-maintenance:active {
  transform: translateY(0);
}

.btn-manage-maintenance .btn-icon {
  font-size: 20px;
}

/* =====================
   MAINTENANCE MODAL
===================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-content {
  background: rgba(13, 36, 23, 0.95);
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.maintenance-tools-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.maintenance-tool-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.maintenance-tool-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.maintenance-tool-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tool-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-title strong {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.tool-category {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
}

.maintenance-status {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-broken {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.status-service {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.maintenance-report-info {
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.report-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.report-value {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  flex: 1;
}

.maintenance-meta {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 500;
}

.maintenance-notes {
  background: rgba(0, 0, 0, 0.3);
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.maintenance-notes strong {
  color: #fbbf24;
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.maintenance-notes p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.maintenance-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-notes-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
}

.admin-notes-input:focus {
  outline: none;
  border-color: #10b981;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.admin-notes-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.maintenance-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-fix, .btn-broken {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 200px;
}

.btn-fix {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-fix:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.btn-broken {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-broken:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

.btn-fix:active, .btn-broken:active {
  transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .maintenance-alert-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .maintenance-alert-icon {
    font-size: 36px;
  }

  .maintenance-alert-info h3 {
    font-size: 18px;
  }

  .btn-manage-maintenance {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .modal-content {
    max-width: 100%;
    margin: 10px;
  }

  .modal-header {
    padding: 20px;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .maintenance-tool-card {
    padding: 16px;
  }

  .report-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .report-value {
    text-align: left;
  }

  .maintenance-buttons {
    flex-direction: column;
  }

  .btn-fix, .btn-broken {
    width: 100%;
    min-width: 0;
  }
}

/* =====================
   SEARCH RESULTS MODAL
===================== */
.search-results-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.search-results-content {
  background: rgba(13, 36, 23, 0.95);
  border-radius: 12px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
  background: rgba(0, 50, 30, 0.5);
}

.search-results-header h2 {
  margin: 0;
  color: #4caf50;
  font-size: 1.5em;
}

.search-results-header button {
  color: #f5f5f5;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.search-results-header button:hover {
  opacity: 1;
}

.search-results-body {
  padding: 20px;
}

.search-result-section {
  margin-bottom: 20px;
}

.search-result-section h3 {
  color: #4caf50;
  margin: 0 0 10px 0;
  font-size: 1em;
}

.search-result-section ul {
  list-style: none;
}

/* =====================
   GLOBAL POLISH
===================== */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(16, 185, 129, 0.35);
  color: #fff;
}

/* Styled scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.35);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.55);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.35) rgba(0, 0, 0, 0.2);
}

/* =====================
   PIN INPUT WRAPPER
===================== */
.pin-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pin-input-wrapper input {
  width: 100%;
  padding-right: 48px;
}

.pin-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 6px !important;
  width: auto !important;
  opacity: 0.6;
  transition: opacity 0.2s;
  box-shadow: none !important;
  margin: 0 !important;
}

.pin-toggle-btn:hover {
  opacity: 1;
  transform: translateY(-50%) !important;
  box-shadow: none !important;
}

.eye-icon {
  font-size: 18px;
  line-height: 1;
}

/* =====================
   SESSION WARNING
===================== */
.session-warning {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-weight: 600;
  font-size: 15px;
  z-index: 10001;
  box-shadow: 0 -4px 20px rgba(245, 158, 11, 0.3);
  animation: slideUpBanner 0.4s ease;
}

.session-warning.hidden {
  display: none;
}

.session-warning button {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.session-warning button:hover {
  background: rgba(255, 255, 255, 0.4);
}

@keyframes slideUpBanner {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =====================
   SCROLL TO TOP BUTTON
===================== */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 0;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.scroll-top-btn:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}

/* =====================
   APP FOOTER
===================== */
.app-footer {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* =====================
   SKELETON LOADING
===================== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-card {
  height: 80px;
  margin-bottom: 12px;
  border-radius: 12px;
}

.skeleton-line {
  height: 16px;
  margin-bottom: 8px;
  width: 60%;
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-line.full {
  width: 100%;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* =====================
   CUSTOM CONFIRM DIALOG
===================== */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.confirm-dialog {
  background: rgba(13, 36, 23, 0.97);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.confirm-dialog h3 {
  margin: 0 0 12px 0;
  color: #f5f5f5;
  font-size: 18px;
}

.confirm-dialog p {
  color: #c0c0c0;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.confirm-actions button {
  padding: 12px 20px;
  font-size: 14px;
}

/* =====================
   FOCUS VISIBLE OUTLINES
===================== */
:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* =====================
   REDUCED MOTION
===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
  padding: 0;
  margin: 0;
}

.search-result-section li {
  padding: 10px 12px;
  background: rgba(76, 175, 80, 0.08);
  border-left: 3px solid rgba(76, 175, 80, 0.3);
  margin-bottom: 8px;
  border-radius: 4px;
  color: #f5f5f5;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95em;
}

.search-result-section li:hover {
  background: rgba(76, 175, 80, 0.15);
  border-left-color: #4caf50;
  transform: translateX(4px);
}

.search-result-section li strong {
  color: #4caf50;
}

@media (max-width: 600px) {
  .search-results-content {
    max-width: 95%;
    max-height: 90vh;
  }

  .search-results-header h2 {
    font-size: 1.2em;
  }

  .search-result-section li {
    font-size: 0.9em;
    padding: 8px 10px;
  }
}

/* =====================
   SEARCH ENHANCEMENTS
===================== */

/* Search suggestions dropdown */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(13, 36, 23, 0.95);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.suggestion-group {
  padding: 8px 0;
  border-bottom: 1px solid rgba(76, 175, 80, 0.1);
}

.suggestion-group:last-child {
  border-bottom: none;
}

.suggestion-item {
  padding: 10px 16px;
  color: #f5f5f5;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.95em;
}

.suggestion-item:hover {
  background: rgba(76, 175, 80, 0.15);
  padding-left: 20px;
}

/* Search result item improvements */
.search-result-item {
  display: block;
  position: relative;
}

.result-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.relevance-score {
  font-size: 0.8em;
  color: #f39c12;
  font-weight: bold;
  white-space: nowrap;
  margin-left: 10px;
}

/* Search highlighting */
mark.search-highlight {
  background: rgba(76, 175, 80, 0.4);
  color: #a8ff60;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Keyboard navigation selection */
.search-result-item.selected {
  background: rgba(76, 175, 80, 0.25);
  border-left-color: #4caf50;
  transform: translateX(6px);
}

.search-result-item.selected strong,
.search-result-item.selected mark.search-highlight {
  color: #a8ff60;
}

/* Search notification toast */
.search-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(76, 175, 80, 0.9);
  color: #0d2417;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideInRight 0.3s ease;
  z-index: 10001;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Search header improvement */
.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.search-results-header > div:first-child {
  flex: 1;
}

/* Better result section styling */
.search-result-section ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.search-result-item small {
  display: block;
  margin: 4px 0 2px 0;
  font-size: 0.85em;
}

.search-result-item div:not(.result-item-header) {
  font-size: 0.85em;
  margin-top: 4px;
  line-height: 1.4;
  color: #d5d5d5;
}

/* Admin header position relative for suggestions */
.admin-header {
  position: relative;
  z-index: 100;
}

#globalSearchInput {
  position: relative;
}

@media (max-width: 600px) {
  .search-notification {
    right: 10px;
    left: 10px;
    bottom: 10px;
  }

  .search-suggestions {
    max-height: 200px;
    font-size: 0.9em;
  }

  .suggestion-item {
    padding: 8px 12px;
  }

  .result-item-header {
    flex-wrap: wrap;
  }

  .relevance-score {
    width: 100%;
    text-align: right;
    margin-left: 0;
    margin-top: 4px;
  }
}

/* =====================
   EDIT TOOL MODAL
===================== */
.edit-tool-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.edit-tool-content {
  background: rgba(13, 36, 23, 0.95);
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(76, 175, 80, 0.3);
  overflow: hidden;
}

.edit-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
  background: rgba(0, 50, 30, 0.5);
}

.edit-tool-header h2 {
  margin: 0;
  color: #4caf50;
  font-size: 1.2em;
}

.edit-tool-header .close-edit-modal {
  background: none;
  border: none;
  color: #f5f5f5;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.8;
}

.edit-tool-header .close-edit-modal:hover {
  opacity: 1;
}

.edit-tool-form {
  padding: 20px;
}

.edit-tool-label {
  display: block;
  color: #4caf50;
  font-weight: 600;
  margin: 10px 0 6px;
  font-size: 0.95em;
}

.edit-tool-input,
.edit-tool-textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  color: #f5f5f5;
  font-family: inherit;
  font-size: 1em;
  transition: all 0.2s ease;
}

.edit-tool-input:focus,
.edit-tool-textarea:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 14px rgba(76, 175, 80, 0.2);
}

.edit-tool-textarea {
  resize: vertical;
  min-height: 120px;
}

.edit-tool-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.edit-tool-actions .primary,
.edit-tool-actions .secondary {
  flex: 1;
}

@media (max-width: 600px) {
  .edit-tool-actions {
    flex-direction: column;
  }
}

/* =====================
   MOBILE OPTIMIZATION
===================== */
@media (max-width: 768px) {
  .card {
    padding: 20px;
    margin: 15px auto 40px;
    max-width: 100%;
  }

  body {
    font-size: 14px;
  }

  h2 {
    font-size: 1.5em;
  }

  h3 {
    font-size: 1.2em;
  }

  h4 {
    font-size: 1em;
  }

  /* Larger buttons for touch */
  button {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .primary, .secondary {
    min-height: 44px;
  }

  /* Search input responsive */
  .search-input {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 8px;
  }

  /* Headers with search/export should stack on mobile */
  div[style*="display: flex"][style*="justify-content: space-between"] {
    flex-direction: column;
    align-items: flex-start !important;
  }

  div[style*="display: flex"][style*="justify-content: space-between"] button,
  div[style*="display: flex"][style*="justify-content: space-between"] input {
    width: 100%;
    margin-top: 8px;
  }

  /* Available tools cards */
  .available-tool-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    margin-bottom: 12px;
  }

  .tool-info {
    margin-bottom: 12px;
  }

  .tool-action {
    display: flex;
    width: 100%;
  }

  .tool-action button {
    width: 100%;
  }

  /* Loan cards responsive */
  .loan-card {
    padding: 12px;
    margin-bottom: 12px;
  }

  .loan-content {
    display: flex;
    flex-direction: column;
  }

  .loan-info {
    margin-bottom: 12px;
  }

  .loan-action {
    width: 100%;
  }

  .loan-action button {
    width: 100%;
  }

  /* Team loans grid */
  .team-loans-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .team-loans-col-tool,
  .team-loans-col-project,
  .team-loans-col-user,
  .team-loans-col-date {
    width: 100% !important;
  }

  /* Admin users table responsive */
  .users-table {
    font-size: 12px;
  }

  .users-table tbody tr {
    display: block;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
  }

  .users-table th {
    display: none;
  }

  .users-table td {
    display: block;
    text-align: right;
    padding-left: 50%;
    padding: 8px;
    position: relative;
  }

  .users-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    font-weight: bold;
    text-align: left;
    width: 45%;
  }

  /* Modal responsive */
  .modal {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-overlay {
    padding: 10px;
  }

  /* Form inputs */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important; /* Prevent zoom on iOS */
    padding: 12px !important;
  }

  /* User header responsive */
  .user-header {
    flex-direction: column;
    gap: 12px;
  }

  .user-header button {
    width: 100%;
  }

  /* Logo */
  .logo {
    max-width: 150px;
  }

  /* Sections */
  .user-section,
  .user-loans-container,
  .user-team-loans-container {
    margin-bottom: 20px;
  }

  /* Admin grid for tools/projects */
  .admin-grid {
    grid-template-columns: 1fr !important;
  }

  /* Keyboard navigation better on mobile */
  input:focus,
  textarea:focus,
  button:focus {
    outline: 2px solid #4caf50;
    outline-offset: 2px;
  }
}

/* =====================
   CARS
===================== */
.car-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.3s ease;
}

.car-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.car-card.car-owner {
  border-color: rgba(102, 126, 234, 0.4);
  background: rgba(102, 126, 234, 0.05);
}

.car-assigned {
  color: #667eea;
  font-size: 13px;
  margin-left: 8px;
}

.car-unassigned {
  color: #666;
  font-size: 13px;
  margin-left: 8px;
  font-style: italic;
}

.cars-grid {
  display: grid;
  gap: 12px;
}

.car-contents-readonly {
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  min-height: 40px;
  color: #d0d0d0;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.5;
}

/* =====================
   TOOL QUANTITY
===================== */
.tool-qty {
  font-size: 13px;
  color: #667eea;
  margin: 4px 0 8px;
  font-weight: 500;
}

.quantity-selector input[type="number"] {
  -moz-appearance: textfield;
}

.quantity-selector input[type="number"]::-webkit-outer-spin-button,
.quantity-selector input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: inner-spin-button;
  opacity: 1;
}

/* =====================
   USER TABS
===================== */
.user-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}