:root {
  --primary-color: #005a3c; /* Agribank Green */
  --primary-hover: #00452e;
  --secondary-color: #8b0000; /* Agribank Dark Red */
  --accent-color: #c5a059; /* Gold */
  --bg-color: #f4f7f6;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 40px;
}

.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #00452e 100%);
  color: white;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--accent-color);
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.header p {
  font-size: 0.875rem;
  opacity: 0.9;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tabs */
.scan-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.scan-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  text-align: center;
}

.scan-tab.active {
  background: #e6f4ea;
  color: var(--primary-color);
}

/* Camera Scanner Viewport & Overlay */
.scanner-viewport-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#reader {
  width: 100% !important;
  border: none !important;
}

#reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: none !important; /* Strictly no CSS scaling to preserve 1:1 camera sharpness */
}

/* Beautiful Bank-Grade Viewfinder Overlay */
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.scanner-target-box {
  width: min(240px, 70vw);
  height: min(240px, 70vw);
  position: relative;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.45);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.scanner-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #00a86b; /* Vibrant green */
  border-style: solid;
}
.scanner-corner.tl { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 10px; }
.scanner-corner.tr { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 10px; }
.scanner-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 10px; }
.scanner-corner.br { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 10px; }

.scanner-laser {
  position: absolute;
  left: 3%;
  width: 94%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00e676, #69f0ae, #00e676, transparent);
  box-shadow: 0 0 8px #00e676, 0 0 16px #69f0ae;
  border-radius: 2px;
  animation: scanLaserAnim 2s infinite ease-in-out;
}

@keyframes scanLaserAnim {
  0% { top: 6%; opacity: 0.2; }
  50% { top: 92%; opacity: 1; }
  100% { top: 6%; opacity: 0.2; }
}

.scanner-tip-badge {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.scanner-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* Camera Controls Toolbar */
.camera-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 12px;
}

.btn-tool {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-tool:hover {
  background: #e2e8f0;
}

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

/* Position Guidance Box */
.guide-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 10px;
}

/* 2-Side CCCD Capture Cards */
.capture-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

@media (max-width: 540px) {
  .capture-cards-grid {
    grid-template-columns: 1fr;
  }
}

.capture-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.capture-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.capture-preview-box {
  background: #e2e8f0;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.capture-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* File Upload Button */
.upload-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.upload-box:hover {
  border-color: var(--primary-color);
}

.upload-box svg {
  width: 48px;
  height: 48px;
  stroke: var(--primary-color);
  margin-bottom: 8px;
}

.upload-box p {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.upload-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.required {
  color: var(--secondary-color);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 90, 60, 0.15);
}

input[readonly] {
  background-color: #f9fafb;
  color: #4b5563;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

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

.btn-accent:hover {
  background-color: #6b0000;
}

/* Status / Alert */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Success Card */
.success-screen {
  text-align: center;
  padding: 30px 16px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background-color: #d1fae5;
  color: var(--success-color);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.success-screen h2 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.success-screen p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* Admin Dashboard Specific */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.qr-display-box {
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.qr-display-box img {
  max-width: 240px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-bottom: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

/* Table */
.table-container {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

th {
  background-color: #f9fafb;
  padding: 12px 14px;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

tr:hover {
  background-color: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-pending {
  background-color: #fef3c7;
  color: #92400e;
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Step 2: CCCD Photo Verification & Quality Styles */
.photo-capture-section {
  margin-top: 18px;
}

.photo-capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 580px) {
  .photo-capture-grid {
    grid-template-columns: 1fr;
  }
}

.photo-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.photo-card.valid {
  border-color: #10b981;
  background: #f0fdf4;
}

.photo-card.invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.photo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.photo-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.photo-preview-container {
  width: 100%;
  aspect-ratio: 1.58 / 1;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.photo-card.valid .photo-preview-container {
  border: 2px solid #10b981;
}

.photo-card.invalid .photo-preview-container {
  border: 2px solid #ef4444;
}

.photo-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}

.photo-qc-alert {
  display: none;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.photo-qc-alert.show {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.photo-guide-note {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.3;
}

.badge-error {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-checking {
  background-color: #e0f2fe;
  color: #0369a1;
}

/* Admin Photo Modal & Thumbnails */
.btn-photo-view {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-photo-view:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.photo-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.photo-modal-box {
  background: white;
  border-radius: var(--radius-md);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.photo-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  color: #1e293b;
}

.photo-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 0 6px;
}

.photo-modal-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #000;
}

/* Auto Capture Countdown Overlay (Ported from Agribank_App_v2) */
.auto-capture-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  text-align: center;
  padding: 16px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: var(--radius-md);
  animation: fadeInOverlay 0.25s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.auto-capture-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #34d399;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  padding: 0 10px;
}

.auto-capture-countdown {
  font-weight: 900;
  font-size: 4.2rem;
  line-height: 1;
  color: #fbbf24;
  text-shadow: 0 2px 16px rgba(251, 191, 36, 0.5);
  animation: pulseCountdown 1s infinite;
}

@keyframes pulseCountdown {
  0% { transform: scale(1.1); }
  50% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.auto-capture-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  max-width: 90%;
  line-height: 1.4;
  padding: 0 10px;
}

.auto-capture-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.auto-capture-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auto-capture-btn.snap-now {
  background: #059669;
  border-color: #34d399;
}

.auto-capture-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Card Framing Guide Overlay */
.card-frame-guide {
  position: absolute;
  width: 86%;
  aspect-ratio: 85.6 / 53.98;
  max-width: 380px;
  border: 2px dashed #34d399;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45);
  pointer-events: none;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  z-index: 12;
}

.card-frame-guide-label {
  background: rgba(6, 95, 70, 0.85);
  color: #d1fae5;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

/* Admin CCCD Thumbnails in Table */
.cccd-thumb-pair {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cccd-thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cccd-thumb-box {
  width: 76px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  background: #0f172a;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.cccd-thumb-box:hover {
  transform: scale(1.12);
  border-color: #005a3c;
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
  z-index: 10;
}
.cccd-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cccd-thumb-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cccd-thumb-label.front {
  color: #0369a1;
}
.cccd-thumb-label.back {
  color: #475569;
}

/* Admin CCCD Gallery / Card View */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
  padding: 16px;
}
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
.gallery-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s;
}
.gallery-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.gallery-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}
.gallery-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.gallery-card-sub {
  font-size: 0.85rem;
  color: #64748b;
  font-family: monospace;
  font-weight: 600;
  margin-top: 2px;
}
.gallery-card-meta {
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery-card-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.gallery-photo-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gallery-photo-frame {
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  background: #0f172a;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
}
.gallery-photo-frame:hover {
  transform: scale(1.02);
  border-color: #005a3c;
}
.gallery-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-photo-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  text-align: center;
}
.gallery-photo-tag.front {
  background: #e0f2fe;
  color: #0369a1;
}
.gallery-photo-tag.back {
  background: #f1f5f9;
  color: #475569;
}

/* ==========================================================================
   Live Card Camera Modal with CCCD Guide Frame
   ========================================================================== */
.card-camera-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-camera-modal-content {
  background: #0f172a;
  width: 100%;
  max-width: 520px;
  height: 100%;
  max-height: 96vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
}

@media (max-width: 600px) {
  .card-camera-modal-content {
    max-height: 100vh;
    border-radius: 0;
  }
}

.card-camera-header {
  padding: 14px 18px;
  background: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  z-index: 10;
}

.card-camera-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.15s;
}

.card-camera-close-btn:hover {
  color: #ffffff;
}

.card-camera-viewport {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.card-camera-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-camera-frame-box {
  position: absolute;
  width: 88%;
  aspect-ratio: 85.6 / 53.98;
  max-height: 74%;
  border: 2px dashed #22c55e;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.58);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
}

.frame-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: #22c55e;
  border-style: solid;
}

.frame-corner.top-left {
  top: -2px; left: -2px;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 14px;
}

.frame-corner.top-right {
  top: -2px; right: -2px;
  border-width: 4px 4px 0 0;
  border-top-right-radius: 14px;
}

.frame-corner.bottom-left {
  bottom: -2px; left: -2px;
  border-width: 0 0 4px 4px;
  border-bottom-left-radius: 14px;
}

.frame-corner.bottom-right {
  bottom: -2px; right: -2px;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 14px;
}

.frame-guide-text {
  background: rgba(0, 90, 60, 0.92);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  text-align: center;
}

.card-camera-footer {
  padding: 16px 20px 24px;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.card-camera-shutter-btn {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #cbd5e1;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

.card-camera-shutter-btn:active {
  transform: scale(0.90);
}

.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #005a3c;
  transition: background 0.15s;
}

.card-camera-shutter-btn:hover .shutter-inner {
  background: #15803d;
}

.card-camera-tool-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
}


