/* =========================================================
   IST Trust Zone — Creative Design System
   Deep navy, warm paper white, steel accent.
   Mobile-first, scales beautifully to desktop.
   ========================================================= */
:root{
  --navy-950: #0a1c2e;
  --navy-900: #0f2942;
  --navy-800: #163a5c;
  --navy-700: #1e4b74;
  --navy-600: #285e8a;
  --steel-500: #4c7aa3;
  --steel-300: #8faec8;
  --steel-100: #e7eef5;
  --steel-50: #f3f6fa;
  --paper: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e6ec;
  --border-strong: #cdd4de;
  --ink: #1a2531;
  --ink-muted: #5c6b7a;
  --ink-faint: #94a1ae;
  --danger: #a3372f;
  --danger-light: #d94f46;
  --danger-bg: #fbeceb;
  --success: #2f7a4f;
  --success-light: #3a9a62;
  --gold: #c9a84c;
  --gold-light: #e4d08e;

  /* Semantic heading tone — used wherever text sits on --surface/
     --paper (as opposed to --navy-* which is used for fixed dark
     brand backgrounds like the header/buttons). Themed below. */
  --heading: #0f2942;
  --heading-hover: #1e4b74;
  --surface-alt: #f3f6fa;


  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(15,41,66,0.04);
  --shadow-card: 0 1px 3px rgba(15,41,66,0.06), 0 1px 2px rgba(15,41,66,0.03);
  --shadow-raised: 0 10px 30px rgba(10,28,46,0.10), 0 2px 8px rgba(10,28,66,0.05);
  --shadow-overlay: 0 20px 60px rgba(10,28,46,0.18);
  --shadow-glow: 0 0 30px rgba(76,122,163,0.25);
  --transition: 180ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 280ms cubic-bezier(.4,0,.2,1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset ---------- */
*,*::before,*::after{ box-sizing: border-box; }
html{ height:100%; -webkit-text-size-adjust:100%; }

body{
  margin:0;
  height:100%;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  overflow-x: hidden;

}
img{ max-width:100%; display:block; }
button{ font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input{ font-family: inherit; -webkit-tap-highlight-color: transparent; }
.hidden{ display:none !important; }

/* ---------- Layout shells ---------- */
.panel{ min-height:100vh; min-height: 100dvh; }

/* ==========================================================
   HEADER — Premium gradient with glass effect
   ========================================================== */
.user-header, .admin-header{
  position: sticky;
  top:0;
  z-index: 20;
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0,0,0,0.15);
}

.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display:flex;
  align-items:center;
  gap: 16px;
}
.brand{ display:flex; align-items:center; gap:14px; flex-shrink:0; }
.brand-logo{
  height: 72px;
  width:auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.3));
  transition: transform var(--transition-spring), filter var(--transition);
  animation: logoFloat 4s ease-in-out infinite;
}
.brand-logo:hover{
  transform: scale(1.08);
  filter: brightness(0) invert(1) drop-shadow(0 4px 16px rgba(201,168,76,0.5));
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.brand-logo-sm{ height: 42px; animation: none; }
.brand-logo-sm:hover{ transform: none; }
.brand-text{
  display:flex;
  flex-direction:column;
  gap: 1px;
}
.brand-name{
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand-sub{
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.admin-label{
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.15);
  display: none;
}

/* ==========================================================
   SEARCH MODULE — Minimalist, modern, creative design
   ========================================================== */
.search-container{
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-box{
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 320ms cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.search-box:focus-within{
  background: rgba(255,255,255,0.12);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15), 0 4px 24px rgba(0,0,0,0.12);
}

.search-icon{
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.5);
  pointer-events: none;
  transition: color 320ms ease, transform 320ms cubic-bezier(.34,1.56,.64,1);
}

.search-box:focus-within .search-icon{
  color: var(--gold);
  transform: scale(1.08);
}

.search-field{
  width: 100%;
  padding: 13px 44px 13px 46px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.search-field::placeholder{
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.search-clear{
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition: all 240ms cubic-bezier(.34,1.56,.64,1);
}

.search-clear svg{
  width: 14px;
  height: 14px;
}

.search-clear:hover{
  background: rgba(255,255,255,0.2);
  color: #fff;
}



/* Responsive */
@media (max-width: 640px){
  .search-box{
    border-radius: 12px;
  }
  .search-field{
    font-size: 13px;
    padding: 11px 40px 11px 42px;
  }
  .search-icon{
    left: 12px;
    width: 16px;
    height: 16px;
  }
  .search-clear{
    width: 26px;
    height: 26px;
  }
  .search-clear svg{
    width: 12px;
    height: 12px;
  }
}

/* Animated underline sweep — used by the admin filter bar. */
.admin-search-wrap{ position: relative; }
.admin-search-wrap::after{
  content: '';
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -3px;
  height: 2px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
  opacity: 0;
  transition: left 420ms cubic-bezier(.4,0,.2,1), right 420ms cubic-bezier(.4,0,.2,1), opacity 200ms ease;
  pointer-events: none;
}
.admin-search-wrap:focus-within::after{
  left: 8px;
  right: 8px;
  opacity: 1;
}


/* ==========================================================
   HERO / WELCOME AREA
   ========================================================== */
.hero-section{
  position: relative;
  padding: 60px 20px 40px;
  text-align: center;
  overflow: hidden;
}
.hero-section::before{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 40%, transparent 100%);
  opacity: 0.06;
  pointer-events: none;
}

.hero-title{
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 8px;
  line-height: 1.15;
  animation: fadeUp 0.6s ease-out;
}
.hero-subtitle{
  font-size: 15px;
  color: var(--ink-muted);
  margin: 0;
  animation: fadeUp 0.6s ease-out 0.1s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   USER MAIN / ITEMS GRID
   ========================================================== */
.user-main{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

.items-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  animation: fadeUp 0.5s ease-out 0.2s both;
}



@keyframes cardIn{
  from{ opacity:0; transform: translateY(10px) scale(0.97); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce){
  .item-card{ animation: none; }
}







/* ---------- Empty states ---------- */
.empty-state{
  text-align:center;
  padding: 80px 20px;
  color: var(--ink-muted);
}
.empty-state svg{ margin: 0 auto 16px; opacity: 0.35; }
.empty-title{
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-muted);
  margin:0;
  font-weight: 500;
}

/* ==========================================================
   OVERLAYS (shared)
   ========================================================== */
.overlay{
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10,20,32,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  animation: fadeIn 200ms ease-out;
  padding: 0;
}
@keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }

.overlay-panel, .preview-panel, .confirm-panel{
  background: var(--surface);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display:flex;
  flex-direction:column;
  box-shadow: var(--shadow-overlay);
  animation: slideUp 300ms cubic-bezier(.32,.72,0,1);
  overflow: hidden;
}
.preview-panel{ max-width: 880px; }

@keyframes slideUp{ from{ transform: translateY(100%); opacity:0.5; } to{ transform: translateY(0); opacity:1; } }

.overlay-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink:0;
  background: var(--surface);
}
.overlay-title{
  font-family: var(--font-display);
  font-weight:600;
  font-size: 22px;
  color: var(--heading);
  margin:0;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.icon-btn{
  width:36px; height:36px;
  border-radius: var(--radius-full);
  border:none;
  background: var(--paper);
  color: var(--ink-muted);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition: all var(--transition);
  flex-shrink:0;
}
.icon-btn svg{ width:17px; height:17px; }
.icon-btn:hover{ background: var(--danger-bg); color: var(--danger); transform: rotate(90deg); }

/* ---------- File list (user detail) ---------- */
.file-list{ overflow-y:auto; padding: 8px 12px 16px; }
.file-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 14px 10px;
  border-radius: var(--radius-m);
  transition: all var(--transition);
}
.file-row:hover{ background: var(--steel-50); transform: translateX(4px); }
.file-row + .file-row{ border-top: 1px solid var(--border); }
.file-icon{
  width:42px; height:42px;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
  font-size: 10px;
  font-weight:800;
  letter-spacing: 0.04em;
  transition: transform var(--transition);
}
.file-row:hover .file-icon{ transform: scale(1.08); }
.file-info{ flex:1; min-width:0; }
.file-name{
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.file-meta{ font-size:12px; color: var(--ink-muted); margin-top:2px; }
.file-actions{ display:flex; gap:6px; flex-shrink:0; }

/* ---------- Buttons ---------- */
.btn{
  border:none;
  border-radius: var(--radius-s);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor:pointer;
  transition: all var(--transition);
  white-space:nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.btn::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.btn:hover::after{ opacity: 1; }
.btn-sm{ padding: 7px 12px; font-size:12px; }
.btn-primary{ background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); color:#fff; }
.btn-primary:hover{ transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,41,66,0.3); }
.btn-outline{ background: transparent; color: var(--heading); border: 1px solid var(--border-strong); }
.btn-outline:hover{ background: var(--steel-100); border-color: var(--steel-500); }
.btn-ghost{ background: transparent; color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }
.admin-header .btn-ghost{ color:#fff; font-size: 12px; padding: 7px 14px; }
.btn-ghost:hover{ background: rgba(201,168,76,0.1); border-color: var(--gold); }

.admin-header-actions{ display:flex; align-items:center; gap:10px; }
.drive-status{
  display:flex;
  align-items:center;
  gap:7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.drive-status:hover{ background: rgba(255,255,255,0.13); }
.drive-status-dot{
  width:8px; height:8px;
  border-radius:50%;
  background: var(--danger, #e74c3c);
  flex-shrink:0;
  transition: background var(--transition);
}
.drive-status-dot.connected{ background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,0.6); }
.drive-signout{
  font-size: 12px;
  padding: 6px 12px;
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
}
.drive-signout:hover{
  background: rgba(231,76,60,0.15);
  border-color: rgba(231,76,60,0.4);
  color: #e74c3c;
}
.btn-danger{ background: linear-gradient(135deg, var(--danger), var(--danger-light)); color:#fff; }
.btn-danger:hover{ transform: translateY(-1px); box-shadow: 0 4px 12px rgba(163,55,47,0.3); }
.btn-text{ background:none; border:none; color: var(--ink-muted); font-size:12px; font-weight:600; cursor:pointer; padding:5px 8px; border-radius: var(--radius-xs); transition: all var(--transition); }
.btn-text:hover{ color: var(--heading); background: var(--steel-50); }
.btn-text-danger{ color: var(--danger); }
.btn-text-danger:hover{ color: var(--danger-light); background: var(--danger-bg); }

/* ==========================================================
   PREVIEW
   ========================================================== */
.preview-body{
  flex:1;
  overflow:auto;
  background: var(--navy-950);
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 280px;
}
.preview-body iframe{ width:100%; height: 75vh; border:none; background:#fff; }
.preview-body img{ max-height: 78vh; object-fit:contain; max-width:100%; }
.preview-body video{ max-height: 78vh; width:100%; }
.preview-fallback{ color: var(--steel-100); text-align:center; padding: 50px 24px; font-size:14px; }

/* ==========================================================
   TOAST
   ========================================================== */
.toast-container{
  position: fixed;
  top: 16px;
  left:50%;
  transform: translateX(-50%);
  z-index: 100;
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center;
  width: 100%;
  padding: 0 16px;
  pointer-events:none;
}
.toast{
  background: var(--navy-900);
  color:#fff;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight:500;
  box-shadow: var(--shadow-raised);
  animation: toastIn 250ms var(--transition-spring);
  max-width: 90vw;
  text-align: center;
}
.toast.error{ background: linear-gradient(135deg, var(--danger), var(--danger-light)); }
.toast.success{ background: linear-gradient(135deg, var(--success), var(--success-light)); }
.toast.warning{ background: linear-gradient(135deg, #e67e22, #f39c12); color: #fff; }
@keyframes toastIn{ from{ opacity:0; transform: translateY(-10px) scale(0.95); } to{ opacity:1; transform:translateY(0) scale(1); } }

/* ==========================================================
   ADMIN
   ========================================================== */

.admin-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
  margin-bottom: 24px;
}
.admin-toolbar-left{ display:flex; align-items:center; gap:10px; }




/* ---------- Admin search / filter bar ---------- */




/* ---------- Add listener bar (admin) — kept deliberately simple:
   a label, one input, one button. No icons, no heavy card. ---------- */








.admin-file-list{ display:flex; flex-direction:column; gap:10px; }
.merge-admin-description{ padding:4px 4px 16px; font-size:14px; color:var(--ink-muted); line-height:1.5; }




.upload-progress-list{ display:flex; flex-direction:column; gap:6px; margin-bottom: 14px; }
.upload-progress-row{
  background: linear-gradient(135deg, var(--steel-50), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--heading);
  display:flex;
  align-items:center;
  gap: 10px;
}
.upload-progress-name{ flex-shrink:0; max-width:38%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-progress-bar-track{ flex:1; height:4px; background: var(--border); border-radius:4px; overflow:hidden; }
.upload-progress-bar-fill{ height:100%; background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--steel-500)); width:0%; transition: width 120ms linear; border-radius: 4px; }
.progress-pct{ font-weight: 600; font-size: 11.5px; color: var(--heading); flex-shrink:0; min-width: 32px; text-align: right; }

/* ---------- Confirm / rename dialogs ---------- */
.confirm-panel{
  max-width: 400px;
  padding: 26px 26px 22px;
  border-radius: var(--radius-xl);
  margin: 0 16px;
}
.confirm-message{ font-size:14.5px; color: var(--ink); line-height:1.55; margin:0; }
.confirm-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }

/* ==========================================================
   DECORATIVE ELEMENTS
   ========================================================== */
.hero-section::after{
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--paper));
  pointer-events: none;
}

/* ==========================================================
   RESPONSIVE — Mobile
   ========================================================== */
@media (max-width: 640px){
  .header-inner{ padding: 14px 14px; gap:10px; flex-wrap:wrap; }
  .drive-status{ padding: 7px 10px; }
  .drive-status-text{ display:none; }
  .brand-logo{ height: 58px; }
  .brand-text{ display: none; }
  .admin-label{ display: none; }
  .search-wrap{ max-width:none; flex:1 1 100%; order:3; }
  .search-input{ padding: 11px 38px 11px 42px; font-size: 15px; }
  .search-icon-chip{ width:28px; height:28px; left:5px; }
  .search-icon-chip svg{ width:14px; height:14px; }

  .hero-section{ padding: 40px 16px 24px; }
  .hero-title{ font-size: 28px; }
  .hero-subtitle{ font-size: 14px; }

  .user-main{ padding: 0 14px 80px; }
  .items-grid{ grid-template-columns: 1fr; gap: 12px; }
  .item-card{ padding: 20px 18px; min-height: auto; flex-direction: row; align-items: center; gap: 16px; border-radius: var(--radius-m); }
  .item-card-icon{ width: 48px; height: 48px; }
  .item-card-name{ font-size: 18px; }
  .item-card-count{ margin-top: 0; }
  .item-card::before{ display: none; }

  .overlay{ padding: 0; }
  .overlay-panel, .preview-panel{ border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92vh; }
  .overlay-header{ padding: 16px; }
  .overlay-title{ font-size: 18px; }
  .icon-btn{ width: 32px; height: 32px; }
  .icon-btn svg{ width:15px; height:15px; }
  .file-row{ flex-wrap: wrap; gap: 8px; padding: 10px 4px; }
  .file-icon{ width: 38px; height: 38px; font-size: 9px; }
  .file-name{ font-size: 13px; }
  .file-actions{ width:100%; justify-content:flex-end; padding-top: 4px; }
  .btn-sm{ padding: 6px 10px; font-size:11.5px; }

  .admin-main{ padding: 18px 14px 80px; }
  .admin-toolbar{ flex-direction: column; align-items: stretch; }
  .admin-add-form{ max-width: none; }
  .admin-title{ font-size: 22px; margin-bottom: 16px; }

  .add-listener-bar{ padding: 16px 16px; }
  .add-listener-label{ font-size: 15px; margin-bottom: 10px; }
  .add-listener-form{ flex-direction: column; gap: 10px; }
  .add-listener-btn{ justify-content: center; width: 100%; padding: 13px 20px; }
  .admin-row{ padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .admin-row-name{ font-size: 16px; }
  .admin-row-meta{ font-size: 11px; }
  .admin-row-actions{ width: 100%; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
  .admin-file-row{ flex-wrap: wrap; gap: 8px; padding: 12px 10px; }
  .file-actions{ width:100%; justify-content:flex-end; }
  .confirm-panel{ margin: 0 12px; padding: 20px; }

  .toast{ font-size: 12.5px; padding: 10px 16px; }
}

/* ==========================================================
   RESPONSIVE — Tablet
   ========================================================== */
@media (min-width: 641px) and (max-width: 1024px){
  .header-inner{ padding: 14px 20px; }
  .brand-logo{ height: 62px; }
  .admin-label{ display: inline; }
  .items-grid{ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
}

/* ==========================================================
   RESPONSIVE — Desktop
   ========================================================== */
@media (min-width: 1025px){
  .admin-header .btn-ghost{ font-size: 13px; }
  .admin-label{ display: inline; }
  .header-inner{ padding: 16px 28px; }
  .brand-logo{ height: 78px; }
  .brand-text{ display: flex; }
  .brand-name{ font-size: 24px; }
  .hero-section{ padding: 70px 20px 50px; }
  .hero-title{ font-size: 42px; }
  .hero-subtitle{ font-size: 16px; }
  .user-main{ padding: 0 28px 100px; }
  .items-grid{ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .item-card{ padding: 26px 24px; }
  .item-card-name{ font-size: 24px; }
  .overlay{ align-items:center; padding: 24px; }
  @keyframes slideUp{ from{ transform: translateY(20px) scale(0.97); opacity:0.5; } to{ transform: translateY(0) scale(1); opacity:1; } }
  .overlay-panel, .confirm-panel{ border-radius: var(--radius-xl); }
  .confirm-panel{ margin: 0; }
}

/* ==========================================================
   DARK SCROLLBAR
   ========================================================== */
::-webkit-scrollbar{ width:6px; height:6px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--border-strong); border-radius:3px; }
::-webkit-scrollbar-thumb:hover{ background: var(--ink-faint); }

/* ==========================================================
   FOCUS VISIBLE GLOBAL
   ========================================================== */
:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ==========================================================
   LOADING SKELETON
   ========================================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton{
  background: linear-gradient(90deg, var(--steel-50) 25%, var(--steel-100) 50%, var(--steel-50) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-s);
}

/* ==========================================================
   FILE VIEWING — Enhanced UX for mobile + PC
   ========================================================== */
.file-list{
  padding: 12px 16px 20px;
}
.file-row{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 12px;
  border-radius: var(--radius-m);
  transition: all var(--transition);
  border-bottom: 1px solid var(--border);
}
.file-row:last-child{ border-bottom: none; }
.file-row:hover{
  background: var(--steel-50);
  transform: translateX(4px);
}
.file-icon{
  width: 44px;
  height: 44px;
  border-radius: var(--radius-m);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.file-row:hover .file-icon{
  transform: scale(1.08);
}
.file-info{
  flex: 1;
  min-width: 0;
}
.file-name{
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.file-meta{
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
}
.file-actions{
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Preview improvements */
.preview-body{
  padding: 0;
}
.preview-body iframe{
  width: 100%;
  height: 75vh;
  border: none;
  background: #fff;
}
.preview-body img{
  max-height: 78vh;
  object-fit: contain;
  max-width: 100%;
  border-radius: 4px;
}
.preview-body video{
  max-height: 78vh;
  width: 100%;
  border-radius: 4px;
}
.preview-fallback{
  color: var(--steel-100);
  text-align: center;
  padding: 60px 30px;
  font-size: 15px;
  line-height: 1.6;
}
.preview-fallback p{
  margin: 0 0 12px;
}

/* Download button pulse on hover */
.btn-primary.btn-sm{
  position: relative;
}
.btn-primary.btn-sm::before{
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--gold);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition);
}
.btn-primary.btn-sm:hover::before{
  opacity: 0.2;
}

/* File row empty state */
.file-list:empty + .empty-state,
.file-list:empty ~ .empty-state{
  display: block !important;
}

/* Overlay header improvements */
.overlay-header{
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--steel-50) 100%);
}
.overlay-title{
  font-size: 20px;
  color: var(--heading);
}

/* Confirm dialog polish */
.confirm-panel{
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-overlay);
}
.confirm-message{
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
}

/* Mobile file actions — stacked layout for better touch */
@media (max-width: 480px){
  .file-row{
    padding: 14px 8px;
    gap: 12px;
  }
  .file-icon{
    width: 40px;
    height: 40px;
    font-size: 9px;
  }
  .file-name{
    font-size: 13.5px;
  }
  .file-meta{
    font-size: 11.5px;
  }
  .file-actions{
    gap: 6px;
  }
  .btn-sm{
    padding: 8px 14px;
    font-size: 12px;
    min-height: 36px;
  }
  .overlay-panel, .preview-panel{
    max-height: 92vh;
  }
  .preview-body iframe,
  .preview-body video{
    height: 60vh;
  }
  .preview-body img{
    max-height: 65vh;
  }
}

/* Overlay slide-up on mobile */
@media (max-width: 640px){
  .overlay-panel, .preview-panel{
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
    animation: slideUpMobile 350ms cubic-bezier(.32,.72,0,1);
  }
  @keyframes slideUpMobile{
    from{ transform: translateY(100%); }
    to{ transform: translateY(0); }
  }
}

/* ==========================================================
   THEME SYSTEM — Light (default) / Dark / Blue
   Applied via [data-theme] on <html>, set synchronously by an
   inline script in <head> (before first paint) and kept in
   sync afterwards by js/theme.js. Every surface in this file
   already reads color from the semantic tokens below, so a
   theme switch re-colors the whole app instantly with no
   per-component overrides needed.
   ========================================================== */
body{}

html[data-theme="dark"]{
  --paper: #0b1622;
  --surface: #101d2c;
  --surface-alt: #16283b;
  --border: #223347;
  --border-strong: #2c4256;
  --ink: #dbe4ee;
  --ink-muted: #93a5b8;
  --ink-faint: #64798d;
  --heading: #f2f6fa;
  --heading-hover: #cfe0f2;
  --steel-100: #22384f;
  --steel-50: #17293b;
  --danger-bg: #2c1615;
}
html[data-theme="dark"] .item-card{
  background: #ffffff;
  border-color: #e8ecf0;
  color: #1a2531;
}
html[data-theme="dark"] .item-card-name{ color: #1a2531; }
html[data-theme="dark"] .item-card-count{ color: #5c6b7a; }
html[data-theme="dark"] .item-card:hover{
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(201,168,76,0.15), 0 2px 8px rgba(0,0,0,0.2);
}
html[data-theme="dark"] .item-card-icon{
  background: linear-gradient(145deg, #1e4b74, #0f2942);
  box-shadow: 0 4px 16px rgba(15,41,66,0.3);
}
html[data-theme="dark"] .item-card-icon svg{ color: #fff; }

html[data-theme="blue"]{
  --paper: #e8f0fb;
  --surface: #ffffff;
  --surface-alt: #dce8f7;
  --border: #c8daf0;
  --border-strong: #a8c4e4;
  --ink: #1a2d45;
  --ink-muted: #4a6a8a;
  --ink-faint: #7b9cc0;
  --heading: #0c2d52;
  --heading-hover: #1a56a0;
  --gold: #2563eb;
  --gold-light: #60a5fa;
  --navy-700: #1e4b74;
  --navy-800: #163a5c;
  --navy-900: #0f2942;
}
html[data-theme="blue"] .item-card{
  background: linear-gradient(145deg, #ffffff 0%, #f0f6ff 100%);
  border: 1.5px solid #d0e0f5;
  box-shadow: 0 2px 12px rgba(37,99,235,0.06);
}
html[data-theme="blue"] .item-card:hover{
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(37,99,235,0.12);
  transform: translateY(-4px);
}
html[data-theme="blue"] .item-card-icon{
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 16px rgba(37,99,235,0.25);
}
html[data-theme="blue"] .item-card-icon svg{ color: #fff; }
html[data-theme="blue"] .item-card-name{ color: #0c2d52; }
html[data-theme="blue"] .item-card-count{ color: #4a6a8a; }
html[data-theme="blue"] .item-card::before{
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
html[data-theme="blue"] .btn-primary{
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
html[data-theme="blue"] .btn-primary:hover{
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

/* ---------- Theme switcher control ---------- */
.theme-switch{
  display:flex;
  align-items:center;
  gap:4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-full);
  padding:4px;
  flex-shrink:0;
}
.theme-btn{
  width:30px; height:30px;
  border-radius:50%;
  border:none;
  background:transparent;
  display:flex; align-items:center; justify-content:center;
  color: rgba(255,255,255,0.55);
  cursor:pointer;
  transition: all var(--transition);
  flex-shrink:0;
}
.theme-btn svg{ width:15px; height:15px; }
.theme-btn:hover{ color:#fff; background: rgba(255,255,255,0.12); }
.theme-btn.active{
  background: var(--gold);
  color: var(--navy-950);
  box-shadow: 0 2px 8px rgba(201,168,76,0.4);
}
@media (max-width: 640px){
  .header-inner{ flex-wrap: wrap; row-gap: 12px; }
  .search-container{ order:3; flex-basis:100%; max-width:none; }
  .theme-switch{ order:2; margin-left:auto; }
}

/* ==========================================================
   SPLASH SCREEN
   ========================================================== */
.splash-screen{
  position: fixed;
  inset: 0;
  z-index: 300;
  display:flex;
  align-items:center;
  justify-content:center;
  background: radial-gradient(circle at 50% 40%, var(--navy-800) 0%, var(--navy-950) 70%);
  transition: opacity 480ms ease, visibility 480ms ease;
}
.splash-screen.splash-hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.splash-logo-wrap{ display:flex; flex-direction:column; align-items:center; gap:30px; }
.splash-logo{
  height: 110px;
  width:auto;
  filter: brightness(0) invert(1) drop-shadow(0 4px 22px rgba(0,0,0,0.35));
  animation: splashPulse 1.8s ease-in-out infinite;
}
@keyframes splashPulse{
  0%,100%{ transform: scale(1); opacity:1; }
  50%{ transform: scale(1.045); opacity:0.86; }
}
.splash-loader{ display:flex; gap:9px; }
.splash-loader span{
  width:8px; height:8px;
  border-radius:50%;
  background: var(--gold);
  animation: splashDot 1.1s ease-in-out infinite;
}
.splash-loader span:nth-child(2){ animation-delay:0.15s; }
.splash-loader span:nth-child(3){ animation-delay:0.3s; }
@keyframes splashDot{
  0%,80%,100%{ transform: scale(0.6); opacity:0.4; }
  40%{ transform: scale(1); opacity:1; }
}
@media (prefers-reduced-motion: reduce){
  .splash-logo{ animation:none; }
  .splash-loader span{ animation:none; opacity:0.9; }
}

/* ==========================================================
   LOGIN SCREEN
   ========================================================== */
.login-screen{
  position: fixed;
  inset: 0;
  z-index: 290;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, var(--navy-800) 0%, var(--navy-950) 60%);
  transition: opacity 380ms ease, visibility 380ms ease;
}
.login-screen.hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.login-card{
  width:100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 32px 32px;
  text-align:center;
  box-shadow: var(--shadow-overlay);
  animation: cardIn 420ms cubic-bezier(.34,1.56,.64,1) both;
}
.login-card.shake{ animation: loginShake 420ms ease; }
@keyframes loginShake{
  10%,90%{ transform: translateX(-2px); }
  20%,80%{ transform: translateX(4px); }
  30%,50%,70%{ transform: translateX(-8px); }
  40%,60%{ transform: translateX(8px); }
}
.login-logo{ width: 56%; max-width: 180px; height: auto; margin: 0 auto 22px; filter: drop-shadow(0 6px 24px rgba(201,168,76,0.25)); transition: transform 400ms cubic-bezier(0.34,1.56,0.64,1); }
.login-title{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 4px;
}
.login-subtitle{ font-size: 13.5px; color: var(--ink-muted); margin: 0 0 24px; }
.login-form{ display:flex; flex-direction:column; gap:12px; }
.login-input{ text-align:center; font-family: var(--font-body); font-weight:500; font-size:15px; letter-spacing:0.01em; margin-bottom:0 !important; }
.login-submit{ justify-content:center; padding:12px; font-size:14px; }
.login-error{
  margin-top:14px;
  font-size:12.5px;
  color: var(--danger);
  font-weight:600;
  min-height: 16px;
}

/* Desktop: larger logos */
@media (min-width:768px){
  .splash-logo{ height:170px; }
  .login-logo{ width: 60%; max-width: 210px; margin-bottom: 26px; }
  .login-card{ max-width:420px; padding: 48px 40px 40px; }
}

/* ==========================================================
   DRAG & DROP UPLOAD ZONE (admin)
   ========================================================== */


/* ==========================================================
   SETTINGS CARD (admin — password / listener contact fields)
   ========================================================== */


/* ---------- Skeleton loading ---------- */
.skeleton-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  min-height: 130px;
  overflow: hidden;
  position: relative;
}
.skeleton-card::after{
  content:'';
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(140,160,180,0.14), transparent);
  animation: skeletonSweep 1.4s ease-in-out infinite;
}
@keyframes skeletonSweep{
  from{ transform: translateX(-100%); }
  to{ transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce){
  .skeleton-card::after{ animation:none; }
}

/* ---------- Listener contact info (phone / email pills) ---------- */
.item-detail-contact{ display:flex; flex-wrap:wrap; gap:8px; padding: 4px 12px 14px; }
.item-detail-contact:empty{ display:none; }
.contact-pill{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12.5px; font-weight:500;
  color: var(--ink-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
}
.contact-pill svg{ width:13px; height:13px; flex-shrink:0; opacity:0.7; }

/* ---------- Admin auth-check gate ---------- */
body.auth-pending #admin-panel{ display:none; }
#auth-check-screen.splash-hidden{ opacity:0; visibility:hidden; pointer-events:none; }

/* ==========================================================
   NEW ADMIN COMPONENTS — Method cards, panels, search bar
   ========================================================== */

/* --- New listener section --- */
.new-listener-section{ margin-bottom: 24px; }
.new-listener-heading{
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 12px;
}

/* --- Method cards (2-column grid) --- */
.new-listener-cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.method-card{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.method-card:hover{
  border-color: var(--gold);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}
.method-card.active{
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
  box-shadow: var(--shadow-raised), 0 0 20px rgba(201,168,76,0.12);
}
.method-card-icon{
  width: 44px; height: 44px;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--steel-100), var(--steel-50));
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.method-card:hover .method-card-icon,
.method-card.active .method-card-icon{
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-950);
}
.method-card-icon svg{ width: 22px; height: 22px; }
.method-card-text{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.method-card-title{
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
  line-height: 1.2;
}
.method-card-desc{
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* --- Method panels (expandable) --- */
.method-panel{
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1), opacity 250ms ease;
  opacity: 0;
  margin-bottom: 0;
}
.method-panel.open{
  max-height: 600px;
  opacity: 1;
  margin-bottom: 16px;
}

/* --- Quick dropzone --- */
.quick-dropzone{
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-l);
  padding: 28px 20px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface-alt);
  cursor: pointer;
  transition: all var(--transition);
  display: block;
}
.quick-dropzone:hover,
.quick-dropzone.dropzone-active{
  border-color: var(--gold);
  background: rgba(201,168,76,0.07);
  color: var(--heading);
}

/* --- Manual add form --- */
.manual-add-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}
.manual-field{ display: flex; flex-direction: column; gap: 4px; }
.manual-label{
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.manual-add-form .text-input{ margin-bottom: 0; }

/* --- Admin search bar (items view) --- */
.admin-search-bar{ margin-bottom: 16px; }
.admin-search-box{
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.admin-search-box:focus-within{
  border-color: rgba(201,168,76,0.55);
  box-shadow: var(--shadow-card), 0 2px 12px rgba(201,168,76,0.12);
  transform: translateY(-1px);
}
.admin-search-box .search-icon{
  width: 18px; height: 18px;
  margin-left: 16px;
  color: var(--ink-faint);
  flex-shrink: 0;
  transition: color var(--transition);
}
.admin-search-box:focus-within .search-icon{ color: var(--gold); }
.admin-search-box .search-field{
  flex: 1;
  padding: 12px 14px 12px 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.admin-search-box .search-field::placeholder{ color: var(--ink-faint); }

/* --- Admin search clear button --- */
.admin-search-box .search-clear{
  display: none;
  width: 28px; height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  border: none;
  background: var(--steel-100);
  color: var(--ink-muted);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}
.admin-search-box .search-clear.visible{ display: flex; }
.admin-search-box .search-clear:hover{ background: var(--steel-300); color: var(--ink); }
.admin-search-box .search-clear svg{ width: 14px; height: 14px; }



/* --- Auth status row (settings) --- */
.auth-status-row{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
}
.auth-status-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger-light);
  flex-shrink: 0;
  transition: all var(--transition);
}
.auth-status-dot.active{
  background: var(--success-light);
  box-shadow: 0 0 6px rgba(58,154,98,0.5);
}

/* --- Remove password row --- */
.remove-password-row{ margin-top: 14px; }

/* --- Drive signout --- */
.drive-signout{
  font-size: 12px;
  padding: 6px 12px;
}

/* --- Admin view titles --- */
.admin-title-clickable{
  cursor: pointer;
  transition: color var(--transition);
}
.admin-title-clickable:hover{ color: var(--heading-hover); }

/* --- Admin file list (files view) --- */
.admin-file-list{ display: flex; flex-direction: column; gap: 8px; }
.file-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.file-row:hover{
  border-color: var(--gold);
  box-shadow: var(--shadow-raised);
}
.file-icon{
  width: 42px; height: 42px;
  border-radius: var(--radius-s);
  background: var(--steel-100);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.file-info{ flex: 1; min-width: 0; }
.file-name{
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta{ font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.file-actions{
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* --- Button styles --- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary{
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-color: var(--navy-700);
}
.btn-primary:hover{ background: linear-gradient(135deg, var(--navy-700), var(--navy-600)); box-shadow: var(--shadow-raised); }
.btn-danger{
  background: linear-gradient(135deg, var(--danger), var(--danger-light));
  color: #fff;
}
.btn-danger:hover{ box-shadow: var(--shadow-raised); }
.btn-ghost{
  background: transparent;
  color: var(--ink-muted);
  border-color: transparent;
}
.btn-ghost:hover{ background: var(--steel-50); color: var(--heading); border-color: var(--border); }
.btn-outline{
  background: transparent;
  color: var(--heading);
  border-color: var(--border);
}
.btn-outline:hover{ border-color: var(--gold); color: var(--heading); background: rgba(201,168,76,0.05); }
.btn-sm{ padding: 6px 12px; font-size: 12px; }

/* --- Icon button --- */
.icon-btn{
  width: 36px; height: 36px;
  border-radius: var(--radius-s);
  border: none;
  background: transparent;
  color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover{ background: var(--steel-50); color: var(--heading); }
.icon-btn svg{ width: 20px; height: 20px; }

/* --- Confirm dialog --- */
.confirm-panel{
  background: var(--surface);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-l);
  padding: 28px 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-overlay);
}
.confirm-message{ font-size: 15px; color: var(--heading); font-weight: 500; margin: 0 0 20px; }
.confirm-actions{ display: flex; gap: 10px; justify-content: center; }

/* --- Settings card (admin) --- */
.settings-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.settings-card h2{
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 16px;
}
.settings-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.settings-row:last-child{ margin-bottom:0; }
.settings-row .text-input{ flex:1; min-width:160px; margin-bottom:0; }
.settings-hint{ font-size:12px; color: var(--ink-faint); margin: 8px 0 0; }

/* --- Contact fields (files view) --- */
.contact-fields{ display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.contact-field-row{ display: flex; align-items: center; gap: 10px; }
.contact-field-label{ font-size: 12px; font-weight: 600; color: var(--ink-muted); width: 56px; flex-shrink: 0; }
.contact-field-row .text-input{ margin-bottom: 0; flex: 1; }

/* --- Upload progress list --- */
.upload-progress-list{ display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.upload-progress-row{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.upload-progress-name{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.upload-progress-bar-track{
  flex: 1;
  height: 4px;
  background: var(--steel-100);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
}
.upload-progress-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 150ms ease;
}
.progress-pct{ font-size: 12px; font-weight: 600; color: var(--ink-muted); min-width: 36px; text-align: right; }

/* --- Preview overlay --- */
.preview-overlay .preview-panel{
  max-width: 900px;
  max-height: 95vh;
  margin: 0 10px;
}
.overlay-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.overlay-title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--heading);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.preview-body{ padding: 16px 20px; overflow-y: auto; max-height: calc(95vh - 60px); }
.preview-fallback{ text-align: center; padding: 40px 20px; color: var(--ink-muted); }

/* --- Admin main panel layout --- */
.admin-main{ max-width: 960px; margin: 0 auto; padding: 28px 20px 100px; }

/* --- Admin header actions --- */
.admin-header-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}

/* --- Drive status button --- */
.drive-status{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.drive-status:hover{ background: rgba(255,255,255,0.1); }
.drive-status-dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #666;
  transition: all var(--transition);
}
.drive-status-dot.connected{ background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,0.6); }
.drive-status-text{ white-space: nowrap; }

/* --- Responsive: mobile --- */
@media (max-width: 640px){
  .new-listener-cards{ grid-template-columns: 1fr; }
  .admin-header-actions{ gap: 6px; }
  .drive-status{ padding: 6px 10px; }
  .drive-status-text{ display: none; }
  .file-actions{ gap: 4px; }
  .btn-sm{ padding: 5px 8px; font-size: 11px; }
  .admin-main{ padding: 20px 14px 80px; }
}

/* ==========================================================
   USER PANEL — Search focus animation (clean gold border)
   ========================================================== */
.search-box{
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
}
.search-box:focus-within{
  border-color: rgba(201,168,76,0.6);
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
  background: rgba(255,255,255,0.12);
}
.search-box .search-icon{
  width: 18px; height: 18px;
  margin-left: 14px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  transition: color var(--transition);
}
.search-box:focus-within .search-icon{ color: var(--gold); }
.search-box .search-field{
  flex: 1;
  padding: 11px 12px 11px 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #fff;
  outline: none;
}
.search-box .search-field::placeholder{ color: rgba(255,255,255,0.35); }
.search-box .search-clear{
  display: none;
  width: 26px; height: 26px;
  margin-right: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}
.search-box .search-clear.visible{ display: flex; }
.search-box .search-clear:hover{ background: rgba(255,255,255,0.25); color: #fff; }
.search-box .search-clear svg{ width: 13px; height: 13px; }

/* ==========================================================
   REFINED ADMIN STYLES — Count, items, dropzone, actions
   ========================================================== */

/* --- Listener count (clean pill badge) --- */
.admin-list-count{
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-list-count::before{
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-light);
  flex-shrink: 0;
}

/* --- Admin items list (clean horizontal cards) --- */
.admin-items-grid{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-items-grid .item-card{
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: auto;
  border-radius: var(--radius-m);
  animation: none;
  position: relative;
}
.admin-items-grid .item-card::before{ display: none; }
.admin-items-grid .item-card-icon{
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--steel-100), var(--steel-50));
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.admin-items-grid .item-card:hover .item-card-icon{
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-950);
}
.admin-items-grid .item-card-icon svg{ width: 18px; height: 18px; }





/* --- Dropzone (files view) — clean & minimal --- */
.dropzone{
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-l);
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface-alt);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dropzone:hover,
.dropzone.dropzone-active{
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
  color: var(--heading);
}
.dropzone:hover .dropzone-icon,
.dropzone.dropzone-active .dropzone-icon{ opacity: 0.8; }
.dropzone-icon{
  margin-bottom: 4px;
  opacity: 0.35;
  transition: opacity var(--transition);
  color: var(--ink-muted);
}
.dropzone-title{
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
}
.dropzone-hint{
  font-size: 12px;
  color: var(--ink-faint);
}

/* --- File row (files view) --- */
.file-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}
.file-row:hover{
  border-color: var(--gold);
  box-shadow: var(--shadow-raised);
}
.file-icon{
  width: 42px; height: 42px;
  border-radius: var(--radius-s);
  background: var(--steel-100);
  color: var(--navy-800);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.file-info{ flex: 1; min-width: 0; }
.file-name{
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta{ font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.file-actions{
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* --- Button base --- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary{
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-color: var(--navy-700);
}
.btn-primary:hover{ background: linear-gradient(135deg, var(--navy-700), var(--navy-600)); box-shadow: var(--shadow-raised); }
.btn-danger{
  background: linear-gradient(135deg, var(--danger), var(--danger-light));
  color: #fff;
}
.btn-danger:hover{ box-shadow: var(--shadow-raised); }
.btn-ghost{
  background: transparent;
  color: var(--ink-muted);
  border-color: transparent;
}
.btn-ghost:hover{ background: var(--steel-50); color: var(--heading); border-color: var(--border); }
.btn-outline{
  background: transparent;
  color: var(--heading);
  border-color: var(--border);
}
.btn-outline:hover{ border-color: var(--gold); color: var(--heading); background: rgba(201,168,76,0.05); }
.btn-sm{ padding: 6px 12px; font-size: 12px; }

/* --- Icon button --- */
.icon-btn{
  width: 36px; height: 36px;
  border-radius: var(--radius-s);
  border: none;
  background: transparent;
  color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover{ background: var(--steel-50); color: var(--heading); }
.icon-btn svg{ width: 20px; height: 20px; }

/* --- Upload progress list --- */
.upload-progress-list{ display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.upload-progress-row{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.upload-progress-name{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.upload-progress-bar-track{
  flex: 1;
  height: 4px;
  background: var(--steel-100);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
}
.upload-progress-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 150ms ease;
}
.progress-pct{ font-size: 12px; font-weight: 600; color: var(--ink-muted); min-width: 36px; text-align: right; }

/* --- Confirm dialog --- */
.confirm-panel{
  background: var(--surface);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-l);
  padding: 28px 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-overlay);
}
.confirm-message{ font-size: 15px; color: var(--heading); font-weight: 500; margin: 0 0 20px; }
.confirm-actions{ display: flex; gap: 10px; justify-content: center; }

/* --- Settings card (admin) --- */
.settings-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.settings-card h2{
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 16px;
}
.settings-row{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.settings-row:last-child{ margin-bottom:0; }
.settings-row .text-input{ flex:1; min-width:160px; margin-bottom:0; }
.settings-hint{ font-size:12px; color: var(--ink-faint); margin: 8px 0 0; }

/* --- Contact fields (files view) --- */
.contact-fields{ display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.contact-field-row{ display: flex; align-items: center; gap: 10px; }
.contact-field-label{ font-size: 12px; font-weight: 600; color: var(--ink-muted); width: 56px; flex-shrink: 0; }
.contact-field-row .text-input{ margin-bottom: 0; flex: 1; }

/* --- Auth status row (settings) --- */
.auth-status-row{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
}
.auth-status-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger-light);
  flex-shrink: 0;
  transition: all var(--transition);
}
.auth-status-dot.active{
  background: var(--success-light);
  box-shadow: 0 0 6px rgba(58,154,98,0.5);
}

/* --- Remove password row --- */
.remove-password-row{ margin-top: 14px; }

/* --- Drive signout --- */
.drive-signout{ font-size: 12px; padding: 6px 12px; }

/* --- Admin view titles --- */
.admin-title-clickable{ cursor: pointer; transition: color var(--transition); }
.admin-title-clickable:hover{ color: var(--heading-hover); }

/* --- Admin main --- */
.admin-main{ max-width: 960px; margin: 0 auto; padding: 28px 20px 100px; }

/* --- Admin header actions --- */
.admin-header-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}

/* --- Drive status button --- */
.drive-status{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.drive-status:hover{ background: rgba(255,255,255,0.1); }
.drive-status-dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #666;
  transition: all var(--transition);
}
.drive-status-dot.connected{ background: #2ecc71; box-shadow: 0 0 6px rgba(46,204,113,0.6); }
.drive-status-text{ white-space: nowrap; }

/* --- Preview overlay --- */
.preview-overlay .preview-panel{
  max-width: 900px;
  max-height: 95vh;
  margin: 0 10px;
}
.overlay-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.overlay-title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--heading);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.preview-body{ padding: 16px 20px; overflow-y: auto; max-height: calc(95vh - 60px); }
.preview-fallback{ text-align: center; padding: 40px 20px; color: var(--ink-muted); }

/* --- Overlay panel --- */
.overlay-panel{
  background: var(--surface);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  overflow-y: auto;
  box-shadow: var(--shadow-overlay);
}

/* --- Responsive --- */
@media (max-width: 640px){
  .admin-main{ padding: 20px 14px 80px; }
  .file-actions{ gap: 4px; }
  .btn-sm{ padding: 5px 8px; font-size: 11px; }
  .drive-status{ padding: 6px 10px; }
  .drive-status-text{ display: none; }
}

/* --- Text input base --- */
.text-input{
  padding: 11px 16px;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--border);
  font-size: 14px;
  outline: none;
  min-width: 0;
  flex: 1;
  background: var(--surface);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: border-color 200ms ease, box-shadow 240ms ease;
}
.text-input:focus{ border-color: rgba(201,168,76,0.6); transform: translateY(-1px); }
.text-input::placeholder{ color: var(--ink-faint); }

/* --- Admin file list --- */
.admin-file-list{ display: flex; flex-direction: column; gap: 8px; }

/* --- New listener section --- */
.new-listener-section{ margin-bottom: 24px; }
.new-listener-heading{
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 12px;
}

/* --- Method cards (2-column grid) --- */
.new-listener-cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.method-card{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.method-card:hover{
  border-color: var(--gold);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}
.method-card.active{
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
  box-shadow: var(--shadow-raised), 0 0 20px rgba(201,168,76,0.12);
}
.method-card-icon{
  width: 44px; height: 44px;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--steel-100), var(--steel-50));
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.method-card:hover .method-card-icon,
.method-card.active .method-card-icon{
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-950);
}
.method-card-icon svg{ width: 22px; height: 22px; }
.method-card-text{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.method-card-title{
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
  line-height: 1.2;
}
.method-card-desc{
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* --- Method panels (expandable) --- */
.method-panel{
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1), opacity 250ms ease;
  opacity: 0;
  margin-bottom: 0;
}
.method-panel.open{
  max-height: 600px;
  opacity: 1;
  margin-bottom: 16px;
}

/* --- Quick dropzone --- */
.quick-dropzone{
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-l);
  padding: 28px 20px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--surface-alt);
  cursor: pointer;
  transition: all var(--transition);
  display: block;
}
.quick-dropzone:hover,
.quick-dropzone.dropzone-active{
  border-color: var(--gold);
  background: rgba(201,168,76,0.07);
  color: var(--heading);
}

/* --- Manual add form --- */
.manual-add-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
}
.manual-field{ display: flex; flex-direction: column; gap: 4px; }
.manual-label{
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.manual-add-form .text-input{ margin-bottom: 0; }

/* --- Admin search bar --- */
.admin-search-bar{ margin-bottom: 16px; }
.admin-search-box{
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.admin-search-box:focus-within{
  border-color: rgba(201,168,76,0.55);
  box-shadow: var(--shadow-card), 0 2px 12px rgba(201,168,76,0.12);
  transform: translateY(-1px);
}
.admin-search-box .search-field{
  flex: 1;
  padding: 12px 14px 12px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.admin-search-box .search-field::placeholder{ color: var(--ink-faint); }

/* --- Admin search clear --- */
.admin-search-box .search-clear{
  display: none;
  width: 28px; height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  border: none;
  background: var(--steel-100);
  color: var(--ink-muted);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}
.admin-search-box .search-clear.visible{ display: flex; }
.admin-search-box .search-clear:hover{ background: var(--steel-300); color: var(--ink); }
.admin-search-box .search-clear svg{ width: 14px; height: 14px; }

/* --- Admin auth-check gate --- */
body.auth-pending #admin-panel{ display:none; }
#auth-check-screen.splash-hidden{ opacity:0; visibility:hidden; pointer-events:none; }

/* ==========================================================
   USER PANEL — Search (no icon, clean focus)
   ========================================================== */
.search-box{
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
}
.search-box:focus-within{
  border-color: rgba(201,168,76,0.6);
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
  background: rgba(255,255,255,0.12);
}
.search-box .search-field{
  flex: 1;
  padding: 11px 40px 11px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #fff;
  outline: none;
}
.search-box .search-field::placeholder{ color: rgba(255,255,255,0.35); }
.search-box .search-clear{
  position: absolute;
  right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition: all 240ms cubic-bezier(.34,1.56,.64,1);
}
.search-box .search-clear.visible{ opacity: 1; transform: scale(1); pointer-events: auto; }
.search-box .search-clear:hover{ background: rgba(255,255,255,0.2); color: #fff; }
.search-box .search-clear svg{ width: 13px; height: 13px; }

/* ==========================================================
   USER PANEL — Item cards (grid layout)
   ========================================================== */
.items-grid .item-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 24px 22px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 130px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  animation: cardIn 420ms cubic-bezier(.34,1.56,.64,1) both;
}
.items-grid .item-card:nth-child(1){ animation-delay: 0ms; }
.items-grid .item-card:nth-child(2){ animation-delay: 40ms; }
.items-grid .item-card:nth-child(3){ animation-delay: 80ms; }
.items-grid .item-card:nth-child(4){ animation-delay: 120ms; }
.items-grid .item-card:nth-child(5){ animation-delay: 160ms; }
.items-grid .item-card:nth-child(n+6){ animation-delay: 200ms; }
.items-grid .item-card::before{
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--steel-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}
.items-grid .item-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-raised), var(--shadow-glow);
  border-color: var(--gold);
}
.items-grid .item-card:hover::before{ transform: scaleX(1); }
.items-grid .item-card:active{ transform: translateY(-1px) scale(0.99); }
.items-grid .item-card:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; }
.items-grid .item-card-icon{
  width: 42px; height: 42px;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--steel-100), var(--steel-50));
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.items-grid .item-card:hover .item-card-icon{
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-950);
  transform: scale(1.05);
}
.items-grid .item-card-icon svg{ width: 20px; height: 20px; }
.items-grid .item-card-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--heading);
  line-height: 1.2;
  transition: color var(--transition);
}
.items-grid .item-card:hover .item-card-name{ color: var(--heading-hover); }
.items-grid .item-card-count{
  font-size: 12.5px;
  color: var(--ink-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.items-grid .item-card-count::before{
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--steel-300);
  flex-shrink: 0;
}

/* ==========================================================
   ADMIN PANEL — Item card details (inside admin-items-grid)
   ========================================================== */
.admin-items-grid .item-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  position: relative;
}
.admin-items-grid .item-card:hover{
  border-color: var(--gold);
  box-shadow: var(--shadow-raised);
  transform: translateX(2px);
}
.admin-items-grid .item-card::before{ display: none; }
.admin-items-grid .item-card-icon{
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--steel-100), var(--steel-50));
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.admin-items-grid .item-card:hover .item-card-icon{
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-950);
}
.admin-items-grid .item-card-icon svg{ width: 18px; height: 18px; }
.admin-items-grid .item-card-body{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-items-grid .item-card-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--heading);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition);
}
.admin-items-grid .item-card:hover .item-card-name{ color: var(--heading-hover); }
.admin-items-grid .item-card-count{
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.admin-items-grid .item-card-count::before{
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--steel-300);
  flex-shrink: 0;
}
.admin-items-grid .item-card-right{
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.admin-items-grid .item-card-arrow{
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  transition: all var(--transition);
  border-radius: var(--radius-xs);
}
.admin-items-grid .item-card-arrow svg{ width: 16px; height: 16px; }
.admin-items-grid .item-card:hover .item-card-arrow{ color: var(--gold); transform: translateX(2px); }
.admin-items-grid .item-card-actions{
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}
.admin-items-grid .item-card:hover .item-card-actions{ opacity: 1; }
.admin-items-grid .item-action-btn{
  width: 30px; height: 30px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.admin-items-grid .item-action-btn:hover{ background: var(--steel-50); color: var(--heading); }
.admin-items-grid .item-action-btn.danger:hover{ background: var(--danger-bg); color: var(--danger); }
.admin-items-grid .item-action-btn svg{ width: 15px; height: 15px; }

/* --- Dark theme: file icons background --- */
html[data-theme="dark"] .file-icon{
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .file-row{
  border-color: #223347;
}
html[data-theme="dark"] .file-row:hover{
  background: #16283b;
}
html[data-theme="dark"] .file-name{ color: #dbe4ee; }
html[data-theme="dark"] .file-meta{ color: #93a5b8; }

/* --- Dark theme: admin items grid cards --- */
html[data-theme="dark"] .admin-items-grid .item-card{
  background: #101d2c;
  border-color: #223347;
}
html[data-theme="dark"] .admin-items-grid .item-card:hover{
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(201,168,76,0.15), 0 2px 8px rgba(0,0,0,0.2);
}
html[data-theme="dark"] .admin-items-grid .item-card-name{ color: #f2f6fa; }
html[data-theme="dark"] .admin-items-grid .item-card-count{ color: #93a5b8; }
html[data-theme="dark"] .admin-items-grid .item-card-icon{
  background: linear-gradient(145deg, #1e4b74, #0f2942);
}
html[data-theme="dark"] .admin-items-grid .item-card-icon svg{ color: #fff; }

/* --- Dark theme: method cards (Sürətli əlavə / Manual əlavə) --- */
html[data-theme="dark"] .method-card{
  background: #101d2c;
  border-color: #223347;
}
html[data-theme="dark"] .method-card:hover{
  border-color: var(--gold);
  box-shadow: 0 8px 32px rgba(201,168,76,0.12);
}
html[data-theme="dark"] .method-card.active{
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}
html[data-theme="dark"] .method-card-icon{
  background: linear-gradient(145deg, #2a5580, #1a3d5c);
  color: #cfe0f2;
}
html[data-theme="dark"] .method-card:hover .method-card-icon,
html[data-theme="dark"] .method-card.active .method-card-icon{
  background: linear-gradient(145deg, var(--gold), var(--gold-light));
  color: #0a1c2e;
}
html[data-theme="dark"] .method-card-title{ color: #f2f6fa; }
html[data-theme="dark"] .method-card-desc{ color: #93a5b8; }

/* --- Dark theme: settings card --- */
html[data-theme="dark"] .settings-card{
  background: #101d2c;
  border-color: #223347;
}
html[data-theme="dark"] .settings-card h2{ color: #f2f6fa; }
html[data-theme="dark"] .auth-status-row{
  background: #16283b;
  border-color: #223347;
  color: #93a5b8;
}

/* --- Dark theme: contact fields --- */
html[data-theme="dark"] .contact-field-label{ color: #93a5b8; }

/* --- Dark theme: dropzone --- */
html[data-theme="dark"] .dropzone{
  background: #16283b;
  border-color: #2c4256;
}
html[data-theme="dark"] .dropzone:hover,
html[data-theme="dark"] .dropzone.dropzone-active{
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
}
html[data-theme="dark"] .dropzone-title{ color: #f2f6fa; }
html[data-theme="dark"] .dropzone-hint{ color: #64798d; }

/* --- Dark theme: quick dropzone --- */
html[data-theme="dark"] .quick-dropzone{
  background: #16283b;
  border-color: #2c4256;
}

/* --- Dark theme: manual add form --- */
html[data-theme="dark"] .manual-add-form{
  background: #101d2c;
  border-color: #223347;
}
html[data-theme="dark"] .manual-label{ color: #93a5b8; }

/* --- Dark theme: admin search box --- */
html[data-theme="dark"] .admin-search-box{
  background: #101d2c;
  border-color: #223347;
}
html[data-theme="dark"] .admin-search-box .search-field{ color: #dbe4ee; }
html[data-theme="dark"] .admin-search-box .search-field::placeholder{ color: #64798d; }

/* --- Dark theme: upload progress --- */
html[data-theme="dark"] .upload-progress-row{
  background: #16283b;
  border-color: #223347;
}

/* --- Dark theme: admin list count --- */
html[data-theme="dark"] .admin-list-count{ color: #93a5b8; }

/* --- Dark theme: overlay --- */
html[data-theme="dark"] .overlay{
  background: rgba(5,10,18,0.65);
}
html[data-theme="dark"] .overlay-panel,
html[data-theme="dark"] .preview-panel,
html[data-theme="dark"] .confirm-panel{
  background: #101d2c;
}
html[data-theme="dark"] .overlay-title{ color: #f2f6fa; }
html[data-theme="dark"] .confirm-message{ color: #dbe4ee; }

/* --- Dark theme: contact pills --- */
html[data-theme="dark"] .contact-pill{
  background: #16283b;
  border-color: #223347;
  color: #93a5b8;
}





.merge-panel{
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.merge-step{ padding: 0 20px 20px; }
.merge-step-desc{
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}
.merge-search-wrap{ margin-bottom: 12px; }
.merge-search-wrap .text-input{ width: 100%; }
.merge-listeners-list{
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}
.merge-listeners-list::-webkit-scrollbar{ width: 5px; }
.merge-listeners-list::-webkit-scrollbar-track{ background: transparent; }
.merge-listeners-list::-webkit-scrollbar-thumb{ background: var(--border-strong); border-radius: 3px; }

.merge-listener-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.merge-listener-item:hover{
  border-color: var(--gold);
  background: rgba(201,168,76,0.04);
}
.merge-listener-item.selected{
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.merge-listener-item.no-pdf{
  opacity: 0.5;
}
.merge-checkbox{
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}
.merge-listener-info{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.merge-listener-name{
  font-weight: 600;
  font-size: 14px;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merge-listener-count{
  font-size: 12px;
  color: var(--ink-muted);
}
.merge-check-icon{
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.merge-selected-count{
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 12px;
  min-height: 18px;
}
.merge-action-btn{
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
}
.merge-action-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
.merge-action-row{
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.merge-action-row .btn{ flex: 1; padding: 12px; font-size: 15px; font-weight: 600; }
.merge-progress-wrap{
  text-align: center;
  padding: 30px 0;
}
.merge-progress-bar-track{
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.merge-progress-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 3px;
  transition: width 200ms ease;
}
.merge-progress-text{
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
}
.merge-done{
  text-align: center;
  padding: 30px 0;
}
.merge-done-text{
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin: 16px 0 20px;
}
.merge-done-actions{
  display: flex;
  gap: 12px;
  justify-content: center;
}
.merge-done-actions .btn{
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
}

/* --- Preview step (step 4): shows the merged PDF before download --- */
.merge-panel:has(#merge-step-4:not(.hidden)){
  max-width: 760px;
}
.merge-preview-warning{
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-m);
  padding: 10px 12px;
  margin: 0 0 12px;
}
.merge-preview-frame-wrap{
  width: 100%;
  height: 62vh;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: #525659;
}
.merge-preview-frame{
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.merge-upload-status{
  text-align: center;
  margin: 10px 0 0;
}

/* --- Dark theme: merge overlay --- */
html[data-theme="dark"] .merge-panel{
  background: #101d2c;
}
html[data-theme="dark"] .merge-listener-item{
  background: #16283b;
  border-color: #223347;
}
html[data-theme="dark"] .merge-listener-item:hover{
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
}
html[data-theme="dark"] .merge-listener-item.selected{
  border-color: var(--gold);
  background: rgba(201,168,76,0.1);
}
html[data-theme="dark"] .merge-listener-name{ color: #f2f6fa; }
html[data-theme="dark"] .merge-listener-count{ color: #93a5b8; }
html[data-theme="dark"] .merge-step-desc{ color: #93a5b8; }
html[data-theme="dark"] .merge-progress-text{ color: #93a5b8; }
html[data-theme="dark"] .merge-done-text{ color: #f2f6fa; }
html[data-theme="dark"] .merge-progress-bar-track{ background: #223347; }

/* --- Blue theme: merge overlay --- */
html[data-theme="blue"] .merge-panel{
  background: #ffffff;
}
html[data-theme="blue"] .merge-listener-item{
  background: #f3f7fc;
  border-color: #c8daf0;
}
html[data-theme="blue"] .merge-listener-item:hover{
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
}
html[data-theme="blue"] .merge-listener-item.selected{
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}
html[data-theme="blue"] .merge-progress-bar-track{ background: #c8daf0; }

/* ==========================================================
   MERGE PDF — Button + Overlay
   ========================================================== */
#merge-pdf-btn{
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  gap: 6px;
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-color: var(--navy-700);
}
#merge-pdf-btn:hover{ background: linear-gradient(135deg, var(--navy-700), var(--navy-600)); box-shadow: var(--shadow-raised); }

@media (max-width: 640px){
  #merge-pdf-btn{
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 11px;
    gap: 4px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
    color: #fff;
    border-color: var(--navy-700);
    order: 1;
  }
  #merge-pdf-btn svg{
    width: 14px;
    height: 14px;
  }
  .header-inner{
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .search-container{ order: 3; flex-basis: 100%; max-width: none; }
  .theme-switch{ order: 2; margin-left: auto; }
}

