/* Lekker OH - Enterprise Responsive Theme */
:root {
  --primary: #0f172a;
  --primary-accent: #2563eb;
  --secondary: #0d9488;
  --bg-main: #f1f5f9;
  --surface: #ffffff;
  --border: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --warning-border: #f59e0b;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --danger-border: #ef4444;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --success-border: #10b981;
  --radius: 8px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: var(--primary);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand-link {
  color: #ffffff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #38bdf8;
}
.brand-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav-item {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.nav-dropdown-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: normal;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}
.nav-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 1200;
  padding: 0.4rem 0;
}
.nav-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: normal;
  font-family: inherit;
  transition: all 0.15s;
}
.nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.nav-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.35rem 0;
}

.nav-admin {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.nav-admin:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff !important;
  border-color: #38bdf8;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.user-info { color: #e2e8f0; }
.user-role { color: #38bdf8; font-size: 0.75rem; }
.user-tenant { color: #94a3b8; font-size: 0.75rem; }
.btn-logout {
  background: #334155;
  color: #f1f5f9;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.btn-logout:hover { background: #475569; }

.content-wrapper {
  flex: 1;
  max-width: 1250px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

/* Alerts */
.messages-container { margin-bottom: 1.25rem; }
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  border-left: 4px solid;
}
.alert-error { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.alert-info { background: #e0f2fe; color: #0369a1; border-color: #0284c7; }

/* Cards & Surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

/* Hero Card for Active In-Flight Visit */
.hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid #334155;
}
.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.hero-badge {
  background: #10b981;
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tables */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.data-table tr:hover { background: #f8fafc; }

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-preflight { background: #e2e8f0; color: #475569; }
.badge-deployment { background: #dbeafe; color: #1e40af; }
.badge-collection { background: #fef3c7; color: #92400e; }
.badge-lab { background: #f3e8ff; color: #6b21a8; }
.badge-qa { background: #ffedd5; color: #9a3412; }
.badge-complete { background: var(--success-bg); color: var(--success-text); }
.badge-void { background: #fee2e2; color: #b91c1c; text-decoration: line-through; }
.badge-drift { background: var(--danger-bg); color: var(--danger-text); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary { background: var(--primary-accent); color: #ffffff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: var(--text-main); border-color: var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: var(--secondary); color: #ffffff; }
.btn-success:hover { background: #0f766e; }
.btn-danger { background: #ef4444; color: #ffffff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #334155;
}
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-main);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* Scanner Webcam Container */
#reader {
  width: 100%;
  max-width: 500px;
  margin: 1rem auto;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: #000;
  min-height: 250px;
}
