/* ==========================================================================
   KE IT Asset Management System - Light Mode Glassmorphism Theme
   ========================================================================== */

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

:root {
  /* Color Palette - Vibrant Light Glassmorphism */
  --bg-gradient: linear-gradient(135deg, #eef2f7 0%, #e0e8f5 50%, #d8e2f3 100%);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-hover: rgba(255, 255, 255, 0.88);
  --glass-card: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-border-subtle: rgba(210, 220, 235, 0.5);
  --glass-shadow: 0 10px 30px -5px rgba(0, 30, 80, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  --secondary: #4f46e5;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.12);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --backdrop-blur: blur(14px);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* App Container */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Layout Main Content */
main.main-content {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* Glass Card Component */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.glass-panel:hover {
  box-shadow: 0 16px 36px -5px rgba(0, 30, 80, 0.12);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 28px;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Hamburger Button */
.hamburger-btn {
  background: transparent;
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-main);
  font-size: 1.4rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover {
  background: rgba(240, 244, 250, 0.9);
  color: var(--primary);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 120%;
  left: 0;
  background-color: #ffffff;
  min-width: 240px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-radius: var(--radius-md);
  z-index: 100;
  border: 1px solid var(--glass-border);
  flex-direction: column;
  padding: 8px 0;
}

.dropdown-content.show {
  display: flex;
  animation: slideDown 0.2s ease forwards;
}

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

.dropdown-header {
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.nav-item {
  padding: 12px 20px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: var(--primary);
  background: rgba(240, 244, 250, 0.8);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.75);
  padding: 6px 14px 6px 6px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-main);
  border: 1px solid var(--glass-border-subtle);
}

.btn-secondary:hover {
  background: #ffffff;
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

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

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* KPI Summary Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.75);
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
  line-height: 1;
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-icon.primary { background: rgba(37, 99, 235, 0.12); color: var(--primary); }
.kpi-icon.success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.kpi-icon.warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.kpi-icon.danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

/* Dashboard Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

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

.chart-card {
  padding: 24px;
}

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

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Kanban Board Styles */
.kanban-board-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 992px) {
  .kanban-board-3col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-column {
  background: rgba(240, 244, 252, 0.65);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid rgba(0,0,0,0.05);
}

.column-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.column-count {
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kanban-cards-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kanban-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 20, 60, 0.05);
  border: 1px solid rgba(220, 230, 242, 0.8);
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 30, 80, 0.1);
  border-color: var(--primary-light);
}

.kanban-card:active {
  cursor: grabbing;
}

.card-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.card-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.06);
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-in-use {
  background: var(--warning-bg);
  color: #b45309;
}

.badge-available {
  background: var(--success-bg);
  color: #047857;
}

.badge-maintenance {
  background: var(--danger-bg);
  color: #b91c1c;
}

.badge-retired {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

/* Data Table */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: rgba(241, 245, 249, 0.9);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid #e2e8f0;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(240, 246, 255, 0.6);
}

.asset-id-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.asset-id-link:hover {
  text-decoration: underline;
}

/* Search Bar & Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-input-group i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.select-input {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Photo Attachment / Camera Box (500x500 spec) */
.photo-attachment-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-attachment-box:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.03);
}

.photo-preview-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 12px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  border: 2px solid #ffffff;
}

.photo-preview-container img,
.photo-preview-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Audit Timeline Component */
.timeline-container {
  position: relative;
  padding-left: 28px;
  margin-top: 16px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-date {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.timeline-detail {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-photo {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  margin-top: 8px;
  border: 1px solid #e2e8f0;
}

/* Live Sync Pill Badge */
.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.sync-status-badge.local {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.sync-status-badge.live {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

/* ==========================================================================
   Print Styles & FM-IT-002 Document Layout
   ========================================================================== */
.fm002-print-container {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9pt !important;
  }

  .no-print, navbar, footer, .navbar, .page-header, .filter-bar, .glass-panel, #navbar-container, footer {
    display: none !important;
  }

  .fm002-print-container {
    display: block !important;
    padding: 5px;
  }

  .fm002-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin-bottom: 10px;
  }

  .fm002-header-right {
    text-align: right;
  }

  .fm002-iso-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 8.5pt;
  }

  .fm002-iso-table th,
  .fm002-iso-table td {
    border: 1px solid #000000;
    padding: 5px 6px;
    vertical-align: middle;
  }

  .fm002-iso-table th {
    background-color: #f2f2f2 !important;
    font-weight: bold;
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .fm002-iso-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 35px;
    padding: 0 40px;
    page-break-inside: avoid;
  }

  .fm002-sign-box {
    text-align: center;
    font-size: 9.5pt;
  }
}

/* ==========================================================================
   Mobile Responsive Enhancements
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 10px 14px;
  }

  .nav-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .nav-actions {
    justify-content: flex-end;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    min-width: 130px;
    justify-content: center;
  }

  main.main-content {
    padding: 12px;
  }

  .modal-box {
    max-width: 100%;
    margin: 10px;
    max-height: 95vh;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 14px;
  }
}
