/* Mailand Hanoi City Light Brand Design System - Asset Control Platform */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Mailand Hanoi City Brand Palette (Light Mode / Nền Trắng) */
  --brand-gold-light: #f5d061;
  --brand-gold: #d4af37;
  --brand-gold-dark: #b8860b;
  --brand-gold-gradient: linear-gradient(135deg, #e5b836 0%, #d4af37 50%, #b8860b 100%);
  --brand-gold-glow: rgba(212, 175, 55, 0.25);

  --brand-green-deep: #0f382c;
  --brand-green-medium: #14452f;
  --brand-green-emerald: #059669;
  --brand-green-mint: #10b981;
  
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  
  --border-color: #e2e8f0;
  --border-color-hover: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-gold: #b8860b;
  --text-brand: #0f382c;
  
  --primary-blue: #0f382c;
  --primary-blue-glow: rgba(15, 56, 44, 0.15);
  --accent-cyan: #059669;
  --accent-emerald: #10b981;
  --accent-amber: #d4af37;
  --accent-rose: #e11d48;
  --accent-indigo: #0f382c;
  --accent-purple: #b8860b;

  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --shadow-card: 0 4px 20px rgba(15, 56, 44, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 8px 24px -6px rgba(212, 175, 55, 0.3);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(15, 56, 44, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .page-title, .stat-val {
  font-family: var(--font-heading);
  color: var(--brand-green-deep);
}

.code-font, .asset-code, .serial-code, .qr-token {
  font-family: var(--font-mono);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: #0b241c;
  border-right: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.04);
}

.main-content {
  flex: 1;
  margin-left: 270px;
  padding: 32px 40px;
  max-width: 1600px;
  background: var(--bg-primary);
}

/* Sidebar Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 36px;
  padding: 0 6px;
  letter-spacing: -0.3px;
  font-family: var(--font-heading);
}

/* Navigation Links */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.93rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(20, 69, 47, 0.5));
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #f5d061;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: #94a3b8;
}

.nav-link.active i {
  color: #f5d061;
}

/* User Profile Widget */
.user-widget {
  margin-top: auto;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0b241c;
  font-family: var(--font-heading);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-info .name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #ffffff;
}

.user-info .role {
  font-size: 0.72rem;
  color: #f5d061;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.logout-btn {
  color: #94a3b8;
  font-size: 1.1rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-decoration: none;
}

.logout-btn:hover {
  color: #f87171;
  background: rgba(244, 63, 94, 0.15);
}

/* Top Header Bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--brand-green-deep);
}

/* Cards (Nền Trắng Crisp) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 28px rgba(15, 56, 44, 0.08);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: rgba(20, 69, 47, 0.08); color: #0f382c; border: 1px solid rgba(20, 69, 47, 0.15); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.stat-icon.amber { background: rgba(212, 175, 55, 0.12); color: #b8860b; border: 1px solid rgba(212, 175, 55, 0.25); }
.stat-icon.rose { background: rgba(244, 63, 94, 0.1); color: #e11d48; border: 1px solid rgba(244, 63, 94, 0.2); }
.stat-icon.purple { background: rgba(15, 56, 44, 0.08); color: #0f382c; border: 1px solid rgba(15, 56, 44, 0.15); }

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--brand-green-deep);
}

.stat-label {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.custom-table th {
  background: #f8fafc;
  padding: 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand-green-deep);
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-family: var(--font-heading);
}

.custom-table td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.92rem;
  color: #334155;
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(20, 69, 47, 0.02);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.badge-in_use { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-in_stock { background: #fefce8; color: #a16207; border: 1px solid #fde047; }
.badge-maintenance { background: #fffbe6; color: #b45309; border: 1px solid #fcd34d; }
.badge-broken { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-liquidated { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-gold-gradient);
  color: #0b241c;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
  background: linear-gradient(135deg, #f5d061 0%, #e5b836 50%, #c59b27 100%);
}

.btn-secondary {
  background: #f8fafc;
  color: var(--brand-green-deep);
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: #94a3b8;
  color: var(--brand-green-deep);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-danger {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.btn-danger:hover {
  background: #e11d48;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: #0f172a;
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--brand-green-deep);
  box-shadow: 0 0 0 3px rgba(15, 56, 44, 0.12);
}

select.form-control option {
  background: #ffffff;
  color: #0f172a;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #0f172a;
}

/* Public Asset View Page (Nền Trắng Mobile) */
.public-asset-wrapper {
  max-width: 580px;
  margin: 0 auto;
  padding: 24px 16px;
}

.asset-hero {
  text-align: center;
  margin-bottom: 24px;
}

.asset-image-large {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.qr-box {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-lg);
  display: inline-block;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}

.qr-box img {
  width: 180px;
  height: 180px;
  display: block;
}

/* Grid Utilities for Responsive Layouts */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.asset-hero-flex {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.top-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Mobile Top Navigation Header Bar */
.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #0b241c;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  z-index: 1040;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 800;
  font-family: var(--font-heading);
  text-decoration: none;
}

.mobile-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #f5d061;
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-toggle-btn:active {
  transform: scale(0.95);
  background: rgba(212, 175, 55, 0.2);
}

/* Mobile Sidebar Drawer Overlay Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1045;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
}

.mobile-close-sidebar-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--brand-gold, #e5b836);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}

.mobile-close-sidebar-btn:active {
  background: rgba(225, 29, 72, 0.25);
  color: #f43f5e;
  border-color: #f43f5e;
}

/* Responsive Adjustments for Tablet & Mobile Devices */
@media (max-width: 992px) {
  .mobile-top-bar {
    display: flex;
  }

  .mobile-close-sidebar-btn {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
    pointer-events: none;
  }

  .sidebar-backdrop.active {
    pointer-events: auto;
  }

  .sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    padding: 20px 16px;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .brand div, .nav-link span, .user-info {
    display: block;
  }

  .brand {
    justify-content: space-between;
    padding: 0 6px;
    margin-bottom: 28px;
    width: 100%;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .user-widget {
    padding: 14px 16px;
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 0;
    padding: 80px 20px 32px 20px;
    width: 100%;
  }

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

@media (max-width: 768px) {
  .main-content {
    padding: 76px 14px 28px 14px;
  }

  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .top-header-actions {
    width: 100%;
  }

  .top-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .page-title {
    font-size: 1.45rem;
  }

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

  .asset-hero-flex {
    flex-direction: column;
    align-items: center;
  }

  .asset-hero-flex img {
    width: 100% !important;
    max-width: 260px;
    height: auto !important;
    aspect-ratio: 1;
  }

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

  .stat-card {
    padding: 14px;
    gap: 12px;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
  }

  .stat-val {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.76rem;
  }

  .card {
    padding: 16px;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .custom-table {
    min-width: 660px;
  }

  .custom-table th, .custom-table td {
    padding: 12px 10px;
    font-size: 0.85rem;
  }

  .btn {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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


/* Custom Mailand Gallery Confirmation Modal Styling (SweetAlert2) */
.swal2-container {
  backdrop-filter: blur(4px) !important;
  background: rgba(11, 36, 28, 0.45) !important;
  z-index: 10000 !important;
}

.swal2-popup.mailand-modal-popup {
  border-radius: 18px !important;
  border: 1.5px solid rgba(229, 184, 54, 0.5) !important;
  background: #ffffff !important;
  box-shadow: 0 25px 50px -12px rgba(11, 36, 28, 0.25) !important;
  padding: 28px 24px !important;
  font-family: var(--font-body) !important;
  max-width: 440px !important;
}

.swal2-title.mailand-modal-title {
  color: var(--brand-green-deep) !important;
  font-family: var(--font-heading) !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  margin-top: 12px !important;
}

.swal2-html-container.mailand-modal-text {
  color: #475569 !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  margin: 14px 0 22px 0 !important;
}

.mailand-btn-modal {
  padding: 10px 22px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 6px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
}

.swal2-icon.swal2-warning {
  border-color: #f59e0b !important;
  color: #d97706 !important;
}

.swal2-icon.swal2-error {
  border-color: #f43f5e !important;
  color: #e11d48 !important;
}

.swal2-icon.swal2-success {
  border-color: #10b981 !important;
  color: #059669 !important;
}

/* UI Performance Hardware Acceleration & Repaint Optimization */
.card, .btn, .modal-content, .mobile-top-bar, .nav-link, .stat-card {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.table-responsive, .stats-grid, .asset-grid {
  contain: layout style;
}

img {
  content-visibility: auto;
}

/* Audit Log Dedicated Professional Styles */
.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.audit-badge-create {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.audit-badge-update {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.audit-badge-delete {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.audit-badge-login {
  background: #f0fdf4;
  color: #0f382c;
  border: 1px solid #bbf7d0;
}

.audit-badge-maint {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.audit-badge-pass {
  background: #fefce8;
  color: #b8860b;
  border: 1px solid #fef08a;
}

.audit-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audit-avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f382c 0%, #14452f 100%);
  color: var(--brand-gold, #e5b836);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 2px 6px rgba(15, 56, 44, 0.15);
  flex-shrink: 0;
}

