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

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #430098 0%, #00bcd2 100%) !important;
  background-attachment: fixed !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  height: 100%;
  width: 100%;
  position: fixed;
  color: #333;
  margin: 0;
  padding: 0;
}

/* Main scrollable wrapper */
.main-wrapper {
  height: 100vh;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom scrollbar for main wrapper */
.main-wrapper::-webkit-scrollbar {
  width: 10px;
}

.main-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.95);
}

.main-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 7px;
}

.main-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: #430098;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

.navbar ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.navbar a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.navbar a:hover {
  color: #430098;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 2rem;
  margin: 1rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #333;
  text-align: center;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #430098;
  font-weight: 600;
}

.stat-card p {
  font-size: 1.1rem;
  color: #666;
}

.btn {
  background: #9e1c64;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 0.25rem;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
}

.btn:hover {
  background: #611856;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: #211B57;
}

.btn-secondary:hover {
  background: #430098;
}

.btn-danger {
  background: #dc3545;
}

.btn-success {
  background: #007985;
}

.btn-success:hover {
  background: #0033a0;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-white {
  background: white;
  color: #211B57;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.btn-white:hover {
  background: #f8f9fa;
  color: #211B57;
  text-decoration: none;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s;
  background-color: white;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Make sure all input types get proper styling */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
input[type="tel"], 
input[type="url"], 
input[type="date"], 
input[type="datetime-local"], 
input[type="time"], 
select, 
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd !important;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s;
  background-color: white;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  font-family: 'Poppins', sans-serif;
}

/* Hover state for better user experience */
.form-control:hover,
input[type="text"]:hover, 
input[type="email"]:hover, 
input[type="password"]:hover, 
input[type="number"]:hover, 
input[type="tel"]:hover, 
input[type="url"]:hover, 
input[type="date"]:hover, 
input[type="datetime-local"]:hover, 
input[type="time"]:hover, 
select:hover, 
textarea:hover {
  border-color: #430098;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(67, 0, 152, 0.1);
}

.form-control:focus,
input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus, 
input[type="number"]:focus, 
input[type="tel"]:focus, 
input[type="url"]:focus, 
input[type="date"]:focus, 
input[type="datetime-local"]:focus, 
input[type="time"]:focus, 
select:focus, 
textarea:focus {
  outline: none;
  border-color: #430098 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(67, 0, 152, 0.2) !important;
}

/* Disabled field styling */
.form-control:disabled,
input[type="text"]:disabled, 
input[type="email"]:disabled, 
input[type="password"]:disabled, 
input[type="number"]:disabled, 
input[type="tel"]:disabled, 
input[type="url"]:disabled, 
input[type="date"]:disabled, 
input[type="datetime-local"]:disabled, 
input[type="time"]:disabled, 
select:disabled, 
textarea:disabled {
  background-color: #f8f9fa !important;
  border-color: #e9ecef !important;
  color: #6c757d !important;
  cursor: not-allowed;
}

/* Special styling for select dropdowns */
select {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 8"><path fill="%23666" d="M6 8L0 2h12z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Make sure readonly fields are visually distinct */
.form-control[readonly],
input[readonly] {
  background-color: #f8f9fa !important;
  border-color: #dee2e6 !important;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.table tbody tr:hover {
  background: #f8f9fa;
}

.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #430098;
  font-size: 2rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  color: white;
  font-size: 2.8rem;
  font-weight: 700;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-secondary {
  background: #e2e3e5;
  color: #6c757d;
}

/* Tab Styles */
.tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.tab-button {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  flex: 1;
  text-align: center;
  justify-content: center;
}

.tab-button:hover {
  background: #f8f9fa;
  color: #333;
}

.tab-button.active {
  color: #430098;
  background: white;
  border-bottom-color: #430098;
}

.tab-content {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 0 0 15px 15px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 200px;
}

.tab-content h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #333;
}

/* Table overflow fixes */
.table-container {
  overflow-x: auto;
  margin: 0 -2rem;
  padding: 0 2rem;
}

.table {
  min-width: 100%;
  table-layout: fixed;
}

.table th,
.table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.75rem 0.5rem;
}

/* Users page column widths */
.users-table .table th:nth-child(1), .users-table .table td:nth-child(1) { width: 15%; } /* Name */
.users-table .table th:nth-child(2), .users-table .table td:nth-child(2) { width: 20%; } /* Email */
.users-table .table th:nth-child(3), .users-table .table td:nth-child(3) { width: 15%; } /* Department */
.users-table .table th:nth-child(4), .users-table .table td:nth-child(4) { width: 15%; } /* Position */
.users-table .table th:nth-child(5), .users-table .table td:nth-child(5) { width: 10%; } /* Status */
.users-table .table th:nth-child(6), .users-table .table td:nth-child(6) { width: 12%; } /* Assigned Assets */
.users-table .table th:nth-child(7), .users-table .table td:nth-child(7) { width: 13%; } /* Actions */

/* Assets page column widths */
.assets-table .table th:nth-child(1), .assets-table .table td:nth-child(1) { width: 20%; } /* Name */
.assets-table .table th:nth-child(2), .assets-table .table td:nth-child(2) { width: 15%; } /* Type */
.assets-table .table th:nth-child(3), .assets-table .table td:nth-child(3) { width: 15%; } /* Model */
.assets-table .table th:nth-child(4), .assets-table .table td:nth-child(4) { width: 18%; } /* Serial Number */
.assets-table .table th:nth-child(5), .assets-table .table td:nth-child(5) { width: 12%; } /* Status */
.assets-table .table th:nth-child(6), .assets-table .table td:nth-child(6) { width: 15%; } /* Assigned To */
.assets-table .table th:nth-child(7), .assets-table .table td:nth-child(7) { width: 15%; } /* Actions */

/* Allow email column to wrap */
.users-table .table th:nth-child(2), .users-table .table td:nth-child(2) {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Improved navbar responsiveness */
.navbar .logo {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: 250px;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.navbar .logo.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.navbar .logo .brand-logo {
  height: 28px;
  width: auto;
  display: inline-block;
}

.navbar .logo .brand-subtitle {
  display: block;
  font-size: 0.85rem;
  color: #430098;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .navbar .logo {
    font-size: 1.2rem;
    max-width: 200px;
  }
  /* Allow the brand to wrap even though nav links are nowrap */
  .navbar a.logo {
    white-space: normal;
  }
  
  .navbar ul {
    gap: 1rem;
  }
  
  .navbar a {
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .navbar .logo {
    font-size: 1.1rem;
    max-width: none;
    text-align: center;
  }
  
  .navbar ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .navbar li {
    flex: 0 0 auto;
  }
  
  .navbar a {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .table {
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }
  
  .table th,
  .table td {
    padding: 0.5rem;
    min-width: 100px;
  }
}

/* Text readability improvements */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

.page-header h1 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Ensure proper contrast for all text elements */
.card, .stat-card, .login-card {
  color: #333;
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
  color: #430098;
}

/* Better button text visibility */
.btn, .btn:hover, .btn:focus, .btn:active {
  text-shadow: none;
}

/* Improve form labels visibility */
.form-group label {
  color: #430098;
  font-weight: 600;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  margin: 5% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
  background: linear-gradient(135deg, #430098 0%, #00bcd2 100%);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-close {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s;
}

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

.modal-body {
  padding: 2rem;
}

.asset-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 4px solid #430098;
}

.detail-section h4 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #555;
  flex: 0 0 40%;
}

.detail-value {
  flex: 1;
  text-align: right;
  color: #333;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  max-width: 60%;
}

.detail-value code {
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.detail-value a {
  color: #007bff;
  text-decoration: none;
  word-break: break-word;
  overflow-wrap: break-word;
}

.detail-value a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.asset-notes {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1.5rem;
  border-left: 4px solid #28a745;
}

.asset-notes h4 {
  margin: 0 0 1rem 0;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.asset-notes .notes-content {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  white-space: pre-line;
  color: #666;
  min-height: 50px;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s;
}

.clickable-row:hover {
  background-color: #f1f3f4 !important;
}

/* Generic dropdown styles for import menu */
.dropdown-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  padding: 0.25rem 0;
  z-index: 999;
}
.dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #333;
  text-decoration: none;
}
.dropdown-item:hover {
  background: #f1f3f5;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .modal-header {
    padding: 1rem 1.5rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .asset-detail-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .detail-section {
    padding: 1rem;
  }
}