:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --success-hover: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warning: #f59e0b;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.08), 0 4px 12px -3px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

.page-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dev Mode Banner */
.dev-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  box-shadow: 0 2px 5px rgba(245, 158, 11, 0.08);
}

.dev-badge {
  font-weight: 700;
  color: #92400e;
}

.dev-actions {
  display: flex;
  gap: 12px;
}

.dev-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.dev-link:hover {
  text-decoration: underline;
}

.dev-link-danger {
  color: #b91c1c;
}

/* Main Card */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.status-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 8px;
}

p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* User Greeting Header */
.user-greeting {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.user-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-tag {
  display: inline-block;
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 6px;
}

.user-tag strong {
  color: #1e293b;
}

.title-tag {
  background: #eef2ff;
  border-color: #e0e7ff;
  color: #3730a3;
}

.title-tag strong {
  color: #312e81;
}

/* Confirmation Prompt & Buttons */
.prompt-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 20px;
}

.btn-group {
  display: flex;
  gap: 14px;
  margin-bottom: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  margin-top: 16px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-success {
  background: var(--success);
  color: #fff;
  flex: 1;
}

.btn-success:hover:not(:disabled) {
  background: var(--success-hover);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  flex: 1;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  padding: 10px 18px;
  width: 100%;
  margin-top: 18px;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-icon {
  font-size: 1.15rem;
}

/* =========================================
   SUCCESS CONFIRMATION SCREEN (DẤU TÍCH LỚN)
   ========================================= */
.success-screen {
  animation: fadeIn 0.3s ease-out;
  padding: 6px 0;
}

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

.large-badge-wrapper {
  margin: 6px auto 16px auto;
  display: flex;
  justify-content: center;
}

.large-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  animation: popScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popScale {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.icon-check {
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 0 0 10px #f0fdf4, 0 10px 25px rgba(22, 163, 74, 0.2);
}

.icon-cross {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 10px #fef2f2, 0 10px 25px rgba(220, 38, 38, 0.2);
}

.success-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.status-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
}

.pill-eat {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pill-not-eat {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Receipt Detail Box */
.receipt-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13.5px;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-label {
  color: var(--text-muted);
  font-weight: 500;
}

.receipt-value {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
}

.receipt-highlight {
  background: #f1f5f9;
  margin: 6px -10px -6px -10px;
  padding: 12px 14px;
  border-radius: 8px;
  border-bottom: none;
}

.receipt-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.time-main {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.time-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

/* Logs Section (Personal logs) */
.logs-card {
  padding: 20px;
  text-align: left;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.logs-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.logs-subtitle {
  font-size: 11px;
  color: #64748b;
}

.btn-refresh {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-refresh:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.logs-table-container {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.logs-table th {
  background: #f8fafc;
  padding: 10px 14px;
  font-weight: 600;
  color: #475569;
  text-align: left;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.logs-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.logs-table tr:last-child td {
  border-bottom: none;
}

.log-time-cell {
  display: flex;
  flex-direction: column;
}

.log-date-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.text-center {
  text-align: center !important;
}

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

.font-bold {
  font-weight: 700;
}

code {
  font-family: monospace;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #334155;
}
