/* =============================================
   STR Property Management Dashboard - Styles
   ============================================= */

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

:root {
  --bg-dark: #f8f9fc;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f8;
  --accent-cyan: #0066cc;
  --accent-pink: #d63384;
  --accent-yellow: #f59e0b;
  --accent-green: #059669;
  --accent-orange: #ea580c;
  --accent-purple: #7c3aed;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --border: rgba(203, 213, 225, 0.6);
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 102, 204, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(214, 51, 132, 0.03) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(3deg); }
  66% { transform: translate(-20px, 20px) rotate(-3deg); }
}

#root {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 768px) {
  #root {
    padding: 3rem 2rem;
  }
}

/* =============================================
   Login Screen
   ============================================= */

.login-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.6s ease-out;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.pin-input-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pin-digit {
  width: 55px;
  height: 65px;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-dark);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.pin-digit:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.pin-digit.filled {
  border-color: var(--accent-cyan);
  background: rgba(0, 102, 204, 0.05);
}

.login-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* =============================================
   User Header Bar
   ============================================= */

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 2rem;
  animation: slideDown 0.4s ease-out;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.user-details h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: rgba(0, 102, 204, 0.1);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logout-btn {
  padding: 0.6rem 1.2rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

/* =============================================
   Header
   ============================================= */

.header {
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 768px) {
  .header h1 {
    font-size: 3rem;
  }
}

.header .subtitle {
  font-family: 'Space Mono', monospace;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* =============================================
   Stats Grid
   ============================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.urgent {
  border-color: var(--error);
}

.stat-card.urgent::before {
  background: var(--error);
  opacity: 1;
}

.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.urgent {
  color: var(--error);
}

/* =============================================
   Tabs
   ============================================= */

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  animation: fadeIn 0.8s ease-out 0.2s both;
  flex-wrap: wrap;
}

.tab {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent-cyan);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
}

.tab .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  background: var(--error);
  color: white;
  font-size: 0.7rem;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
}

/* =============================================
   Filters
   ============================================= */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

.filter-group {
  flex: 1;
  min-width: 140px;
}

.filter-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* =============================================
   Buttons
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-secondary:hover {
  background: var(--accent-cyan);
  color: white;
}

/* =============================================
   Task Cards
   ============================================= */

.tasks-container {
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.task-section {
  margin-bottom: 2rem;
}

.task-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.task-section-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.task-section-count {
  background: var(--bg-hover);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tasks-grid {
  display: grid;
  gap: 1rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.task-card.overdue {
  border-left: 4px solid var(--error);
}

.task-card.due-today {
  border-left: 4px solid var(--warning);
}

.task-card.upcoming {
  border-left: 4px solid var(--accent-cyan);
}

.task-card.completed {
  opacity: 0.7;
  border-left: 4px solid var(--success);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.task-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.task-type-badge.cleaning {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.task-type-badge.inspection {
  background: rgba(0, 102, 204, 0.1);
  color: var(--accent-cyan);
}

.task-type-badge.maintenance {
  background: rgba(234, 88, 12, 0.1);
  color: var(--accent-orange);
}

.task-type-badge.turnover {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-purple);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.task-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.task-meta-item.overdue {
  color: var(--error);
  font-weight: 600;
}

.task-meta-item.due-today {
  color: var(--warning);
  font-weight: 600;
}

.task-property {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-hover);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 102, 204, 0.08);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
}

.task-assignee.unassigned {
  background: rgba(113, 128, 150, 0.1);
  border-color: rgba(113, 128, 150, 0.2);
}

.task-assignee.unassigned .assignee-avatar {
  background: var(--text-muted);
}

.task-assignee.unassigned .assignee-name {
  color: var(--text-muted);
  font-style: italic;
}

.assignee-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
}

.assignee-name {
  font-weight: 600;
  color: var(--text-primary);
}

.assignee-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-left: 0.25rem;
  border-left: 1px solid var(--border);
}

.task-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.task-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-hover);
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-action-btn:hover {
  background: var(--accent-cyan);
  color: white;
}

.task-action-btn.complete {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.task-action-btn.complete:hover {
  background: var(--success);
  color: white;
}

.task-action-btn.in-progress {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.task-action-btn.in-progress:hover {
  background: var(--warning);
  color: white;
}

/* =============================================
   Priority Badges
   ============================================= */

.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-badge.high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.priority-badge.medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.priority-badge.low {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-muted);
}

/* =============================================
   Reservations Grid
   ============================================= */

.reservations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.reservation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.reservation-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.guest-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.confirmation-code {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.confirmed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.status-badge.currently-hosting {
  background: rgba(0, 102, 204, 0.15);
  color: var(--accent-cyan);
}

.status-badge.checked-out {
  background: rgba(113, 128, 150, 0.15);
  color: var(--text-muted);
}

.card-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.detail-value {
  font-weight: 500;
  color: var(--text-primary);
}

.property-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-hover);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* =============================================
   Modal
   ============================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

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

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

/* =============================================
   Empty State & Loading
   ============================================= */

.empty-container {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-message {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   Calendar
   ============================================= */

.calendar-container {
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.calendar-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.calendar-nav button {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.3s ease;
}

.calendar-nav button:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-hover);
}

.calendar-month {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.calendar-day-header {
  background: var(--bg-card);
  padding: 1rem;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.calendar-day {
  background: var(--bg-card);
  min-height: 100px;
  padding: 0.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.calendar-day:hover {
  background: var(--bg-hover);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.today {
  background: rgba(0, 102, 204, 0.08);
}

.day-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.calendar-day.today .day-number {
  color: var(--accent-cyan);
  font-weight: 700;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.calendar-event {
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.checkin {
  background: rgba(16, 185, 129, 0.1);
  border-left: 2px solid #059669;
  color: #059669;
}

.calendar-event.checkout {
  background: rgba(245, 158, 11, 0.1);
  border-left: 2px solid #d97706;
  color: #d97706;
}

.calendar-event.ongoing {
  background: rgba(0, 102, 204, 0.08);
  border-left: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.calendar-event.task {
  background: rgba(124, 58, 237, 0.1);
  border-left: 2px solid var(--accent-purple);
  color: var(--accent-purple);
}

.calendar-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Calendar Controls */
.calendar-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.view-toggle-btn:hover {
  background: var(--bg-hover);
}

.view-toggle-btn.active {
  background: var(--accent-cyan);
  color: white;
}

/* Week View */
.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.calendar-week-day {
  background: var(--bg-card);
  min-height: 300px;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.calendar-week-day:hover {
  background: var(--bg-hover);
}

.calendar-week-day.today {
  background: rgba(0, 102, 204, 0.05);
}

.week-day-header {
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.week-day-name {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.week-day-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.week-day-number.today-number {
  color: var(--accent-cyan);
}

.week-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.week-day-events .calendar-event {
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
}

.event-property {
  font-size: 0.65rem;
  opacity: 0.8;
}

.no-events {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

/* Day View */
.calendar-day-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.day-view-section {
  margin-bottom: 1.5rem;
}

.day-view-section:last-child {
  margin-bottom: 0;
}

.day-view-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.day-view-event {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  border-left: 4px solid;
}

.day-view-event.checkin {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: #059669;
}

.day-view-event.checkout {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: #d97706;
}

.day-view-event.ongoing {
  background: rgba(0, 102, 204, 0.05);
  border-left-color: var(--accent-cyan);
}

.day-view-event.task {
  background: rgba(124, 58, 237, 0.08);
  border-left-color: var(--accent-purple);
}

.day-event-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.day-event-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.day-event-time {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.day-event-property,
.day-event-contact,
.day-event-assignee,
.day-event-dates {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.day-event-priority {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.day-event-priority.priority-high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.day-event-priority.priority-medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.day-event-priority.priority-low {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .card-details {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
  }

  .user-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

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

  .calendar-day {
    min-height: 70px;
  }

  .calendar-event {
    font-size: 0.6rem;
  }

  .pin-digit {
    width: 45px;
    height: 55px;
    font-size: 1.5rem;
  }

  .task-actions {
    flex-direction: column;
  }

  .task-action-btn {
    width: 100%;
    justify-content: center;
  }

  .calendar-header {
    flex-direction: column;
    gap: 1rem;
  }

  .calendar-month {
    font-size: 1.1rem;
    text-align: center;
  }

  .calendar-controls {
    flex-direction: column;
    width: 100%;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle-btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }

  .calendar-nav {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-nav button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .calendar-week-grid {
    grid-template-columns: 1fr;
  }

  .calendar-week-day {
    min-height: auto;
  }

  .week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
  }

  .week-day-number {
    font-size: 1.2rem;
  }
}

/* =============================================
   Admin Panel Styles
   ============================================= */

.admin-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

@media (min-width: 1024px) {
  .admin-panel {
    grid-template-columns: 1fr 2fr;
  }
}

.admin-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  grid-column: 1 / -1;
}

.admin-error p {
  margin: 0.25rem 0;
  color: #dc2626;
}

.error-hint {
  font-size: 0.875rem;
  color: #991b1b !important;
  opacity: 0.8;
}

/* Process Control Section */
.process-control-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.status-loading,
.status-error {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.status-error {
  color: #dc2626;
}

.status-message {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.process-status {
  margin-bottom: 1.5rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.status-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.action-buttons .btn {
  flex: 1;
  min-width: 120px;
}

.btn-success {
  background: #059669;
  color: white;
  border: none;
}

.btn-success:hover:not(:disabled) {
  background: #047857;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-warning {
  background: #f59e0b;
  color: white;
  border: none;
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
}

/* Log Viewer Section */
.log-viewer-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

.log-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.form-select-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  min-width: 140px;
}

.form-input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auto-refresh-toggle input[type="checkbox"] {
  cursor: pointer;
}

.log-display {
  flex: 1;
  background: #1a1a2e;
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  max-height: 500px;
  font-family: 'Space Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.log-loading,
.log-empty {
  padding: 3rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.log-entries {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.log-entry {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.05);
}

.log-timestamp {
  color: #6b7280;
  white-space: nowrap;
  min-width: 180px;
}

.log-level {
  font-weight: 600;
  white-space: nowrap;
  min-width: 70px;
}

.log-source {
  color: #9ca3af;
  white-space: nowrap;
  min-width: 120px;
}

.log-message {
  color: #e5e7eb;
  flex: 1;
  word-break: break-word;
}

.log-entry.log-error .log-level {
  color: #f87171;
}

.log-entry.log-error .log-message {
  color: #fca5a5;
}

.log-entry.log-warn .log-level {
  color: #fbbf24;
}

.log-entry.log-warn .log-message {
  color: #fde68a;
}

.log-entry.log-info .log-level {
  color: #60a5fa;
}

.log-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.confirmation-modal {
  max-width: 500px;
}

/* Mobile responsiveness for admin panel */
@media (max-width: 768px) {
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .status-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    width: 100%;
  }

  .log-filter-bar {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .form-select-sm,
  .form-input-sm {
    width: 100%;
  }

  .filter-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .log-timestamp {
    min-width: auto;
    font-size: 0.75rem;
  }

  .log-source {
    display: none;
  }

  .log-display {
    font-size: 0.75rem;
    max-height: 400px;
  }
}
