/* ==========================================================================
   IT Asset Collector - Modern Enterprise Mobile PWA Styles
   Designed for Android & Desktop with rich glassmorphism & dynamic aesthetics
   ========================================================================== */

:root {
  --bg-main: #070b14;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-card-subtle: rgba(30, 41, 59, 0.6);
  --border-subtle: #1e293b;
  --border-focus: #0ea5e9;
  --border-glow: rgba(14, 165, 233, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #06b6d4;
  --accent-sky: #0ea5e9;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.25);

  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: calc(75px + var(--safe-bottom));
}

/* ==========================================================================
   Header / App Bar
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.brand-title-wrap h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-install {
  display: none;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
  transition: transform 0.15s ease;
}

.btn-header-install:active {
  transform: scale(0.96);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.status-badge.server-active {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.35);
}

.status-badge.server-active .status-dot {
  background-color: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}

.status-badge.offline {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.status-badge.offline .status-dot {
  background-color: #f59e0b;
  animation: none;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.app-container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* ==========================================================================
   Section & Card Styling
   ========================================================================== */
.section-header {
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.asset-card:hover {
  border-color: rgba(14, 165, 233, 0.4);
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.card-icon.emp { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.card-icon.cpu { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.card-icon.monitor { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.card-icon.keyboard { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
.card-icon.mouse { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.card-icon.misc { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.card-title-bar h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: #ffffff;
}

.badge-required {
  font-size: 0.68rem;
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
}

/* ==========================================================================
   Form Fields & Input Groups
   ========================================================================== */
.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.input-with-action input {
  flex: 1;
}

input[type="text"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #ffffff;
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #475569;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  background-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.highlight-glow {
  animation: glowPulse 1.2s ease-out;
}

@keyframes glowPulse {
  0% { background-color: rgba(6, 182, 212, 0.35); border-color: #22d3ee; }
  100% { background-color: rgba(15, 23, 42, 0.85); border-color: #334155; }
}

/* Scan & Photo Buttons */
.btn-scan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
  transition: all 0.15s ease;
}

.btn-scan:active {
  transform: scale(0.96);
}

.btn-scan svg {
  width: 18px;
  height: 18px;
}

/* Photo Action Row */
.photo-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #334155;
}

.btn-camera-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.btn-camera-upload:hover,
.btn-camera-upload:active {
  color: #ffffff;
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
}

.btn-camera-upload input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.btn-camera-upload svg {
  width: 15px;
  height: 15px;
}

/* Photo Previews */
.photo-preview-container {
  display: none;
  align-items: center;
  gap: 10px;
}

.photo-thumb-wrapper {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.photo-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  font-size: 0.58rem;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 0;
}

.btn-remove-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #f43f5e;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.photo-loading {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(6, 182, 212, 0.3);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Form Action Buttons */
.form-submit-bar {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.btn-primary {
  flex: 2;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  transition: all 0.2s ease;
}

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

.btn-secondary {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:active {
  background: var(--bg-card-hover);
  color: #ffffff;
}

/* ==========================================================================
   Records List View
   ========================================================================== */
.records-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-input-wrap input {
  padding-left: 42px;
}

.filter-row {
  display: flex;
  gap: 10px;
}

.filter-row select {
  flex: 1;
}

.record-count-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.record-item-card:hover {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.record-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.record-emp-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
}

.record-emp-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.record-badge-dept {
  font-size: 0.7rem;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.record-serials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.serial-pill {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
}

.serial-pill-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.serial-pill-val {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  padding-top: 10px;
}

.record-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.record-actions {
  display: flex;
  gap: 6px;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid #334155;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-action:hover,
.btn-icon-action:active {
  color: #ffffff;
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.2);
}

.btn-icon-action.delete:hover,
.btn-icon-action.delete:active {
  color: #f43f5e;
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  color: #334155;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 320px;
  margin: 0 auto 18px;
}

/* ==========================================================================
   Dashboard View
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.blue::after { background: var(--accent-sky); }
.stat-card.green::after { background: var(--accent-emerald); }
.stat-card.amber::after { background: var(--accent-amber); }
.stat-card.cyan::after { background: var(--accent-cyan); }

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-title {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.hardware-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}

.hardware-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.hardware-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hardware-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.hardware-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Settings & Export View
   ========================================================================== */
.settings-group {
  margin-bottom: 24px;
}

.settings-group-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 10px;
}

.settings-list {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover,
.settings-item:active {
  background-color: var(--bg-card-hover);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.settings-text h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.settings-text p {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.settings-chevron {
  color: var(--text-muted);
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px calc(8px + var(--safe-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.15s ease;
}

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

.nav-item.active svg {
  transform: translateY(-2px);
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 22%;
  background: var(--accent-cyan);
  color: #070b14;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Camera Barcode Scanner Modal
   ========================================================================== */
.scanner-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background-color: #000000;
  flex-direction: column;
}

.scanner-modal.active {
  display: flex;
}

.scanner-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scanner-target-pill {
  background: rgba(14, 165, 233, 0.9);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.5);
}

.scanner-header-buttons {
  display: flex;
  gap: 10px;
}

.scanner-btn-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scanner-btn-circle:active {
  transform: scale(0.92);
}

.scanner-btn-circle.active {
  background: #f59e0b;
  color: #000000;
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

.scanner-video-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reticle / Viewfinder Frame */
.scanner-reticle-box {
  position: absolute;
  width: 270px;
  height: 270px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.reticle-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--accent-cyan);
  border-style: solid;
}

.reticle-corner.tl { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 18px; }
.reticle-corner.tr { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 18px; }
.reticle-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 18px; }
.reticle-corner.br { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 18px; }

/* Laser Scan Line */
.laser-line {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #06b6d4, #22d3ee, #10b981, transparent);
  box-shadow: 0 0 12px #22d3ee;
  border-radius: 2px;
  animation: laserScan 2.2s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 15px; }
  100% { top: 250px; }
}

.scanner-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 16px 20px calc(24px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  text-align: center;
}

.scanner-status {
  font-size: 0.88rem;
  color: #ffffff;
  margin-bottom: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.manual-entry-row {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.manual-entry-row input {
  background: rgba(15, 23, 42, 0.9);
}

/* ==========================================================================
   Lightbox / Fullscreen Photo Modal
   ========================================================================== */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1100;
  background-color: rgba(0, 0, 0, 0.95);
  flex-direction: column;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-header {
  padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  object-fit: contain;
}

/* ==========================================================================
   Details Modal / Slide-up Sheet
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 900;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 20px calc(24px + var(--safe-bottom));
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: #334155;
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: calc(85px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  border-left: 4px solid var(--accent-sky);
  animation: toastIn 0.25s ease-out forwards;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.error { border-left-color: var(--accent-rose); }
.toast.info { border-left-color: var(--accent-sky); }

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

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

/* ==========================================================================
   Sync Badges & Status Banners
   ========================================================================== */
.badge-offline-photo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.badge-offline-photo:hover {
  background: rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.badge-saved-disk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.pending-sync-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pending-sync-banner-text {
  font-size: 0.82rem;
  color: #fbbf24;
  line-height: 1.4;
}

.pending-sync-banner-text strong {
  color: #ffffff;
}

.pending-sync-btn {
  background: #f59e0b;
  color: #000000;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease;
}

.pending-sync-btn:active {
  transform: scale(0.95);
}

.file-protocol-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(14, 165, 233, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: #bae6fd;
}

.file-protocol-banner a {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline;
}
