/* ==============================
   RyokLabs App Store - Styles
   ============================== */

:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-input: #f3f4f6;
  --bg-header: rgba(255, 255, 255, 0.75);
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #10b981;
  --accent-hover: #059669;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --radius: 16px;
  --radius-sm: 12px;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --gap: 20px;
  --max-w: 1200px;
  --header-h: 110px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --bg-card: #16181d;
  --bg-input: #1f2229;
  --bg-header: rgba(15, 17, 21, 0.75);
  --text: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #10b981;
  --accent-hover: #34d399;
  --border: #272a30;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --danger: #f87171;
  --danger-hover: #ef4444;
  --success: #34d399;
  --warning: #fbbf24;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* Theme button */
.theme-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.theme-btn:hover { background: var(--bg-input); }

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* ==============================
   Header
   ============================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px var(--gap) 12px;
}

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

.logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  gap: 10px;
  transition: border 0.2s;
  border: 1.5px solid transparent;
}
.search-bar:focus-within { border-color: var(--accent); }

.search-icon { color: var(--text-muted); flex-shrink: 0; }

#search-input {
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}
#search-input::placeholder { color: var(--text-muted); }

/* ==============================
   Content / Grid
   ============================== */
.content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.app-card:active { transform: scale(0.97); }

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }

.app-info { min-width: 0; flex: 1; }

.app-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-short-desc {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.app-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.rating-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.review-count {
  font-size: 11px;
  color: var(--text-muted);
}

.no-rating {
  font-size: 12px;
  color: var(--text-muted);
}

.app-size {
  font-size: 12px;
  color: var(--text-muted);
}

/* Stars */
.stars-display {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--warning);
}

.star.filled { color: var(--warning); }
.star.half { color: var(--warning); }
.star.empty { color: var(--border); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ==============================
   Detail View
   ============================== */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.back-btn:hover { background: var(--bg-input); }

.detail-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
  box-shadow: var(--shadow);
}
.detail-icon img { width: 100%; height: 100%; object-fit: cover; }

.detail-meta h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-size {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rating-text-lg {
  font-size: 16px;
  font-weight: 700;
}

.review-count-lg {
  font-size: 13px;
  color: var(--text-muted);
}

.detail-section { margin-bottom: 24px; }

.detail-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-section p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.screenshots-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.screenshots-row::-webkit-scrollbar { height: 4px; }
.screenshots-row::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 4px; }
.screenshots-row::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

.screenshot {
  flex-shrink: 0;
  width: 140px;
  height: 250px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
  cursor: pointer;
  scroll-snap-align: start;
}
.screenshot img { width: 100%; height: 100%; object-fit: cover; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
  justify-content: center;
}
.download-btn:active { transform: scale(0.97); }
.download-btn:hover { background: var(--accent-hover); }

/* ==============================
   Ratings & Reviews Section
   ============================== */
.reviews-section { border-top: 1px solid var(--border); padding-top: 24px; }

.rating-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.rating-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.rating-big-number {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.rating-big-count {
  font-size: 12px;
  color: var(--text-muted);
}

.rating-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 12px;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--warning);
  border-radius: 3px;
  transition: width 0.3s;
}

.bar-count {
  font-size: 11px;
  color: var(--text-muted);
  width: 16px;
}

@media (max-width: 400px) {
  .rating-summary { flex-direction: column; gap: 16px; align-items: center; }
}

/* Write Review */
.write-review {
  margin-bottom: 24px;
}

.write-review h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-form input,
.review-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
}
.review-form input:focus,
.review-form textarea:focus { border-color: var(--accent); }

.star-input {
  display: flex;
  gap: 4px;
}

.star-btn {
  cursor: pointer;
  color: var(--border);
  transition: color 0.15s;
}
.star-btn:hover { color: var(--warning); }

.submit-review-btn {
  align-self: flex-start;
  padding: 10px 24px !important;
  font-size: 14px !important;
}

/* Reviews List */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-reviews {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 14px;
}

.view-all-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.view-all-btn:hover { text-decoration: underline; }

.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}

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

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reviewer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.reviewer-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.review-date {
  font-size: 12px;
  color: var(--text-muted);
}

.review-rating {
  display: flex;
}

.review-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Reviews Modal */
.reviews-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.reviews-modal-content {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: var(--max-w);
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}

.reviews-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding-bottom: 8px;
}

.reviews-modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
}

.close-modal-btn:hover { background: var(--bg-input); }

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

/* ==============================
   Admin Panel
   ============================== */
.admin-container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--gap);
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-header h1 { font-size: 18px; font-weight: 600; }

/* Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 53px;
  z-index: 99;
}

.admin-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
}
.admin-tab-btn:hover { color: var(--text-secondary); }
.admin-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-content { padding: var(--gap); }
.admin-section { margin-bottom: 32px; }
.admin-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* Form */
.admin-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group textarea { resize: vertical; min-height: 80px; }

.file-input-wrapper { position: relative; }

.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  transition: border 0.2s, background 0.2s;
  cursor: pointer;
}
.file-input-wrapper:hover .file-label {
  border-color: var(--accent);
  background: var(--bg-input);
}

.icon-preview { margin-top: 10px; }
.icon-preview img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.screenshots-preview {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 4px;
}

.preview-thumb {
  position: relative;
  width: 80px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }

.remove-thumb-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, transform 0.1s;
  z-index: 10;
}
.remove-thumb-btn:hover {
  background: var(--danger, #ef4444);
  transform: scale(1.1);
}

.upload-progress-box {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.progress-status {
  color: var(--accent);
}

.progress-percent {
  color: var(--text-secondary);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.15s ease-out;
}

.progress-details {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.form-actions { display: flex; gap: 10px; margin-top: 6px; }

.btn-primary {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-secondary:hover { background: var(--border); }

/* Existing apps list */
.existing-apps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-app-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
  gap: 12px;
}

.admin-app-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-app-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-app-info h4 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-app-info p { font-size: 12px; color: var(--text-muted); }

.admin-app-actions { display: flex; gap: 8px; flex-shrink: 0; }

.edit-btn,
.delete-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.edit-btn {
  background: var(--bg-input);
  color: var(--accent);
  border: 1px solid var(--border);
}
.edit-btn:hover { background: var(--border); }

.delete-btn {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}
.delete-btn:hover { background: rgba(239,68,68,0.2); }

.no-apps {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 15px;
}

/* ==============================
   Analytics
   ============================== */
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.analytics-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.analytics-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.analytics-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.analytics-chart {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.analytics-chart h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.bar-column {
  width: 100%;
  max-width: 40px;
  background: var(--accent);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}

.bar-day-label {
  font-size: 10px;
  color: var(--text-muted);
}

/* Date Range */
.analytics-date-range {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.analytics-date-range h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.date-range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.date-input:focus { border-color: var(--accent); }

.date-sep {
  font-size: 14px;
  color: var(--text-muted);
}

.date-range-btn {
  padding: 10px 20px !important;
  font-size: 14px !important;
}

.date-range-result { margin-top: 16px; }

.date-range-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.date-range-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-range-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 13px;
}

.date-range-count {
  font-weight: 600;
  color: var(--accent);
}

.loading-text {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 15px;
}

/* ==============================
   Reviews Admin
   ============================== */
.reviews-admin-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-review-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}

.admin-review-card.hidden-review {
  opacity: 0.5;
  border-style: dashed;
}

.admin-review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.admin-review-app {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.admin-review-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.admin-review-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.admin-review-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.admin-review-actions {
  display: flex;
  gap: 8px;
}

/* ==============================
   Admin Login Modal
   ============================== */
.admin-login-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
}

.admin-login-content {
  background: var(--bg-card);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.admin-login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.admin-login-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.admin-login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.admin-login-form .form-group {
  margin-bottom: 14px;
}

.admin-login-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.admin-login-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
}

.admin-login-form input:focus {
  border-color: var(--accent);
}

.admin-login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 10px;
}

/* ==============================
   Auth Loading
   ============================== */
.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 15px;
}

.auth-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==============================
   Admin Header Actions
   ============================== */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.signout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--danger);
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s;
}

.signout-btn:hover {
  background: rgba(239,68,68,0.1);
}

@media (max-width: 400px) {
  .signout-btn span,
  .signout-btn { font-size: 0; padding: 7px; }
  .signout-btn svg { margin: 0; }
}

/* ==============================
   Scrollbar
   ============================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* ==============================
   Responsive
   ============================== */
@media (max-width: 400px) {
  .logo { font-size: 20px; }
  .app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .app-name { font-size: 15px; }
  .detail-icon { width: 64px; height: 64px; }
  .detail-meta h1 { font-size: 20px; }
  .admin-app-card { flex-direction: column; align-items: stretch; }
  .admin-app-actions { justify-content: flex-end; }
  .analytics-cards { grid-template-columns: 1fr; }
  .analytics-number { font-size: 24px; }
  .bar-chart { height: 100px; }
  .date-range-controls { flex-direction: column; }
  .date-range-controls .date-input,
  .date-range-controls .date-range-btn { width: 100%; }
}

@media (min-width: 480px) and (max-width: 768px) {
  .analytics-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .apps-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ==============================
   Lightbox Modal
   ============================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #ffffff;
  font-size: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

