/* Modern Professional Design - IT Infinity Service Portal */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #64748b;
  --accent: #0ea5e9;
  --success: #10b981;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Login Page Styles */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 440px;
}

.login-box {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-section {
  background: var(--surface);
  padding: 48px 32px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.logo-section img {
  max-width: 180px;
  height: auto;
  margin-bottom: 24px;
}

.logo-section h1 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-section p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.login-content {
  padding: 40px 32px;
  text-align: center;
}

.login-content h2 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.login-content > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  margin-bottom: 24px;
}

.login-form .form-group {
  margin-bottom: 16px;
  text-align: left;
}

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-form label i {
  color: var(--text-secondary);
  margin-right: 6px;
}

.login-form input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--text-primary);
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.login-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #fca5a5;
}

.login-error i {
  font-size: 16px;
}

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider span {
  padding: 0 12px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.microsoft-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
}

.microsoft-login-btn:hover {
  background: var(--background);
  border-color: var(--secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.microsoft-login-btn:active {
  transform: translateY(0);
}

.microsoft-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-footer {
  background: var(--background);
  padding: 20px 32px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.login-footer p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

/* Dashboard Styles */
.dashboard-wrapper {
  min-height: 100vh;
  background: var(--background);
  display: flex;
  flex-direction: column;
}

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar .navbar-brand img {
  height: 36px;
  width: auto;
}

.navbar h1 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-details {
  text-align: right;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.user-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  display: block;
  line-height: 1.4;
}

.user-email {
  color: var(--text-secondary);
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.logout-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.logout-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.logout-btn:active {
  transform: translateY(0);
}

.dashboard-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px;
}

.welcome-card {
  background: var(--surface);
  padding: 48px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeInUp 0.5s ease;
}

.welcome-card h2 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.welcome-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 16px;
}

.welcome-card p:last-of-type {
  margin-bottom: 24px;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--background);
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
}

.info-badge i {
  color: var(--primary);
  font-size: 14px;
}

/* Role Badges */
.role-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge-staff {
  background: #dbeafe;
  color: #1e40af;
}

.role-badge-customer {
  background: #e0e7ff;
  color: #4338ca;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.stat-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #dbeafe;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon-staff {
  background: #e0e7ff;
  color: #4338ca;
}

.stat-icon-customer {
  background: #fef3c7;
  color: #d97706;
}

.stat-icon-success {
  background: #d1fae5;
  color: var(--success);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--background);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--secondary);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-icon:hover {
  background: var(--background);
  color: var(--primary);
}

.btn-danger:hover {
  color: #dc2626;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Forms */
.user-form {
  max-width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.users-table thead {
  background: var(--background);
}

.users-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.users-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.users-table tbody tr:hover {
  background: var(--background);
}

.users-table .actions {
  display: flex;
  gap: 8px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-staff {
  background: #dbeafe;
  color: #1e40af;
}

.badge-customer {
  background: #e0e7ff;
  color: #4338ca;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #d97706;
}

/* Form textarea */
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--text-primary);
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Alert details */
details {
  cursor: default;
}

details summary {
  cursor: pointer;
  user-select: none;
  color: var(--text-primary);
  font-weight: 600;
}

details summary:hover {
  color: var(--primary);
}

details ul {
  list-style-type: disc;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

/* Quick Actions */
.quick-actions {
  margin-top: 32px;
}

.quick-actions h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.action-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.action-card i {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 12px;
}

.action-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.action-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-wrapper {
    padding: 16px;
  }
  
  .login-content {
    padding: 32px 24px;
  }

  .logo-section {
    padding: 40px 24px 24px;
  }

  .logo-section h1 {
    font-size: 22px;
  }

  .navbar {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
  }

  .navbar .navbar-brand {
    width: 100%;
    justify-content: center;
  }

  .navbar h1 {
    font-size: 16px;
  }

  .user-info {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .user-details {
    text-align: center;
    padding-right: 0;
    border-right: none;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }

  .logout-btn {
    width: 100%;
    justify-content: center;
  }

  .dashboard-content {
    padding: 32px 20px;
  }

  .welcome-card {
    padding: 32px 24px;
  }

  .welcome-card h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .logo-section {
    padding: 32px 20px 20px;
  }

  .logo-section h1 {
    font-size: 20px;
  }

  .login-content h2 {
    font-size: 18px;
  }

  .microsoft-login-btn {
    font-size: 14px;
    padding: 11px 20px;
  }

  .welcome-card {
    padding: 24px 20px;
  }

  .welcome-card h2 {
    font-size: 22px;
  }

  .welcome-card p {
    font-size: 14px;
  }
}
/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: var(--surface);
  margin: 5% auto;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  color: var(--text-secondary);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--text-primary);
  background: var(--background);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Data Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background: var(--background);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--background);
}

.data-table code {
  background: var(--background);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Monaco', 'Courier New', monospace;
  color: var(--text-primary);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-active {
  background: #d1fae5;
  color: #065f46;
}

.status-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-icon-danger {
  color: #dc2626;
}

.btn-icon-danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.form-help {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

.required {
  color: #dc2626;
  font-weight: 600;
}

/* No Data Message */
.no-data {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Page Header (enhanced) */
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 4px 0 0 0;
}

/* Additional responsive improvements for modals and tables */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }
}

/* Device Cards */
.devices-grid {
  display: grid;
  gap: 20px;
}

.device-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.device-card:hover {
  box-shadow: var(--shadow-lg);
}

.device-card.device-expanded {
  border-color: var(--primary);
}

.device-card.device-inactive {
  opacity: 0.6;
}

.device-card-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.device-card-header:hover {
  background: #f1f5f9;
}

.device-info h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-info h4 i {
  color: var(--primary);
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.device-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-meta i {
  color: var(--primary);
  font-size: 12px;
}

.device-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-toggle-icon {
  color: var(--text-secondary);
  font-size: 18px;
  transition: transform 0.3s ease;
}

.service-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-width: 100px;
}

.service-badge i {
  font-size: 16px;
  margin-bottom: 4px;
}

.service-date {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 2px;
}

.service-badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.service-badge-due-soon {
  background: #fef3c7;
  color: #92400e;
}

.service-badge-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.service-badge-not-set {
  background: #f3f4f6;
  color: #6b7280;
}

.device-card-body {
  padding: 24px;
}

.device-details {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  padding: 8px 0;
  font-size: 14px;
}

.detail-row strong {
  color: var(--text-primary);
  margin-right: 8px;
}

.device-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

/* Service History */
.service-history h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-history h5 i {
  color: var(--primary);
}

.no-data-small {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--background);
  border-radius: 8px;
}

.service-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-record {
  background: var(--background);
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.service-record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.service-record-header strong {
  font-size: 14px;
  color: var(--text-primary);
  display: block;
}

.service-date-small {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.service-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0;
  line-height: 1.6;
}

.service-detail i {
  color: var(--primary);
  margin-right: 6px;
  width: 16px;
}

.service-detail strong {
  color: var(--text-primary);
}

.service-documents {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.document-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
}

.document-link:hover {
  background: var(--background);
  border-color: var(--primary);
  color: var(--primary);
}

.document-link i {
  color: #dc2626;
  font-size: 16px;
}

.file-size {
  color: var(--text-secondary);
  font-size: 11px;
  margin-left: auto;
}

/* Modal enhancements */
.modal-large .modal-content {
  max-width: 800px;
}

.info-box {
  background: var(--background);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-primary);
}

/* Badge variations */
.badge-scheduled {
  background: #dbeafe;
  color: #1e40af;
}

.badge-in-progress {
  background: #fef3c7;
  color: #d97706;
}

.badge-completed {
  background: #d1fae5;
  color: #065f46;
}

.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .device-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .device-status {
    width: 100%;
    justify-content: space-between;
  }
  
  .device-actions {
    flex-direction: column;
  }
  
  .device-actions .btn {
    width: 100%;
  }
  
  .service-record-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Alert warning style */
.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Calendar Integration Styles */
.staff-selection {
    margin: 16px 0;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

.staff-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.staff-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.staff-checkbox-item:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.staff-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.staff-checkbox-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
}

/* Delete/Danger Button Styles - Matching Primary/Secondary Style */
.btn-danger {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #ef4444;
    color: white !important;
}

.btn-danger:hover {
    background: #dc2626 !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:active {
    background: #b91c1c;
    color: white !important;
    transform: translateY(0);
}

/* Make sure modal footer has proper spacing for left-aligned delete button */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.modal-footer > button:first-child {
    margin-right: auto; /* Push delete button to left */
}

/* Enhanced Microsoft-Style Calendar */

.calendar-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* Prevent any overflow */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.calendar-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    width: 100%;
    max-width: 100%;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px 5px;
    background: var(--background);
    border-bottom: 2px solid var(--border);
}

.calendar-day {
    min-height: 100px;
    max-height: 120px; /* Limit height */
    padding: 5px;
    border: 1px solid var(--border);
    border-right-width: 0;
    border-bottom-width: 0;
    background: var(--surface);
    cursor: pointer;
    position: relative;
    overflow: hidden; /* Critical: hide overflow */
    transition: all 0.2s ease;
}

.calendar-day:nth-child(7n) {
    border-right-width: 1px;
}

.calendar-day.other-month {
    background: #fafafa;
    color: #999;
}

.calendar-day.today {
    background: #e6f2ff;
    font-weight: 600;
}

.calendar-day.selected {
    background: #cce5ff;
    border: 2px solid var(--primary);
    z-index: 2;
}

.calendar-day:hover:not(.other-month) {
    background: #f5f5f5;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    text-align: right;
    color: var(--text-primary);
}

.calendar-day.today .calendar-day-number {
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    float: right;
}

/* Event blocks - Microsoft Calendar style */
.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* Prevent overflow */
}

.calendar-event {
    background: var(--primary);
    color: white;
    font-size: 10px; /* Slightly smaller */
    padding: 2px 4px;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block; /* Changed from flex to block */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.calendar-event-icon {
    font-size: 9px;
    margin-right: 2px;
}

.calendar-event-time {
    font-weight: 600;
    font-size: 9px;
    margin-right: 3px;
}

.calendar-event:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    position: relative;
}

.calendar-event:hover::after {
    content: attr(data-full-title);
    position: absolute;
    left: 0;
    top: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: normal;
    max-width: 200px;
    z-index: 1000;
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
}

.calendar-event.event-microsoft {
    background: #00a4ef;
}

.calendar-event.event-service {
    background: #7c3aed;
}

.calendar-event.event-scheduled {
    background: #2563eb;
}

.calendar-event.event-completed {
    background: #10b981;
}

.calendar-event.event-in-progress {
    background: #f59e0b;
}

.calendar-event.event-cancelled {
    background: #ef4444;
    text-decoration: line-through;
    opacity: 0.7;
}

.calendar-event.event-allday {
    background: #64748b;
}

.calendar-event-time {
    font-weight: 600;
    font-size: 10px;
}

.calendar-event-icon {
    font-size: 10px;
}

.calendar-more-events {
    font-size: 10px;
    color: var(--primary);
    cursor: pointer;
    padding: 2px 4px;
    text-align: center;
    font-weight: 600;
}

.calendar-more-events:hover {
    background: var(--background);
    border-radius: 3px;
}

/* Event details popup */
.event-details-popup {
    position: absolute;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px;
    z-index: 1000;
    min-width: 250px;
    max-width: 350px;
    display: none;
}

.event-details-popup.visible {
    display: block;
}

.event-details-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-details-body {
    font-size: 12px;
    color: var(--text-secondary);
}

.event-detail-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: flex-start;
}

.event-detail-icon {
    color: var(--primary);
    width: 16px;
    flex-shrink: 0;
}

.event-detail-text {
    flex: 1;
}

/* Legend */
.calendar-legend {
    display: flex;
    gap: 15px;
    padding: 12px 20px;
    background: var(--background);
    border-top: 1px solid var(--border);
    font-size: 11px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Multi-day event spanning */
.calendar-event.event-continues-right::after {
    content: '→';
    margin-left: auto;
    font-size: 10px;
}

.calendar-event.event-continues-left::before {
    content: '←';
    margin-right: 4px;
    font-size: 10px;
}

.calendar-event.event-middle {
    border-radius: 0;
}

.calendar-event.event-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calendar-event.event-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Responsive calendar */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        font-size: 11px;
    }
    
    .calendar-event {
        font-size: 10px;
        padding: 1px 3px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
}