/* =============================================================
   YKPoint – Main Stylesheet
   Dark theme · Inter font · Responsive
   ============================================================= */

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

:root {
  --bg:        #0d0f14;
  --surface:   #161a23;
  --surface2:  #1e2330;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8eaf0;
  --muted:     #7b8299;
  --accent:    #4f7ef8;
  --accent-h:  #6b94ff;
  --danger:    #e05252;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,0.45);
  --transition: 0.18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ─── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 24px;
  background: rgba(13,15,20,0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-left  { display: flex; align-items: center; min-width: 160px; }
.topbar-center { flex: 1; max-width: 460px; margin: 0 auto; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 160px; justify-content: flex-end; }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: default; }
.logo-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f7ef8 0%, #7c56d6 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; letter-spacing: -0.5px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,126,248,0.4);
  flex-shrink: 0;
}
.logo-icon.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 7px; }
.logo-text { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }

/* Search */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0 14px;
  height: 36px;
  color: var(--muted);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: rgba(79,126,248,0.5);
  box-shadow: 0 0 0 3px rgba(79,126,248,0.12);
}
.search-bar svg { flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: inherit;
  min-width: 0;
}
.search-bar input::placeholder { color: var(--muted); }

/* Topbar icon buttons */
.topbar-btn {
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  color: var(--muted); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.topbar-btn:hover { background: var(--surface); color: var(--text); }

/* Sign In button in topbar */
.btn-signin {
  height: 34px; padding: 0 18px;
  background: var(--accent); border: none; border-radius: 99px;
  color: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.btn-signin:hover {
  background: var(--accent-h);
  box-shadow: 0 4px 14px rgba(79,126,248,0.45);
}

/* User chip (shown after login) */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 14px 4px 6px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background var(--transition);
  position: relative;
}
.user-chip:hover { background: var(--surface2); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #4f7ef8, #7c56d6);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-dropdown {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 160px;
  box-shadow: var(--shadow); z-index: 200;
  overflow: hidden;
}
.user-chip.open .user-dropdown { display: block; }
.user-dropdown button {
  display: block; width: 100%;
  background: none; border: none;
  color: var(--muted); font-size: 13px;
  padding: 10px 16px; text-align: left; cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.user-dropdown button:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.user-dropdown button.red:hover { color: var(--danger); }

/* ─── MAIN WORKSPACE ─────────────────────────────────────────── */
.workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ─── BANNER ─────────────────────────────────────────────────── */
.banner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 28px;
  gap: 12px;
}
.banner-left { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }

.status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.06);
}
.status-dot.offline { background: #e05252; }
.status-dot.online  { background: #38d97a; box-shadow: 0 0 6px rgba(56,217,122,0.6); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56,217,122,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(56,217,122,0); }
}

.btn-connect {
  height: 34px; padding: 0 18px;
  background: none; border: 1px solid var(--accent);
  border-radius: 99px; color: var(--accent);
  font-weight: 600; font-size: 12.5px; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  font-family: inherit; white-space: nowrap;
}
.btn-connect:hover {
  background: rgba(79,126,248,0.1);
  box-shadow: 0 0 0 3px rgba(79,126,248,0.12);
}

/* ─── APP GRID ───────────────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.app-tile {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 22px 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition), background var(--transition);
  user-select: none;
}
.app-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  border-color: rgba(79,126,248,0.28);
  background: var(--surface2);
}
.app-tile:active { transform: translateY(-1px); }

.tile-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c1, #4f7ef8) 0%, var(--c2, #7c56d6) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  transition: box-shadow var(--transition), transform var(--transition);
}
.app-tile:hover .tile-icon {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transform: scale(1.06);
}
.tile-icon svg { width: 24px; height: 24px; }

.app-tile span {
  font-size: 12.5px; font-weight: 500;
  color: var(--text); text-align: center;
  line-height: 1.3;
}

/* ─── QR PANEL ───────────────────────────────────────────────── */
.qr-panel { display: flex; justify-content: center; margin-top: 8px; }

.qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 40px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.qr-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.qr-card p  { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

#qrCanvas {
  display: block; margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.or-divider {
  margin: 16px 0;
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.connect-code {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: 'Courier New', monospace;
  font-size: 18px; font-weight: 700;
  letter-spacing: 2px; color: var(--accent);
  cursor: pointer;
  transition: background var(--transition);
}
.connect-code:hover { background: var(--surface); }

/* ─── OVERLAY / MODAL BASE ───────────────────────────────────── */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.overlay.open { display: flex; animation: fadeIn 0.18s ease; }

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 32px 28px;
  width: 100%; max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp 0.22s ease;
}

.close-x {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px;
  background: var(--surface2); border: none; border-radius: 50%;
  color: var(--muted); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.close-x:hover { background: rgba(224,82,82,0.18); color: var(--danger); }

/* Modal brand header */
.modal-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px; font-size: 17px; font-weight: 700;
}

/* Tabs */
.tab-row {
  display: flex; gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
}
.tab {
  flex: 1; height: 34px;
  background: none; border: none; border-radius: 6px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.tab:hover:not(.active) { color: var(--text); }

/* Form fields */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; height: 40px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px;
  color: var(--text); font-size: 13.5px; font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,126,248,0.18);
}
.field input::placeholder { color: var(--muted); }
.field input.error { border-color: var(--danger); }

/* Password wrapper */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 56px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  font-size: 11.5px; cursor: pointer; font-family: inherit;
  transition: color var(--transition);
}
.pw-toggle:hover { color: var(--text); }

/* Flex row (remember me / forgot) */
.flex-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.chk input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }
.link-sm { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }

/* Error message */
.err-msg { color: var(--danger); font-size: 12.5px; min-height: 16px; margin-bottom: 10px; }

/* Primary button */
.btn-primary {
  height: 42px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
  box-shadow: 0 6px 18px rgba(79,126,248,0.4);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.w100 { width: 100%; }

/* Social separator */
.social-sep {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px;
  margin: 16px 0;
}
.social-sep::before, .social-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Social buttons */
.social-row { display: flex; gap: 10px; }
.btn-social {
  flex: 1; height: 38px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background var(--transition), border-color var(--transition);
}
.btn-social:hover { background: var(--surface2); border-color: rgba(255,255,255,0.14); }

/* ─── DEVICE PANEL ───────────────────────────────────────────── */
.device-panel {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 20px;
  min-height: 44px; align-items: center;
}
.no-device-hint {
  font-size: 13px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 12px 18px;
  width: 100%;
}
.device-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 7px 14px 7px 10px;
  cursor: pointer; font-size: 13px; transition: all var(--transition);
  user-select: none;
}
.device-chip:hover { background: var(--surface2); border-color: rgba(79,126,248,0.4); }
.device-chip.active { border-color: var(--accent); background: rgba(79,126,248,0.1); }
.device-chip.offline { opacity: 0.6; }
.dchip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dchip-dot.on  { background: #38d97a; box-shadow: 0 0 6px rgba(56,217,122,0.7); }
.dchip-dot.off { background: #e05252; }
.dchip-name { font-weight: 600; }
.dchip-meta { color: var(--muted); font-size: 11.5px; margin-left: 2px; flex: 1; }
.dchip-remove {
  display: none; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(224,82,82,0.15); border: none;
  color: #e05252; font-size: 11px; cursor: pointer;
  flex-shrink: 0; padding: 0; line-height: 1;
  transition: background var(--transition);
}
.dchip-remove:hover { background: rgba(224,82,82,0.35); }
.device-chip:hover .dchip-remove { display: flex; }

/* ─── FEATURE MODAL ──────────────────────────────────────────── */
.feature-modal {
  max-width: 680px; width: 100%;
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.feat-modal-hdr {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.feat-modal-hdr h3 { font-size: 17px; font-weight: 700; flex-shrink: 0; }
.feat-hdr-actions {
  margin-left: auto; display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; justify-content: flex-end;
}
.feat-hdr-actions:empty { display: none; }
.feat-hdr-actions .act-btn { height: 30px; padding: 0 11px; font-size: 12px; }
.hdr-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hdr-count.sel { color: var(--accent, #6366f1); font-weight: 600; }
.feature-content {
  padding: 20px 24px 24px;
  overflow-y: auto;
  max-height: 75vh;
}

/* ─── COMMON FEATURE UI ──────────────────────────────────────── */
.feat-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px 20px; text-align: center;
}
.feat-big-icon  { font-size: 52px; line-height: 1; }
.feat-center-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0; }
.feat-btn-row   { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
.muted          { color: var(--muted); font-size: 13px; }
.status-line    { font-size: 13px; color: var(--muted); min-height: 18px; margin-top: 6px; }
.status-line.ok { color: #38d97a; }
.status-line.err{ color: var(--danger); }
.spin           { color: var(--muted); text-align: center; padding: 30px; font-size: 14px; }
.no-resp        { text-align: center; color: var(--muted); padding: 30px; font-size: 13px; line-height: 1.7; }
.err-line       { color: var(--danger); font-size: 13px; text-align: center; padding: 20px; }

/* Secondary button */
.btn-sec {
  height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  padding: 0 16px; transition: all var(--transition);
}
.btn-sec:hover         { border-color: rgba(255,255,255,0.2); background: var(--surface); }
.btn-sec.danger        { border-color: rgba(224,82,82,0.4); color: var(--danger); }
.btn-sec.danger:hover  { background: rgba(224,82,82,0.1); }
.btn-sm {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--muted);
  font-size: 12px; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.btn-sm:hover { background: var(--surface); color: var(--text); }

/* ─── FIND PHONE ─────────────────────────────────────────────── */
.feat-center-panel h4 { font-size: 18px; font-weight: 700; }

/* ─── CLIPBOARD ──────────────────────────────────────────────── */
.clip-panel h4    { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.clip-area {
  width: 100%; min-height: 120px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text); font-size: 13.5px; font-family: 'Courier New', monospace;
  resize: vertical; outline: none;
  transition: border-color var(--transition);
}
.clip-area:focus { border-color: var(--accent); }

/* ─── REMOTE CONTROL (redesigned, with live screen) ──────────── */
.rc-layout       { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }

/* Live phone column */
.rc-device       { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; width: 230px; }
.rc-device-frame {
  position: relative; width: 230px; height: 420px;
  background: #05070d;
  border: 4px solid #1b2230; border-radius: 32px;
  overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.03);
  display: flex; align-items: center; justify-content: center;
}
.rc-live-img     { width: 100%; height: 100%; object-fit: contain; background: #000; }
.rc-live-badge   {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  display: flex; align-items: center; gap: 5px;
  background: rgba(16,185,129,0.16); color: #10b981;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  backdrop-filter: blur(6px);
  animation: rcPulse 2s ease-in-out infinite;
}
@keyframes rcPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.rc-placeholder  { text-align: center; padding: 24px; }
.rc-placeholder p { color: var(--muted); font-size: 13px; margin: 4px 0; }
.rc-spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid rgba(99,102,241,0.2); border-top-color: #6366f1;
  border-radius: 50%; animation: rcSpin 0.8s linear infinite;
}
@keyframes rcSpin { to { transform: rotate(360deg); } }

.rc-nav {
  width: 230px; background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; justify-content: space-around; padding: 8px;
}
.rc-nav-btn {
  width: 56px; height: 38px;
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.rc-nav-btn:hover  { background: rgba(99,102,241,0.14); color: #fff; }
.rc-nav-btn:active { transform: scale(0.92); }
.rc-reconnect { width: 230px; }
.rc-status    { width: 230px; text-align: center; font-size: 11.5px; min-height: 16px; }
.rc-touch-hint {
  width: 230px; text-align: center; font-size: 10.5px;
  color: var(--accent, #6366f1); background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2); border-radius: 8px;
  padding: 5px 8px;
}

/* Control panel column */
.rc-panel        { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 18px; }
.rc-group-title  { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.9px; margin-bottom: 9px; }
.rc-grid         { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rc-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 72px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; color: var(--text);
  font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.rc-tile .rc-ico { font-size: 21px; line-height: 1; }
.rc-tile:hover   { background: var(--surface); border-color: rgba(99,102,241,0.5); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.rc-tile:active  { transform: translateY(0) scale(0.97); }
.rc-tile.danger        { border-color: rgba(224,82,82,0.32); color: var(--danger); }
.rc-tile.danger:hover  { background: rgba(224,82,82,0.1); border-color: rgba(224,82,82,0.6); }

/* Capture-mode segmented toggle (prompt-free ↔ high-FPS) */
.mode-toggle {
  display: inline-flex; gap: 0; width: 100%;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
}
.mode-btn {
  flex: 1; padding: 7px 8px;
  background: none; border: none; border-radius: 7px;
  color: var(--muted); font-size: 11.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: all var(--transition);
}
.mode-btn:hover         { color: var(--text); }
.mode-btn.active {
  background: var(--accent, #6366f1); color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}

/* ─── SCREEN MIRROR ──────────────────────────────────────────── */
.mirror-wrap     { display: flex; flex-direction: column; gap: 14px; }
.mirror-screen   {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mirror-controls { display: flex; align-items: center; gap: 8px; }

/* ─── CAMERA ─────────────────────────────────────────────────── */
.camera-wrap { display: flex; flex-direction: column; gap: 14px; }
.camera-view {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

/* ─── FILES ──────────────────────────────────────────────────── */
.files-wrap      { display: flex; flex-direction: column; gap: 0; }
.files-toolbar   {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px 12px;
}
.files-path      { font-size: 12px; color: var(--muted); font-family: monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-list      {
  background: var(--bg); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 380px; overflow-y: auto;
}
.file-row        {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover  { background: var(--surface2); }
.f-icon          { font-size: 16px; flex-shrink: 0; cursor: pointer; }
.f-name          { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.f-size          { font-size: 11.5px; flex-shrink: 0; }
.fr-cb           { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--accent, #6366f1); cursor: pointer; }
.fr-cb-spacer    { width: 15px; flex-shrink: 0; }

/* ─── BULK BAR + ROW ACTIONS (download/delete/select) ────────── */
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-sm); padding: 7px 12px; font-size: 12.5px; color: var(--text);
}
.bulk-bar > span { font-weight: 600; margin-right: 4px; }

/* Pill action buttons with icon + label (Download / Delete / Upload / Clear) */
.act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 12.5px; font-weight: 500; font-family: inherit;
  transition: all var(--transition); white-space: nowrap;
}
.act-btn svg          { flex-shrink: 0; }
.act-btn:hover        { background: var(--surface); border-color: var(--accent, #6366f1); }
.act-btn.danger       { color: var(--danger); border-color: rgba(224,82,82,0.32); }
.act-btn.danger:hover { background: rgba(224,82,82,0.12); border-color: rgba(224,82,82,0.6); }
.act-btn.ghost        { background: transparent; color: var(--muted); }
.act-btn.ghost:hover  { background: var(--surface2); color: var(--text); }

/* Square icon-only buttons (Home / Up) */
.ic-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  transition: all var(--transition);
}
.ic-btn:hover { background: var(--surface); border-color: var(--accent, #6366f1); }

/* Primary button: align icon + label */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-primary svg { flex-shrink: 0; }

.row-acts { display: flex; gap: 4px; flex-shrink: 0; opacity: 0; transition: opacity var(--transition); }
.file-row:hover .row-acts, .list-item:hover .row-acts { opacity: 1; }
.row-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 0; transition: all var(--transition);
}
.row-act svg           { width: 14px; height: 14px; }
.row-act:hover         { background: var(--surface); border-color: var(--accent, #6366f1); }
.row-act.danger        { color: var(--danger); border-color: rgba(224,82,82,0.3); }
.row-act.danger:hover  { background: rgba(224,82,82,0.12); }
.media-li { display: flex; align-items: center; gap: 10px; }
.md-cb    { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--accent, #6366f1); cursor: pointer; }
.app-li   { display: flex; align-items: center; gap: 10px; }
.apps-sys-toggle { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.apps-sys-toggle input { accent-color: var(--accent, #6366f1); cursor: pointer; }
.apps-hint { font-size: 11.5px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.app-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  color: var(--muted); background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; margin-left: 4px;
}

/* ─── LIST FEATURES (Contacts / Messages / etc.) ─────────────── */
.list-wrap       { display: flex; flex-direction: column; gap: 12px; }
.list-toolbar    { display: flex; gap: 10px; align-items: center; }
.list-search     {
  flex: 1; height: 36px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px; color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.list-search:focus { border-color: var(--accent); }
.list-body       { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 400px; overflow-y: auto; }
.list-item       { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.li-main         { font-size: 13.5px; }
.li-sub          { font-size: 12px; margin-top: 2px; }

/* ─── MEDIA GRID ─────────────────────────────────────────────── */
.media-wrap      { display: flex; flex-direction: column; gap: 12px; }
.media-toolbar   { display: flex; align-items: center; }
.media-grid      {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; max-height: 420px; overflow-y: auto;
}
.media-thumb     {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  transition: all var(--transition);
}
.media-thumb:hover { border-color: var(--accent); }
.media-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.media-thumb.no-img { padding: 20px; text-align: center; font-size: 28px; }
.thumb-name      { font-size: 10.5px; color: var(--muted); padding: 4px 6px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.media-thumb     { position: relative; }
.thumb-ico       { font-size: 28px; padding: 20px 0; }
.thumb-cb        {
  position: absolute; top: 6px; left: 6px; z-index: 3;
  width: 17px; height: 17px; accent-color: var(--accent, #6366f1); cursor: pointer;
}
.thumb-acts      {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition);
}
.media-thumb:hover .thumb-acts { opacity: 1; }

/* ─── DEVICE INFO ────────────────────────────────────────────── */
.info-wrap       { display: flex; flex-direction: column; gap: 16px; }
.info-header     { display: flex; align-items: center; gap: 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.info-avatar     { font-size: 36px; }
.info-name       { font-size: 16px; font-weight: 700; }
.status-badge    { margin-left: auto; font-size: 12.5px; font-weight: 500; }
.status-badge.online { color: #38d97a; }
.status-badge.offline{ color: var(--danger); }
.info-grid       { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.info-row        { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-key        { font-size: 12.5px; color: var(--muted); }
.info-val        { font-size: 13px; font-weight: 500; }

/* ─── TOAST ──────────────────────────────────────────────────── */
#yk-toast {
  position: fixed;
  bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast-item {
  background: rgba(30,35,48,0.96);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px; font-weight: 500;
  padding: 10px 22px;
  border-radius: 99px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toastIn 0.22s ease, toastOut 0.3s ease 2.5s forwards;
  white-space: nowrap;
}
.toast-item.success { border-color: rgba(56,217,122,0.35); color: #38d97a; }
.toast-item.error   { border-color: rgba(224,82,82,0.35);  color: #e87070; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 14px; }
  .topbar-center { max-width: none; }
  .topbar-right .topbar-btn { display: none; }
  .workspace { padding: 18px 14px 48px; }
  .banner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
  .app-tile { padding: 16px 8px 12px; }
  .tile-icon { width: 44px; height: 44px; }
  .tile-icon svg { width: 20px; height: 20px; }
  .app-tile span { font-size: 11.5px; }
  .modal { padding: 24px 20px 20px; }
  .qr-card { padding: 24px 24px; }
}
@media (max-width: 460px) {
  .logo-text { display: none; }
  .app-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .app-tile { padding: 12px 6px 10px; gap: 7px; }
  .tile-icon { width: 38px; height: 38px; border-radius: 10px; }
  .tile-icon svg { width: 18px; height: 18px; }
}

/* ─── APK DOWNLOAD BUTTON ─────────────────────────────────────── */
.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 14px; margin-top: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: all var(--transition);
}
.btn-download:hover { background: var(--surface); border-color: var(--accent, #6366f1); }

/* ─── ADMIN PANEL ─────────────────────────────────────────────── */
.admin-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 13px; }
.badge-pending { background: rgba(245,158,11,.15); color: #f59e0b; border-radius: 20px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; transition: border-color .15s;
}
.admin-row:hover { border-color: rgba(99,102,241,.4); }
.admin-row-main { flex: 1; min-width: 0; }
.admin-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.admin-meta { font-size: 12px; margin-top: 2px; }
.admin-devs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.dev-pill { font-size: 10.5px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; color: var(--muted); }
.dev-pill.on { color: #10b981; border-color: rgba(16,185,129,.4); }
.admin-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.ust { font-size: 10px; font-weight: 700; text-transform: uppercase; border-radius: 5px; padding: 1px 6px; }
.ust.ok   { color: #10b981; background: rgba(16,185,129,.14); }
.ust.warn { color: #f59e0b; background: rgba(245,158,11,.14); }
.ust.err  { color: #ef4444; background: rgba(239,68,68,.14); }

/* Sidebar nav */
.admin-nav-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 16px; background: none; border: none; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 0;
  text-align: left; transition: background .12s, color .12s;
}
.admin-nav-btn:hover { background: rgba(255,255,255,.05); color: var(--text); }
.admin-nav-btn.active { background: rgba(99,102,241,.15); color: #818cf8; }
.admin-nav-badge { background: #f59e0b; color: #000; border-radius: 10px; padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: auto; }

/* Stat cards row */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 10px; margin-bottom: 20px; }
.admin-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.admin-stat-val { font-size: 24px; font-weight: 700; line-height: 1; }
.admin-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* User card grid */
.admin-user-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 12px; }
.admin-user-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.admin-user-card:hover { border-color: rgba(99,102,241,.5); transform: translateY(-1px); }
.admin-user-card.pending-card { border-color: rgba(245,158,11,.4); }
.auc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.auc-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.auc-name { font-size: 14px; font-weight: 600; }
.auc-email { font-size: 11px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.auc-usage { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 10px; overflow: hidden; }
.auc-usage-bar { height: 100%; border-radius: 2px; background: #6366f1; }
.auc-actions { display: flex; gap: 6px; }

/* Device cards */
.admin-device-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 12px; }
.admin-device-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.admin-device-card:hover { border-color: rgba(99,102,241,.5); transform: translateY(-1px); }
.admin-device-card.online-card { border-color: rgba(16,185,129,.35); }
.adc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.adc-icon { width: 36px; height: 36px; border-radius: 8px; background: #1f2937; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.adc-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; flex-shrink: 0; }
.adc-online-dot.on { background: #10b981; box-shadow: 0 0 6px #10b981; }

/* Activity feed */
.admin-activity-item { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1a2030; font-size: 12px; }
.admin-activity-item:last-child { border-bottom: none; }
.aai-icon { width: 24px; text-align: center; flex-shrink: 0; font-size: 14px; }
.aai-body { flex: 1; min-width: 0; }
.aai-user { font-weight: 600; color: var(--text); }
.aai-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aai-time { color: var(--muted); white-space: nowrap; font-size: 11px; flex-shrink: 0; }

/* Device control panel (inline in admin) */
.admin-device-ctrl { background: #0a0d16; border: 1px solid #1f2937; border-radius: 12px; padding: 16px; margin-top: 16px; }
.admin-mirror-box { background: #000; border-radius: 8px; overflow: hidden; text-align: center; min-height: 180px; display: flex; align-items: center; justify-content: center; margin: 10px 0; }
.admin-mirror-box img { max-width: 100%; max-height: 300px; display: block; }
.admin-cmd-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.admin-search { width: 100%; padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 13px; margin-bottom: 14px; box-sizing: border-box; }
.admin-search:focus { outline: none; border-color: #6366f1; }
