:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-soft: #1f2937;
  --text: #f9fafb;
  --muted: #cbd5e1;
  --line: #334155;
  --accent: #facc15;
  --accent-dark: #ca8a04;
  --danger: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.connection-status-banner {
  margin-bottom: 1rem;
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-weight: 800;
  text-align: center;
  border: 1px solid var(--line);
}

.connection-online {
  background: rgba(34, 197, 94, 0.14);
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.5);
}

.connection-offline {
  background: rgba(239, 68, 68, 0.14);
  color: #fee2e2;
  border-color: rgba(239, 68, 68, 0.5);
}

.employee-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.employee-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.employee-header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.employee-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.employee-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.employee-brand-text {
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.employee-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
}

.employee-main {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.65rem, 6vw, 2.4rem);
  line-height: 1.08;
}

.page-subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
}

.card-list {
  display: grid;
  gap: 0.85rem;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.card-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge-success {
  color: #dcfce7;
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.14);
}

.badge-missing {
  color: #fee2e2;
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.14);
}

.progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  margin: 0.65rem 0 0.2rem;
}

.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: var(--accent);
}

.info-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.checklist {
  display: grid;
  gap: 0.75rem;
}

.checklist-item {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  text-decoration: none;
}

.checklist-item-title {
  font-size: 1.08rem;
  font-weight: 750;
  margin-bottom: 0.35rem;
}

.instructions {
  color: var(--muted);
  white-space: pre-wrap;
}

.button,
button,
input[type="submit"] {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: #111827;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.button-secondary {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.full-width {
  width: 100%;
}

.action-row {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.employee-form {
  display: grid;
  gap: 1rem;
}

.employee-form input[type="text"],
.employee-form input[type="password"],
.employee-form input[type="email"],
.employee-form textarea {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #020617;
  color: var(--text);
  padding: 0.8rem;
  font: inherit;
}

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

.file-input-panel {
  border: 2px dashed var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: var(--panel);
}

.file-input-panel input[type="file"] {
  width: 100%;
  font-size: 1rem;
}

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

.photo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.75rem;
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}

.muted {
  color: var(--muted);
}

.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 14px;
  padding: 0.8rem;
}

.logout-form {
  margin: 0;
}

.logout-button {
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.selected-photo-status {
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 650;
}

.selected-photo-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.selected-photo-card {
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem;
  overflow: hidden;
}

.selected-photo-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.selected-photo-name {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.remove-selected-photo {
  width: 100%;
  min-height: 40px;
  margin-top: 0.5rem;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.button-disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (min-width: 720px) {
  .selected-photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .employee-main {
    padding: 1.5rem;
  }

  .card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-row {
    grid-template-columns: max-content max-content;
  }
}

.checklist-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.checklist-section-summary {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.checklist-section-summary::-webkit-details-marker {
  display: none;
}

.checklist-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  line-height: 1.2;
}

.checklist-section-progress {
  margin: 0;
  color: var(--muted);
}

.checklist-section-hint {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.92rem;
}

.checklist-section-hint::before {
  content: "▸ ";
}

.checklist-section[open] .checklist-section-hint::before {
  content: "▾ ";
}

.checklist-section[open] .checklist-section-hint {
  color: var(--muted);
}

.checklist-section[open] .checklist-section-hint {
  font-size: 0;
}

.checklist-section[open] .checklist-section-hint::after {
  content: "Tap to hide items";
  font-size: 0.92rem;
}

.checklist-section-items {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.checklist-item-nested {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.checklist-item-nested:last-child {
  border-bottom: 0;
}

.empty-section-message {
  padding: 1rem;
  color: var(--muted);
}

.upload-item-heading {
  margin-bottom: 1rem;
}

.upload-item-number {
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.upload-item-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.pending-uploads-panel {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.pending-uploads-panel h3 {
  margin: 0 0 0.5rem;
}

.pending-uploads-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.pending-upload-card {
  background: #020617;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem;
  overflow: hidden;
}

.pending-upload-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.pending-upload-details {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
}

.pending-upload-details p {
  margin: 0;
}

@media (min-width: 720px) {
  .pending-uploads-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pending-upload-state {
  color: var(--accent);
  font-weight: 800;
}

.pending-upload-error {
  color: #fecaca;
}

.pending-upload-failed {
  border-color: rgba(239, 68, 68, 0.55);
}

.pending-upload-syncing {
  opacity: 0.75;
}

.pending-global-sync-panel {
  margin-bottom: 1rem;
}
