@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

/* ==========================================================================
   Global Reset & Container Safety
   ========================================================================== */
html, body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  max-width: 100vw;
}

/* Headings */
h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-bright);
}

/* ==========================================================================
   Modern Navbar Styling & Responsive Design System
   ========================================================================== */
.navbar-custom {
  background-color: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
  padding: 0.5rem 1rem;
  min-height: 62px;
  z-index: 1030;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.brand-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.navbar-brand:hover .brand-icon-wrapper {
  transform: rotate(12deg) scale(1.05);
  background: rgba(225, 29, 72, 0.2);
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-bright) !important;
}

/* Navbar Nav Links */
.navbar-custom .nav-link {
  color: #94a3b8 !important;
  font-weight: 500;
  padding: 0.45rem 0.65rem !important;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 0.85rem;
}

.navbar-custom .nav-link:hover {
  color: #f8fafc !important;
  background-color: rgba(255, 255, 255, 0.07);
}

.navbar-custom .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.35);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.2);
}

.navbar-custom .nav-link-dev {
  color: #f59e0b !important;
}
.navbar-custom .nav-link-dev:hover {
  background-color: rgba(245, 158, 11, 0.12);
  color: #fbbf24 !important;
}

/* Action Buttons */
.btn-navbar-action {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.7);
  color: #cbd5e1;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-navbar-action:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: #64748b;
}

/* User Identity Cluster */
.user-identity-cluster {
  min-width: 0;
}

.user-meta-name {
  font-size: 0.85rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta-role {
  line-height: 1;
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 1.5px solid rgba(225, 29, 72, 0.4);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-navbar-avatar {
  background: transparent;
  border: none;
  padding: 0;
}
.btn-navbar-avatar:hover .avatar-circle,
.btn-navbar-avatar[aria-expanded="true"] .avatar-circle {
  border-color: #e11d48;
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.4);
}

/* Role Badges */
.badge-role {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  text-transform: capitalize;
}
.badge-role-admin {
  background: rgba(225, 29, 72, 0.2);
  color: #fb7185;
  border: 1px solid rgba(225, 29, 72, 0.4);
}
.badge-role-manager {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}
.badge-role-auditor {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}
.badge-role-editor {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-role-viewer {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

/* ==========================================================================
   Breakpoints & Responsive Tuning
   ========================================================================== */
/* Standard Desktops (>= 1400px) */
@media (min-width: 1400px) {
  .navbar-custom .nav-link {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.85rem;
  }
  .user-meta-name {
    max-width: 150px;
  }
}

/* Laptops and Narrow Desktops (1200px - 1399.98px) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .brand-text {
    font-size: 1.05rem;
  }
  .navbar-custom .nav-link {
    padding: 0.35rem 0.45rem !important;
    font-size: 0.8rem;
    gap: 0.22rem;
  }
  .navbar-custom .nav-link i {
    font-size: 0.9rem;
  }
  .user-meta-name {
    max-width: 105px;
  }
}

/* Tablets and Mobile (< 1200px) */
@media (max-width: 1199.98px) {
  .navbar-collapse {
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.75rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55);
  }
  .navbar-custom .nav-link {
    padding: 0.6rem 0.85rem !important;
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   Cards, Components & Existing Layout
   ========================================================================== */
.card-custom {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card-custom:hover {
  border-color: var(--border-focus);
}

/* Asset Card */
.asset-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.asset-card-img-container {
  height: 190px;
  background-color: #0b0f14;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  display: block;
}

.asset-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.asset-card:hover .asset-card-img {
  transform: scale(1.03);
}

.asset-placeholder-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
}

/* Asset Card 2x2 Photo Gallery */
.asset-card-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 3px !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 190px !important;
  max-height: 190px !important;
  padding: 3px !important;
  background-color: #0b0f14 !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.gallery-slot {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  border-radius: 3px !important;
  background-color: #161b22 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.gallery-slot img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.25s ease;
}

.gallery-slot:hover img {
  transform: scale(1.08);
}

.gallery-slot.empty-slot {
  background-color: rgba(255, 255, 255, 0.02) !important;
  border: 1px dashed rgba(255, 255, 255, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.gallery-slot.empty-slot:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(88, 166, 255, 0.3) !important;
}

.gallery-slot.empty-slot:hover .empty-label {
  color: rgba(88, 166, 255, 0.6) !important;
}

.gallery-slot .slot-badge {
  position: absolute !important;
  bottom: 3px !important;
  left: 3px !important;
  background: rgba(13, 17, 23, 0.85) !important;
  color: #58a6ff !important;
  border: 1px solid rgba(88, 166, 255, 0.3) !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 2px 4px !important;
  border-radius: 2px !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

.gallery-slot .empty-label {
  color: rgba(255, 255, 255, 0.2) !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  pointer-events: none !important;
  user-select: none !important;
}

.gallery-counter-badge {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  z-index: 3 !important;
  pointer-events: none !important;
}

.asset-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.asset-card-title {
  color: var(--accent-cyan);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-card-info-row {
  display: flex;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.asset-card-info-label {
  width: 130px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.asset-card-info-value {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-card-location {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-muted);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.asset-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-muted);
}

/* Custom Buttons */
.btn-primary-custom {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
  font-weight: 500;
}
.btn-primary-custom:hover {
  background-color: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
  color: white;
}

.btn-success-custom {
  background-color: var(--accent-green-dark);
  border-color: var(--accent-green-dark);
  color: white;
  font-weight: 500;
}
.btn-success-custom:hover {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.btn-warning-custom {
  background-color: var(--accent-yellow-dark);
  border-color: var(--accent-yellow-dark);
  color: white;
  font-weight: 500;
}
.btn-warning-custom:hover {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  color: black;
}

.btn-danger-custom {
  background-color: var(--accent-red-dark);
  border-color: var(--accent-red-dark);
  color: white;
  font-weight: 500;
}
.btn-danger-custom:hover {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

/* Status Badges */
.badge-status {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-ok {
  background-color: var(--status-ok-bg);
  border: 1px solid var(--status-ok-border);
  color: var(--status-ok-text);
}

.badge-pending {
  background-color: var(--status-pending-bg);
  border: 1px solid var(--status-pending-border);
  color: var(--status-pending-text);
}

.badge-mismatch {
  background-color: var(--status-mismatch-bg);
  border: 1px solid var(--status-mismatch-border);
  color: var(--status-mismatch-text);
}

.badge-missing {
  background-color: var(--status-missing-bg);
  border: 1px solid var(--status-missing-border);
  color: var(--status-missing-text);
}

/* Custom Table */
.table-custom {
  color: var(--text-primary);
  border-color: var(--border-subtle);
  margin-bottom: 0;
}

.table-custom thead th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0.75rem;
}

.table-custom tbody tr {
  border-bottom: 1px solid var(--border-muted);
  transition: background-color 0.15s ease;
}

.table-custom tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.table-custom td {
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  font-size: 0.88rem;
}

/* Forms and Inputs */
.form-control, .form-select {
  background-color: var(--bg-input) !important;
  color: var(--text-bright) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm);
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25) !important;
}

/* Footer */
footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
