/* =========================================================
   DEV & TESTER HUB - APP-STYLE ADMIN DASHBOARD
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(19, 28, 49, 0.75);
  --bg-card-hover: rgba(28, 41, 70, 0.9);
  --bg-card-solid: #131c31;
  --bg-input: #111a2e;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-highlight: rgba(129, 140, 248, 0.35);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);

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

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);

  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.12);
  --info-border: rgba(56, 189, 248, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(236, 72, 153, 0.07) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Container */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   TOP APP BAR / HEADER
   ========================================================= */
.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 16px;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand-logo svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-tag {
  font-size: 0.65rem;
  padding: 2px 7px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Server Status Pill */
.server-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.server-status-pill:hover {
  border-color: var(--border-highlight);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 8px currentColor;
  transition: var(--transition);
}

.status-dot.online {
  background: var(--success);
  color: var(--success);
}

.status-dot.offline {
  background: var(--danger);
  color: var(--danger);
}

.server-status-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: var(--danger-bg);
  color: #f87171;
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-icon-only {
  padding: 8px;
  border-radius: var(--radius-sm);
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Back Button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
}

.btn-back:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateX(-3px);
  color: #ffffff;
}

.btn-back svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* =========================================================
   OVERVIEW STATS ROW
   ========================================================= */
.quick-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-tile {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-tile:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.stat-tile-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-tile-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.stat-tile-icon.blue {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.stat-tile-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
}

.stat-tile-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.stat-tile-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.stat-tile-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

/* =========================================================
   SEARCH & ACTIONS TOOLBAR
   ========================================================= */
.toolbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-container input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-container input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-container svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

/* =========================================================
   DEVELOPER CARDS (MOBILE-APP STYLE)
   ========================================================= */
.developers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dev-app-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dev-app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Avatar circle */
.dev-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

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

.dev-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-username {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.dev-badge-apps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.14);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}

.dev-badge-apps svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.dev-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dev-arrow-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.dev-app-card:hover .dev-arrow-icon {
  color: #ffffff;
  transform: translateX(4px);
}

.dev-arrow-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* =========================================================
   DEVELOPER DETAILS VIEW (APPS SCREEN)
   ========================================================= */
.dev-detail-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-md);
}

.dev-banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dev-banner-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.dev-banner-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

.dev-banner-handle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.dev-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =========================================================
   APP LINK CARDS (JUST LIKE APP_LINK_CARD.DART)
   ========================================================= */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
  position: relative;
}

.app-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-card-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  flex-shrink: 0;
}

.app-icon-box svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.app-name-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.app-version-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.14);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-top: 4px;
}

/* URL Bar */
.app-url-box {
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-url-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.app-url-text:hover {
  text-decoration: underline;
  color: #60a5fa;
}

.app-url-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.app-notes-box {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
  line-height: 1.4;
  max-height: 72px;
  overflow-y: auto;
}

/* Bottom Actions Bar on App Card */
.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  gap: 8px;
  flex-wrap: wrap;
}

.app-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qa-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-qa-bugs {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-qa-bugs:hover {
  background: rgba(245, 158, 11, 0.22);
}

.btn-qa-notes {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.3);
}

.btn-qa-notes:hover {
  background: rgba(56, 189, 248, 0.22);
}

.btn-qa-pill svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-card.modal-lg {
  max-width: 720px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(10, 15, 30, 0.5);
}

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

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

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

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Color Picker Chips */
.color-chips {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-chip.selected {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 20px;
}

/* Danger Warning Box */
.danger-warning-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.danger-warning-box svg {
  width: 24px;
  height: 24px;
  fill: #ef4444;
  flex-shrink: 0;
}

.danger-text {
  font-size: 0.88rem;
  color: #fca5a5;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 440px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.toast-success {
  border-color: var(--success-border);
}

.toast.toast-success .toast-icon {
  color: var(--success);
}

.toast.toast-error {
  border-color: var(--danger-border);
}

.toast.toast-error .toast-icon {
  color: var(--danger);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.toast-msg {
  font-size: 0.88rem;
  font-weight: 500;
  flex: 1;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* =========================================================
   STATUS BADGES & QA BUG CARDS
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-success {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Clear Separate Box for Each Bug */
.bug-card-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.bug-card-box:hover {
  border-color: var(--border-highlight);
  background: rgba(20, 30, 55, 0.85);
}

.bug-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.bug-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-top: 2px;
}

.bug-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(255, 255, 255, 0.15);
}

.bug-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.bug-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Image gallery styles */
.bug-images-section {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.bug-images-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bug-images-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bug-image-thumb-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  background: #000000;
  transition: var(--transition);
}

.bug-image-thumb-wrapper:hover {
  border-color: var(--accent-primary);
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.bug-image-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bug-image-zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 22, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
}

.bug-image-thumb-wrapper:hover .bug-image-zoom-overlay {
  opacity: 1;
}

.bug-image-zoom-overlay svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Quick Screenshot Action on Bug Cards */
.btn-attach-ss {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px dashed rgba(99, 102, 241, 0.45);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-attach-ss:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.bug-image-add-tile {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #a5b4fc;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.76rem;
  font-weight: 600;
}

.bug-image-add-tile:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.18);
  color: #ffffff;
  transform: scale(1.04);
}

.bug-image-delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.bug-image-thumb-wrapper:hover .bug-image-delete-btn {
  opacity: 1;
}

.bug-image-delete-btn:hover {
  background: #dc2626;
  transform: scale(1.15);
}

.paste-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.bug-card-box.selected-bug {
  border-color: rgba(99, 102, 241, 0.65) !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25) !important;
}

.bug-card-box.drag-over {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.18) !important;
  transform: scale(1.01);
}

/* Image Full Preview Modal */
.image-preview-modal-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  max-height: 80vh;
  overflow: hidden;
}

.image-preview-full {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .app-container {
    padding: 14px 12px 60px 12px;
  }

  .top-navbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .navbar-actions {
    justify-content: space-between;
  }

  .dev-banner-left {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .dev-detail-banner {
    justify-content: center;
    text-align: center;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MANDATORY ADMIN LOGIN GATE & AUTH STYLES
   ========================================================= */

.app-container.auth-locked {
  display: none !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  overflow-y: auto;
  padding: 24px;
}

.login-backdrop-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.12) 35%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 45px rgba(99, 102, 241, 0.2);
  animation: cardEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-badge {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px auto;
  border-radius: 16px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
}

.login-logo-badge svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

.login-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-top: 4px;
}

.login-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px auto 0 auto;
  padding: 5px 12px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  color: #a5b4fc;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-lock-badge svg {
  width: 13px;
  height: 13px;
  fill: #a5b4fc;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .form-input {
  padding-left: 42px;
  padding-right: 44px;
  width: 100%;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: #64748b;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.input-with-icon:focus-within .input-icon {
  fill: #818cf8;
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  border-radius: 6px;
  transition: color 0.2s ease;
}

.btn-toggle-pw:hover {
  color: #f8fafc;
}

.btn-toggle-pw svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.login-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: -4px;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  accent-color: #6366f1;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.credentials-hint {
  font-size: 0.74rem;
  color: #64748b;
}

.credentials-hint code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
}

.login-error-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.84rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

.login-error-alert svg {
  width: 18px;
  height: 18px;
  fill: #ef4444;
  flex-shrink: 0;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 0.75rem;
  color: #64748b;
}

.admin-session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 4px 6px 4px 10px;
  margin-left: 4px;
}

.admin-session-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-session-avatar svg {
  width: 13px;
  height: 13px;
  fill: #ffffff;
}

.admin-session-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 9999px;
  padding: 4px 10px;
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  transform: translateY(-1px);
}

.btn-logout svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.login-card.shake {
  animation: shake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

