/* AssetFlow UI Design System — Clean Soft & Bright Theme (Sakpore-inspired) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Primary Vibrant Blue */
  --primary-50: #eef7ff;
  --primary-100: #d9edff;
  --primary-200: #bce0ff;
  --primary-300: #8eccff;
  --primary-400: #57b0ff;
  --primary-500: #007aff; /* Reference Azure Blue */
  --primary-600: #0066e6;
  --primary-700: #0052cc;
  --primary-800: #0043a8;

  /* Surface & Background */
  --bg-app: #f4f6fa;
  --surface-card: #ffffff;
  --surface-hover: #f8fafc;
  --border-card: #eef2f6;
}

*, ::before, ::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Soft Pill Badges (from reference UI) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-available,
.badge-good,
.badge-active,
.badge-approved,
.badge-returned {
  background-color: #e6f8ee;
  color: #10b981;
  border: 1px solid #d1fae5;
}

.badge-borrowed,
.badge-product,
.badge-info {
  background-color: #e7f1ff;
  color: #007aff;
  border: 1px solid #dbeafe;
}

.badge-pending,
.badge-fair,
.badge-warning {
  background-color: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-maintenance,
.badge-purple,
.badge-service {
  background-color: #f3e8ff;
  color: #9333ea;
  border: 1px solid #e9d5ff;
}

.badge-damaged,
.badge-rejected,
.badge-poor,
.badge-danger,
.badge-lost {
  background-color: #fee2e2;
  color: #ef4444;
  border: 1px solid #fecaca;
}

/* Soft Action Pill Buttons */
.btn-action-detail,
.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}
.btn-action-detail:hover,
.btn-action-edit:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.btn-action-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  background-color: #fee2e2;
  color: #ef4444;
  border: 1px solid #fecaca;
  transition: all 0.15s ease;
}
.btn-action-delete:hover {
  background-color: #fecaca;
  color: #dc2626;
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  user-select: none;
}

.btn-primary {
  background-color: #007aff;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}
.btn-primary:hover {
  background-color: #0066e6;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.btn-cancel {
  background-color: #f1f5f9;
  color: #475569;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 24px;
}
.btn-cancel:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

.btn-save {
  background-color: #007aff;
  color: #ffffff;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 28px;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}
.btn-save:hover {
  background-color: #0066e6;
}

/* Form Controls */
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 13px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-family: var(--font-sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

/* Modals & Dialogs (Full 100vh Blur Coverage) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  position: relative;
  z-index: 100000;
}

/* Drag & Drop Photo Uploader */
.dropzone-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 2px dashed #cbd5e1;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.dropzone-container:hover, .dropzone-container.is-dragging {
  border-color: #007aff;
  background-color: rgba(0, 122, 255, 0.04);
}
.dropzone-container.is-dragging {
  transform: scale(0.98);
  border-style: solid;
}
.dropzone-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}
.dropzone-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 22px;
  z-index: 10;
}
.dropzone-container:hover .dropzone-overlay {
  opacity: 1;
}

/* Custom Searchable Dropdown (Matching Reference Screenshot) */
.dropdown-menu {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.02);
  padding: 8px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.12s ease;
}
.dropdown-item:hover {
  background-color: #f1f5f9;
}
.dropdown-item.active {
  background-color: #007aff;
  color: #ffffff;
}
.dropdown-item.active .badge-child {
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}

.badge-child {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background-color: #fff7ed;
  color: #ea580c;
  border: 1px solid #ffedd5;
}

/* Mobile Bottom Sheet */
@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-dialog {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    max-height: 85vh;
  }
  .sheet-handle {
    width: 40px;
    height: 4px;
    background-color: #cbd5e1;
    border-radius: 9999px;
    margin: 8px auto 14px auto;
  }
}

/* Soft Cards */
.soft-card {
  background-color: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}
.soft-card:hover {
  border-color: #dbeafe;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.06);
}

/* Card List Item (as seen in Image 3 & Image 4) */
.list-item-card {
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.list-item-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.06);
}

/* Category Pill Tabs (from Image 3 & 4) */
.pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.pill-tab:hover {
  background: #f8fafc;
  color: #0f172a;
}
.pill-tab.active {
  background: #007aff;
  color: #ffffff;
  border-color: #007aff;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.04);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  animation: slideInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}
@keyframes slideInDown {
  from { transform: translateY(-16px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* =========================================================
   MODERN LOADING SKELETON SHIMMER (Linear / Apple aesthetic)
   ========================================================= */
.skeleton {
  background: linear-gradient(
    90deg,
    #edf2f7 0%,
    #e2e8f0 35%,
    #f8fafc 50%,
    #e2e8f0 65%,
    #edf2f7 100%
  );
  background-size: 250% 100%;
  animation: skeletonShimmer 1.3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: 10px;
  display: block;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -150% 0;
  }
}

.skeleton-box {
  width: 100%;
  height: 1rem;
  border-radius: 6px;
}

.skeleton-title {
  height: 1.75rem;
  width: 260px;
  border-radius: 10px;
}

.skeleton-subtitle {
  height: 1rem;
  width: 380px;
  max-width: 100%;
  border-radius: 6px;
}

.skeleton-card {
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  flex-shrink: 0;
}

.skeleton-pill {
  height: 1.5rem;
  width: 4.5rem;
  border-radius: 9999px;
}

/* SPA Navigation Progress Bar */
.spa-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #007aff, #60a5fa, #38bdf8);
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.7);
  z-index: 9999999;
  width: 0%;
  opacity: 0;
  transition: width 0.25s ease, opacity 0.2s ease;
  pointer-events: none;
}
