/* VIVA Engineering - Mobile-First Styles */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --border: #e2e8f0;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --warning: #f59e0b;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─── */
header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white;
  text-align: center;
  padding: 1rem 1rem 0.8rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

header h1 {
  font-size: 1.3rem;
  margin-bottom: 0.15rem;
  letter-spacing: 0.5px;
}

header p {
  opacity: 0.75;
  font-size: 0.8rem;
}

/* ─── Navigation Bar ─── */
.nav-bar {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn:active {
  background: var(--bg);
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

.nav-icon {
  font-size: 1.1rem;
}

/* ─── Main Layout ─── */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
}

/* ─── Cards ─── */
.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s ease;
}

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

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

/* ─── Badge ─── */
.badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  margin-left: 0.3rem;
}

/* ─── Loading State ─── */
.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Form Elements ─── */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

select,
input[type="date"],
input[type="number"],
input[type="text"],
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: white;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

/* Custom dropdown arrow for select */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.5rem;
}

select:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

/* ─── Checkbox Group (維修類別) ─── */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  user-select: none;
  -webkit-user-select: none;
}

.checkbox-item:hover {
  background: var(--primary-light);
}

.checkbox-item:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ─── AC Equipment Group ─── */
.ac-equipment-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ac-equip-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.ac-equip-row.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.ac-equip-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.ac-equip-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.ac-equip-row .ac-qty-wrapper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ac-equip-row .ac-qty-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.ac-equip-row input[type="number"] {
  width: 60px;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  text-align: center;
  border-radius: 6px;
}

/* ─── Photo Upload Area ─── */
.photo-upload-area {
  position: relative;
}

.photo-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
  font-size: 0.95rem;
  min-height: 100px;
}

.photo-upload-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.photo-upload-btn .upload-icon {
  font-size: 2rem;
}

.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* ─── Photo Preview Grid ─── */
.photo-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-preview-item .remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.photo-preview-item .remove-photo:hover {
  background: var(--error);
}

/* ─── Photo Remark Input (upload) ─── */
.photo-preview-item .photo-remark-input {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 3px 6px;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.7rem;
  line-height: 1.3;
  outline: none;
  font-family: inherit;
  z-index: 2;
}

.photo-preview-item .photo-remark-input::placeholder {
  color: rgba(255,255,255,0.6);
}

/* ─── Photo Remark Display (detail page) ─── */
.photo-item .photo-remark {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

/* ─── Submit Button ─── */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 0.5rem;
  min-height: 52px;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* ─── Secondary / Danger Buttons ─── */
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
}

.btn-secondary:hover {
  background: var(--border);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
  width: auto;
  flex: 1;
  box-shadow: 0 4px 12px rgba(220,38,38,0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220,38,38,0.35);
}

.btn-danger:active {
  transform: translateY(0) scale(0.98);
}

.btn-danger:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

/* ─── Status Message ─── */
.status-msg {
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease;
}

.status-msg.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-msg.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
}

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

/* ─── Report List Cards ─── */
.report-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.report-card-link > a.report-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.report-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  border-left: 4px solid var(--primary);
  transition: all 0.2s;
}

.report-card:active {
  box-shadow: var(--shadow-lg);
  transform: scale(0.99);
}

.report-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.report-card-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.report-card-bottom {
  display: flex;
  justify-content: flex-end;
}

.report-location {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.report-shop {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.report-date {
  color: var(--text-light);
  font-size: 0.82rem;
}

.report-type {
  color: var(--text-light);
  font-size: 0.88rem;
}

.report-id {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
}

.report-created {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.report-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.report-card .location { font-weight: 600; }
.report-card .date { color: var(--text-light); font-size: 0.82rem; }
.report-card .detail { color: var(--text-light); font-size: 0.85rem; }

.report-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
}

.tag-ac {
  background: #fef3c7;
  color: #92400e;
}

.tag-photo {
  background: #f0fdf4;
  color: #166534;
}

/* ─── Empty / Error States ─── */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.error-state {
  color: var(--error);
}

/* ─── Report Detail Page ─── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 1rem;
  background: var(--card-bg);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-back:active {
  background: var(--primary-light);
  transform: scale(0.98);
}

.detail-card {
  margin-bottom: 1rem;
}

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

.detail-header h2 {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
  font-size: 1.25rem;
}

.detail-date {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.detail-label {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
}

.detail-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.detail-value .tag {
  font-size: 0.82rem;
  padding: 0.2rem 0.6rem;
}

/* ─── AC Detail List ─── */
.ac-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ac-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}

.ac-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.ac-qty {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

/* ─── AC Photo Upload Sections (Dynamic) ─── */
.ac-photos-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.ac-unit-photo-group {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid #2196F3;
}

.ac-unit-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.ac-photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ac-photo-half {
  min-width: 0;
}

.ac-photo-half .photo-upload-area {
  min-height: 80px;
}

.ac-upload-btn {
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
}

/* ─── AC Photos Detail Page (Before/After pairs) ─── */
.ac-unit-photos-card {
  margin-bottom: 1rem;
}

.ac-unit-photos-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.ac-photos-pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ac-photos-pair-half h4 {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.ac-photos-pair-half .photos-grid {
  grid-template-columns: 1fr;
}

/* ─── Photos Grid (Detail Page) ─── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.photo-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}

.photo-item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  z-index: 2;
}

.photo-item:active {
  transform: scale(0.98);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.05);
}

/* ─── Lightbox ─── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: lightboxFadeIn 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: lightboxZoomIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes lightboxZoomIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 1001;
  backdrop-filter: blur(4px);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.1);
}

/* ─── Lightbox Navigation ─── */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 1001;
  line-height: 1;
  padding: 0;
  backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ─── Lightbox Counter ─── */
.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1001;
  background: rgba(0,0,0,0.4);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* ─── Detail Actions ─── */
.detail-actions {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ─── Photo Card ─── */
.photo-card {
  border-left: 4px solid var(--primary);
}

/* ─── Compression Progress ─── */
.compress-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--primary-light);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 0.5rem;
  animation: slideDown 0.2s ease;
}

.compress-progress .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
  margin: 0;
}

/* ─── PDF Download Button ─── */
.btn-pdf {
  background: linear-gradient(135deg, #2c7be5, #4a9af5);
  color: white;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-height: 48px;
  flex: 1;
  box-shadow: 0 4px 12px rgba(44,123,229,0.3);
  position: relative;
  overflow: hidden;
}

.btn-pdf::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn-pdf:hover {
  background: linear-gradient(135deg, #1a5ec4, #3a8ae5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44,123,229,0.4);
}

.btn-pdf:hover::after {
  width: 200px;
  height: 200px;
}

.btn-pdf:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(44,123,229,0.3);
}

.btn-pdf:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Word Download Button ─── */
.btn-word {
  background: linear-gradient(135deg, #217346, #2d9a5e);
  color: white;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-height: 48px;
  flex: 1;
  box-shadow: 0 4px 12px rgba(33,115,70,0.3);
  position: relative;
  overflow: hidden;
}

.btn-word::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn-word:hover {
  background: linear-gradient(135deg, #1a6339, #248a50);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33,115,70,0.4);
}

.btn-word:hover::after {
  width: 200px;
  height: 200px;
}

.btn-word:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(33,115,70,0.3);
}

.btn-word:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Delete Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.modal-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions .btn-secondary,
.modal-actions .btn-danger {
  flex: 1;
  min-height: 48px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Utility ─── */
.hidden { display: none !important; }

/* ─── Existing Photo Badge (edit mode) ─── */
.existing-photo-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── Responsive: Tablet+ ─── */
@media (min-width: 640px) {
  main { padding: 1.5rem; }

  .card {
    padding: 1.5rem;
  }

  header h1 { font-size: 1.5rem; }

  .photo-preview {
    grid-template-columns: repeat(4, 1fr);
  }

  .photos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

/* ─── Responsive: Small phones ─── */
@media (max-width: 360px) {
  .form-row {
    grid-template-columns: 1fr;
  }

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

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

  .checkbox-item {
    padding: 0.45rem 0.7rem;
    font-size: 0.88rem;
  }

  .nav-btn {
    font-size: 0.88rem;
    padding: 0.75rem 0.5rem;
  }
}

/* ════════════════════════════════════════════════════════════════
   ── EMPLOYEE MANAGER STYLES ──
   ════════════════════════════════════════════════════════════════ */

/* Old user-info styles removed — login is now via floating button */

/* Login Modal */
.login-modal-content {
  max-width: 380px;
}

.login-modal-content h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-modal-content input {
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5em;
  padding: 0.8rem;
}

/* Modal - generic */
.modal-content {
  display: none;
}

/* Sidebar */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 1000;
  transition: background 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  background: rgba(0,0,0,0.4);
  pointer-events: auto;
}

.sidebar-overlay:not(.hidden) {
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  right: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: white;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.sidebar-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.sidebar-close:hover {
  opacity: 1;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: var(--border);
}

.btn-action.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-action.btn-primary:hover {
  background: var(--primary-dark);
}

/* Employees List */
.employees-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.employee-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s;
}

.employee-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.1);
}

.employee-info h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.employee-role {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
}

.employee-phone {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.employee-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit,
.btn-delete {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-edit:hover {
  background: var(--primary);
  color: white;
}

.btn-delete {
  background: var(--error-bg);
  color: var(--error);
}

.btn-delete:hover {
  background: var(--error);
  color: white;
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-light);
}

.empty-state p {
  margin-bottom: 1rem;
}

/* Modal Improvements */
.modal .form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal .form-actions button {
  flex: 1;
}

.modal .btn-secondary {
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal .btn-secondary:hover {
  background: var(--border);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: white;
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  font-weight: 500;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: var(--success);
  color: white;
}

.toast-error {
  background: var(--error);
  color: white;
}

.toast-info {
  background: var(--primary);
  color: white;
}

.toast-warning {
  background: var(--warning);
  color: white;
}

/* Mobile Adjustments for Sidebar */
@media (max-width: 640px) {
  .sidebar {
    width: 100%;
    max-width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════════
   ── FLOATING LOGIN BUTTON (左上角) ──
   ════════════════════════════════════════════════════════════════ */

.floating-login-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #2c5f8a);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.floating-login-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(26,115,232,0.4);
}

.floating-login-btn:active {
  transform: scale(0.95);
}

.floating-login-btn.logged-in {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(255,255,255,0.4);
}

.floating-login-icon {
  font-size: 1.3rem;
}

.floating-login-avatar {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════
   ── USER MENU DROPDOWN ──
   ════════════════════════════════════════════════════════════════ */

.user-menu-dropdown {
  position: fixed;
  top: 66px;
  left: 12px;
  z-index: 201;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  min-width: 200px;
  overflow: hidden;
  animation: menuFadeIn 0.2s ease;
  border: 1px solid var(--border);
}

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

.user-menu-header {
  padding: 1rem 1rem 0.75rem;
  background: linear-gradient(135deg, #f8fafc, #f0f4f8);
}

.user-menu-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.user-menu-role {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: none;
  border: none;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.user-menu-item:hover {
  background: var(--primary-light);
}

.user-menu-item:active {
  background: #d0e2f7;
}

.user-menu-item-danger {
  color: var(--danger);
}

.user-menu-item-danger:hover {
  background: var(--error-bg);
}

/* ════════════════════════════════════════════════════════════════
   ── LOGIN MODAL ──
   ════════════════════════════════════════════════════════════════ */

.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}

.login-modal-card {
  background: white;
  border-radius: 16px;
  padding: 2rem 1.75rem 1.5rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  position: relative;
  animation: cardSlideUp 0.3s ease;
}

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

.login-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.login-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.login-modal-icon {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.login-modal-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.login-modal-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pin-input-group {
  position: relative;
  width: 100%;
}

.pin-input {
  width: 100% !important;
  padding: 16px !important;
  font-size: 24px !important;
  text-align: center;
  letter-spacing: 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}

/* 移除 number input 嘅 spinner */
.pin-input::-webkit-outer-spin-button,
.pin-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pin-input[type=number] {
  -moz-appearance: textfield;
}

.pin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 77, 125, 0.15);
}

.pin-input::placeholder {
  color: var(--text-light);
  letter-spacing: 1px;
  font-size: 16px;
}

.login-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.login-submit-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
}
  text-align: center;
  letter-spacing: 0.5em;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.pin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,115,232,0.15);
  background: white;
}

.login-submit-btn {
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 52px;
  letter-spacing: 0.5px;
}

.login-submit-btn:hover {
  background: linear-gradient(135deg, #1557b0, #0d47a1);
}

.login-submit-btn:active {
  transform: scale(0.98);
}

.login-submit-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.login-error {
  text-align: center;
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem;
  background: var(--error-bg);
  border-radius: 8px;
  margin-top: 0.5rem;
}

/* ════════════════════════════════════════════════════════════════
   ── WELCOME OVERLAY ──
   ════════════════════════════════════════════════════════════════ */

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.welcome-overlay.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.welcome-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: cardSlideUp 0.4s ease;
}

.welcome-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #10b981);
  color: white;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.welcome-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.welcome-role {
  font-size: 0.95rem;
  color: var(--text-light);
}

.welcome-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  margin: 1.25rem 0;
}

.welcome-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════
   ── HEADER WELCOME TEXT ──
   ════════════════════════════════════════════════════════════════ */

.header-welcome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.header-welcome-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.header-welcome-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

/* ════════════════════════════════════════════════════════════════
   ── SIDEBAR OVERLAY ──
   ════════════════════════════════════════════════════════════════ */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 1000;
  transition: background 0.3s ease;
}

.sidebar-overlay.active {
  background: rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════════════════════════════
   ── RESPONSIVE: LOGIN UI ──
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .floating-login-btn {
    width: 44px;
    height: 44px;
    top: 10px;
    left: 10px;
  }

  .floating-login-icon {
    font-size: 1.15rem;
  }

  .floating-login-avatar {
    font-size: 1rem;
  }

  .user-menu-dropdown {
    top: 60px;
    left: 10px;
    min-width: 180px;
  }

  .login-modal-card {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .welcome-card {
    padding: 2rem 1.5rem;
  }

  .welcome-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
  .sidebar {
    background: #1f2937;
  }

  .employee-card {
    background: #374151;
    border-color: #4b5563;
  }

  .employee-info h4 {
    color: white;
  }

  .login-modal-card,
  .welcome-card,
  .user-menu-dropdown {
    background: #1f2937;
  }

  .login-modal-title,
  .welcome-name,
  .user-menu-name {
    color: white;
  }

  .login-modal-subtitle,
  .welcome-role,
  .welcome-hint,
  .user-menu-role,
  .user-menu-item {
    color: #d1d5db;
  }
}

/* Mobile adjustments for employee cards */
@media (max-width: 640px) {
  .employee-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .employee-actions {
    width: 100%;
    margin-top: 0.5rem;
  }

  .btn-edit,
  .btn-delete {
    flex: 1;
    text-align: center;
  }
}

/* ─── Lock Overlay ─── */
.lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lock-overlay.hidden {
  display: none;
}

.lock-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: lockSlideUp 0.3s ease-out;
}

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

.lock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.lock-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.lock-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.lock-login-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
}

.lock-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.lock-login-btn:active {
  transform: translateY(0);
}

/* 鎖定介面輸入框 */
#lock-pin-input {
  width: 100% !important;
  padding: 16px !important;
  font-size: 32px !important;
  text-align: center !important;
  letter-spacing: 4px !important;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: white !important;
  color: #333 !important;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: textfield;
  -webkit-text-security: disc !important;
  outline: none;
  transition: border-color 0.2s;
  font-weight: 700 !important;
}

#lock-pin-input:focus {
  border-color: #1B4D7D;
  box-shadow: 0 0 0 3px rgba(27, 77, 125, 0.15);
}

#lock-pin-input::placeholder {
  color: #aaa;
  letter-spacing: 1px;
  font-size: 16px;
}

#lock-error {
  display: none;
  margin-top: 12px;
  padding: 10px;
  background: #FEE2E2;
  border-radius: 8px;
  font-size: 14px;
}

/* Dark mode lock overlay */
@media (prefers-color-scheme: dark) {
  .lock-card {
    background: #1f2937;
  }

  .lock-title {
    color: white;
  }

  .lock-subtitle {
    color: #9ca3af;
  }
}

/* ─── Nav button disabled state (未登入) ─── */
.nav-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── Report list login prompt ─── */
.reports-login-prompt {
  text-align: center;
  padding: 3rem 1.5rem;
}

.reports-login-prompt .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.reports-login-prompt h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.reports-login-prompt p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ─── Detail page login prompt ─── */
.detail-login-prompt {
  text-align: center;
  padding: 3rem 1.5rem;
}

.detail-login-prompt .login-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.detail-login-prompt h2 {
  margin-bottom: 0.5rem;
}

.detail-login-prompt p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
