* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: #f0f2f5; color: #1f2937; line-height: 1.6; }

/* Card */
.card { background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04); padding: 24px; margin-bottom: 16px; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-header { font-size: 17px; font-weight: 600; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #f3f4f6; color: #111827; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 10px; border: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; line-height: 1; }
.btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.btn-primary:hover { background: linear-gradient(135deg, #2563eb, #1d4ed8); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.4); }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline { background: #fff; color: #374151; border: 1.5px solid #e5e7eb; }
.btn-outline:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-danger { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { display: flex; width: 100%; text-align: center; padding: 14px; font-size: 16px; }

/* Form */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-input { width: 100%; padding: 11px 14px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; outline: none; transition: all 0.2s; background: #fafafa; }
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); background: #fff; }
.form-input:disabled { background: #f3f4f6; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-green { background: #ecfdf5; color: #059669; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-red { background: #fef2f2; color: #dc2626; }

/* Alert */
.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #059669; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #d97706; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; }

/* Layout */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-gray { color: #6b7280; }
.text-red { color: #dc2626; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Nav */
.nav { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 60px; display: flex; align-items: center; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1200px; margin: 0 auto; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.nav-title { font-size: 18px; font-weight: 700; color: #111827; display: flex; align-items: center; gap: 8px; }
.nav-title span { background: linear-gradient(135deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 10px; align-items: center; }

/* Container */
.container { max-width: 480px; margin: 0 auto; padding: 28px 16px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 28px 16px; }

/* Grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

/* App Icon */
.app-icon { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.app-icon-lg { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.app-icon-placeholder { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, #e0e7ff, #c7d2fe); display: flex; align-items: center; justify-content: center; color: #6366f1; font-size: 20px; font-weight: 600; }
.app-icon-placeholder-lg { width: 72px; height: 72px; border-radius: 18px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #d1d5db; border-radius: 26px; transition: 0.3s; }
.switch .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.switch input:checked + .slider { background: #3b82f6; }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* Progress */
.progress-bar { width: 100%; height: 6px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #8b5cf6); border-radius: 6px; transition: width 0.3s; }

/* QR Code */
.qr-container { display: flex; flex-direction: column; align-items: center; }
.qr-container img { width: 220px; height: 220px; border-radius: 12px; border: 1px solid #f3f4f6; }

/* Install Button */
.install-btn { width: 100%; padding: 16px; font-size: 17px; font-weight: 600; background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; border: none; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 14px rgba(37,99,235,0.35); transition: all 0.2s; }
.install-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.45); }
.install-btn:disabled { background: #c7d2fe; box-shadow: none; cursor: not-allowed; }

/* Version Item */
.version-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #f3f4f6; }
.version-item:last-child { border-bottom: none; }

/* Safari Guide */
.safari-guide { background: linear-gradient(135deg, #fff7ed, #ffedd5); border: 1px solid #fed7aa; border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.safari-guide h4 { color: #c2410c; margin-bottom: 8px; font-size: 15px; }

/* Login Page */
.login-card { background: #fff; border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); padding: 40px 32px; text-align: center; }
.login-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Dashboard Card */
.app-card { cursor: pointer; border: 1.5px solid transparent; }
.app-card:hover { border-color: #3b82f6; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 18px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.empty-state-desc { color: #9ca3af; margin-bottom: 20px; }

/* File Upload */
.file-drop { border: 2px dashed #d1d5db; border-radius: 14px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; background: #fafafa; }
.file-drop:hover { border-color: #3b82f6; background: #eff6ff; }
.file-drop-active { border-color: #3b82f6 !important; background: #eff6ff !important; }
.file-drop-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }
