/* ============================================================
   PWA Builder - UI Styles
   Ramaker Platform — Redesigned
   ============================================================ */

:root {
  --brand:         #0f85a9;
  --brand-dark:    #093653;
  --brand-light:   #e8f6fb;
  --brand-accent:  #00c9f5;
  --sidebar-bg:    #06243a;
  --sidebar-text:  rgba(255,255,255,0.72);
  --sidebar-active: #0f85a9;
  --bg:            #f0f5f9;
  --card:          #ffffff;
  --border:        #dde8f0;
  --text:          #0d1f2d;
  --text-muted:    #5a7080;
  --success:       #0d9466;
  --success-bg:    #ecfdf5;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 4px rgba(9,54,83,0.07), 0 4px 16px rgba(9,54,83,0.06);
  --shadow-md:     0 6px 24px rgba(9,54,83,0.12);
  --sidebar-width: 230px;
  --header-height: 64px;
}

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

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

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,133,169,0.25); border-radius: 3px; }

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #06243a 0%, #093653 45%, #0f85a9 100%);
  position: relative;
  overflow: hidden;
}

/* Background blobs */
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: rgba(0,201,245,0.1);
  border-radius: 50%;
  filter: blur(80px);
  top: -250px; right: -200px;
  animation: builderBlob1 12s ease-in-out infinite;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: rgba(15,133,169,0.15);
  border-radius: 50%;
  filter: blur(60px);
  bottom: -150px; left: -100px;
  animation: builderBlob2 10s ease-in-out infinite;
}

@keyframes builderBlob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-20px,30px) scale(1.08); }
}
@keyframes builderBlob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(15px,-20px) scale(1.06); }
}

/* Grid overlay */
.login-page .login-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

#login-screen {
  width: 100%;
  max-width: 400px;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 44px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  animation: loginCardIn 0.5s ease both;
}

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

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-brand-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(15,133,169,0.35);
  animation: iconBounce 0.6s cubic-bezier(0.175,0.885,0.32,1.275) 0.1s both;
}

@keyframes iconBounce {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.login-brand-icon .material-icons-round {
  font-size: 32px;
  color: #fff;
}

.login-brand h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#builder-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
}

/* Sidebar pattern */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
}

.sidebar-brand .material-icons-round {
  color: var(--brand-accent);
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(0,201,245,0.5));
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(15,133,169,0.22);
  color: var(--brand-accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-accent));
  border-radius: 0 3px 3px 0;
}

.nav-item .material-icons-round { font-size: 20px; }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  position: relative;
  z-index: 1;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   VIEWS
   ============================================================ */
.view {
  padding: 28px;
  flex: 1;
  animation: viewSlideIn 0.25s ease;
}

@keyframes viewSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================
   APP GRID (Dashboard)
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.app-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15,133,169,0.2);
}

.app-card-hero {
  height: 130px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  position: relative;
  overflow: hidden;
}

.app-card-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

.app-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.3s, transform 0.3s;
}

.app-card:hover .app-card-hero img {
  opacity: 0.75;
  transform: scale(1.04);
}

.app-card-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-card-hero-overlay .material-icons-round {
  font-size: 48px;
  color: rgba(255,255,255,0.4);
}

.app-card-body { padding: 18px; }

.app-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.app-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.app-card-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.badge-green { background: var(--success-bg); color: var(--success); }
.badge-blue  { background: #eff6ff; color: #2563eb; }
.badge-gray  { background: #f1f5f9; color: #64748b; }

.app-card-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.copy-url-btn { padding: 6px 8px; }
.copy-url-btn .material-icons-round { font-size: 14px; }

/* ============================================================
   VENDOR GRID
   ============================================================ */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.vendor-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.vendor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(15,133,169,0.2);
}

.vendor-card-hero {
  height: 110px;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.vendor-card-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.vendor-card-hero .material-icons-round {
  font-size: 52px;
  color: rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}

.vendor-card-body { padding: 18px; }

.vendor-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.vendor-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.vendor-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.vendor-card-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   ACCOUNTS VIEW
   ============================================================ */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip-count {
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-weight: 600;
}
.filter-chip.active .chip-count { background: rgba(255,255,255,0.25); }

.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   VENDOR SECTION (Vendors page hierarchy)
   ============================================================ */

.vendor-section {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.vendor-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
}
.vendor-section-icon { font-size: 22px; opacity: 0.85; }
.vendor-section-chevron {
  font-size: 20px;
  opacity: 0.8;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.vendor-section.vs-body-collapsed .vendor-section-chevron { transform: rotate(-90deg); }
.vendor-section.vs-body-collapsed .vendor-section-body { display: none; }
.vendor-section-name { flex: 1; min-width: 0; }
.vendor-section-name strong { display: block; font-size: 1rem; font-weight: 600; }
.vendor-section-sub { font-size: 0.8rem; opacity: 0.8; }
.vendor-section-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.vendor-section-actions .btn { border-color: rgba(255,255,255,0.35); color: #fff; background: transparent; }
.vendor-section-actions .btn:hover { background: rgba(255,255,255,0.15); }
.vendor-section-actions .btn-ghost { color: rgba(255,255,255,0.8); }
.vendor-section-actions .btn-ghost:hover { background: rgba(255,255,255,0.15); color: #fff; }
.vendor-section-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vendor-subsection-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}
.vendor-subsection-label .material-icons-round { font-size: 15px; }
.vendor-subsection-label .vs-chevron {
  margin-left: auto;
  font-size: 18px;
  transition: transform 0.2s ease;
}
.vendor-subsection.vs-collapsed .vs-chevron { transform: rotate(-90deg); }
.vendor-subsection.vs-collapsed .vs-contacts-list,
.vendor-subsection.vs-collapsed .vs-contact-form-wrap,
.vendor-subsection.vs-collapsed .vs-clients-list,
.vendor-subsection.vs-collapsed .vs-client-form-wrap,
.vendor-subsection.vs-collapsed .vs-apps-list { display: none; }
.vs-contacts-list,
.vs-clients-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vs-contact-form-wrap,
.vs-client-form-wrap { margin-bottom: 6px; }

/* Vendor Apps list */
.vs-apps-list { display: flex; flex-direction: column; }
.vs-app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  gap: 10px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}
.vs-app-row:last-child { border-bottom: none; }
.vs-app-row-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.vs-app-icon { font-size: 16px !important; color: #94a3b8; }
.vs-app-name { font-weight: 500; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-app-sub { color: #94a3b8; font-size: 11px; margin-left: 2px; }
.vs-app-row-status { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.vs-app-lock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  white-space: nowrap;
}
.vs-app-lock .material-icons-round { font-size: 13px !important; }
.vs-app-unlocked {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #10b981;
  white-space: nowrap;
}
.vs-app-unlocked .material-icons-round { font-size: 13px !important; }
.vs-unlock-btn {
  font-size: 10px !important;
  padding: 1px 7px !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  white-space: nowrap;
}
.vs-unlock-btn:hover { color: #0f172a !important; border-color: #94a3b8 !important; background: #f1f5f9 !important; }

/* ============================================================
   RECIPIENTS PANEL (App Editor)
   ============================================================ */

.recipients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.recipient-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s;
}
.recipient-row:hover { border-color: var(--brand); }
.recipient-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--brand); width: 15px; height: 15px; }
.recipient-info { flex: 1; min-width: 0; }
.recipient-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.recipient-email { font-size: 0.78rem; color: var(--text-muted); }

/* ============================================================
   SEND DELIVERABLE MODAL
   ============================================================ */

.send-recipients-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
}
.recipient-send-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.12s;
}
.recipient-send-row:hover { border-color: var(--brand); }
.recipient-send-row input[type="checkbox"] { flex-shrink: 0; accent-color: var(--brand); width: 15px; height: 15px; }
.send-recipient-email { color: var(--text-muted); font-size: 0.82rem; }
.contact-item-wrap { margin-bottom: 2px; }
.account-contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.12s, box-shadow 0.12s;
  cursor: pointer;
}
.account-contact-row:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.account-contact-row .contact-row-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.contact-chevron {
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s;
  user-select: none;
}
.contact-chevron.open { transform: rotate(180deg); }
.contact-details-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: var(--bg);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.contact-details-panel.open { max-height: 200px; }
.contact-details-inner {
  padding: 8px 16px 12px 62px;
}
.contact-detail-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 0.82rem;
}
.contact-detail-label { color: var(--text-muted); font-weight: 500; }
.contact-detail-value { color: var(--text); }
.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.contact-role { color: var(--text-muted); font-weight: 400; }
.account-vendor-badge { flex-shrink: 0; }
.sms-ok-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

.accounts-contact-form {
  margin-bottom: 16px;
}
.accounts-form-inner {
  background: var(--card);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px;
}

/* ============================================================
   VIEW TOGGLE (grid / list)
   ============================================================ */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.view-toggle-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.view-toggle-btn:hover { background: var(--bg); color: var(--text); }
.view-toggle-btn.active { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; }
.view-toggle-btn .material-icons-round { font-size: 18px; }

/* ---- Vendor list view ---- */
.vendor-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vendor-grid.list-view .vendor-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: var(--radius-sm);
  overflow: visible;
  transition: transform 0.2s, box-shadow 0.2s;
}

.vendor-grid.list-view .vendor-card-hero {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  margin: 8px 14px 8px 10px;
  flex-shrink: 0;
}

.vendor-grid.list-view .vendor-card-hero .material-icons-round {
  font-size: 20px;
}

.vendor-grid.list-view .vendor-card-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  min-width: 0;
}

.vendor-grid.list-view .vendor-card-name {
  width: 220px;
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.875rem;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vendor-grid.list-view .vendor-card-subtitle {
  flex: 1;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.vendor-grid.list-view .vendor-card-footer {
  border-top: none;
  border-left: 1px solid var(--border);
  background: transparent;
  padding: 0 14px;
  align-self: stretch;
  min-height: 60px;
  align-items: center;
  gap: 10px;
}

/* ---- App list view ---- */
.app-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.app-grid.list-view .app-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: var(--radius-sm);
  overflow: visible;
}

.app-grid.list-view .app-card-hero {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  margin: 8px 14px 8px 10px;
  flex-shrink: 0;
}

.app-grid.list-view .app-card-hero img { border-radius: var(--radius-sm); }

.app-grid.list-view .app-card-hero-overlay .material-icons-round {
  font-size: 20px;
}

.app-grid.list-view .app-card-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  min-width: 0;
}

.app-grid.list-view .app-card-name {
  width: 220px;
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.875rem;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-grid.list-view .app-card-subtitle {
  flex: 1;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.app-grid.list-view .app-card-meta {
  margin-bottom: 0;
  flex-shrink: 0;
  width: 180px;
}

.app-grid.list-view .app-card-actions {
  border-top: none;
  border-left: 1px solid var(--border);
  padding: 0 12px;
  padding-top: 0;
  align-self: stretch;
  min-height: 60px;
  align-items: center;
}

/* Comm-required indicator on vendor modal labels */
.comm-required {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border: 1px solid rgba(15,133,169,0.25);
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
}

/* ============================================================
   EDITOR
   ============================================================ */
.editor-tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  padding: 6px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.editor-tab:hover { background: var(--bg); color: var(--text); }

.editor-tab.active {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,133,169,0.3);
}

.editor-tab .material-icons-round { font-size: 16px; }

/* ---- Panels ---- */
.panel-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.panel-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.form-grid.col-3 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field textarea,
.field select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,133,169,0.1);
}

.field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.65;
}

.field .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field .hint a { color: var(--brand); text-decoration: none; }
.field .hint a:hover { text-decoration: underline; }

/* Color field */
.color-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-field input[type="color"] {
  width: 42px;
  height: 40px;
  padding: 2px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
  flex-shrink: 0;
}

.color-field input[type="text"] {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.toggle-label input[type="checkbox"] { display: none; }

.toggle {
  width: 46px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.toggle-label input:checked + .toggle::after { left: 23px; }

/* ============================================================
   USERS LIST
   ============================================================ */
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child { border-bottom: none; }

.user-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.user-row input:focus { border-color: var(--brand); }

.user-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--brand-light);
  color: var(--brand-dark);
  white-space: nowrap;
}

/* ============================================================
   TABS LIST
   ============================================================ */
.tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

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

.tab-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-row:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: translateX(2px);
}

.tab-row.selected {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 2px 8px rgba(15,133,169,0.15);
}

.tab-row .drag-handle {
  cursor: grab;
  color: var(--text-muted);
}

.tab-row .material-icons-round.tab-icon { color: var(--brand); font-size: 20px; }

.tab-row-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.875rem;
}

.tab-row-actions { display: flex; gap: 4px; }

/* ============================================================
   TAB CONTENT EDITOR
   ============================================================ */
.tab-editor {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  animation: editorIn 0.2s ease;
}

@keyframes editorIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.icon-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-input-wrap input {
  flex: 1;
}
.icon-input-wrap #te-icon-preview {
  font-size: 1.5rem;
  color: var(--brand);
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
#te-id {
  background: var(--bg);
  color: var(--text-muted);
  cursor: default;
}

.tab-editor-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.sections-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 22px 0 10px;
}

.te-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.section-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.section-card:hover { border-color: rgba(15,133,169,0.3); }

.section-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: #dde6ee;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.section-card-header:hover { background: var(--brand-light); }

.section-card-header .material-icons-round { color: var(--brand); font-size: 18px; }
.section-card-label { flex: 1; font-weight: 600; font-size: 0.875rem; }

.section-card-body {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-copy-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-alt, #f4f6f8);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.section-copy-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-copy-select {
  flex: 1;
  min-width: 100px;
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
}
.section-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  background: #fff;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.section-copy-btn:hover { background: var(--brand); color: #fff; }
.section-copy-btn .material-icons-round { font-size: 14px; }

.add-section-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255,255,255,0.08);
  transition: border-color 0.2s;
  margin-bottom: 10px;
}

.add-section-bar .text-muted { color: var(--sidebar-text); }

.add-section-bar .btn-outline {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.25);
}
.add-section-bar .btn-outline:hover {
  color: #fff;
  border-color: var(--brand);
  background: rgba(15,133,169,0.3);
}

.add-section-bar:hover { border-color: rgba(15,133,169,0.5); }

.add-section-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* File links editor */
.file-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.file-link-row:last-child { border-bottom: none; }
.file-link-row input { flex: 1; }

/* ============================================================
   THEME PREVIEW
   ============================================================ */
.theme-preview {
  margin-top: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 320px;
  border: 1px solid var(--border);
}

.tp-header {
  background: var(--brand);
  color: #fff;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 0.875rem;
}

.tp-body { background: var(--brand); }

.tp-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  color: rgba(255,255,255,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  transition: background 0.15s;
}

.tp-tab:hover { background: rgba(255,255,255,0.08); }
.tp-tab .material-icons-round { font-size: 20px; opacity: 0.8; }
.tp-tab span:nth-child(2) { flex: 1; }
.tp-arrow { font-size: 16px !important; opacity: 0.4 !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.btn:hover::after { transform: translateX(0); }

.btn .material-icons-round { font-size: 16px; }

.btn-sm { padding: 6px 13px; font-size: 0.8rem; }
.btn-sm .material-icons-round { font-size: 14px; }

.input-row { display: flex; gap: 8px; align-items: center; }
.input-row input { flex: 1; min-width: 0; }
.btn-auto-fill { white-space: nowrap; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,133,169,0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,133,169,0.35);
}

.btn-success {
  background: linear-gradient(135deg, #0a7a52, var(--success));
  color: #fff;
  box-shadow: 0 4px 12px rgba(13,148,102,0.25);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13,148,102,0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, var(--danger));
  color: #fff;
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-outline {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon .material-icons-round { font-size: 18px; }

.btn-full { width: 100%; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-error::before { content: '⚠'; font-size: 14px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,36,58,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.25s cubic-bezier(0.175,0.885,0.32,1.275);
  border: 1px solid var(--border);
}

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

.modal-sm { max-width: 380px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15,133,169,0.04), transparent);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.modal-header .material-icons-round { color: var(--brand); }

.modal-body {
  padding: 22px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.publish-url {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  margin: 12px 0;
  word-break: break-all;
  color: var(--brand-dark);
  border-left: 3px solid var(--brand);
}

.publish-status,
.publish-success {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.publish-status { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.publish-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }

.publish-deliverable-row {
  margin-top: 14px;
}
.publish-deliverable-row label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.publish-url-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.publish-url-inline a {
  flex: 1;
  color: var(--brand);
  text-decoration: none;
  word-break: break-all;
  font-size: 0.82rem;
}
.publish-url-inline a:hover { text-decoration: underline; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, var(--brand-dark), #0d3a5c);
  color: #fff;
  padding: 13px 22px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(9,54,83,0.4);
  z-index: 9999;
  animation: toastSlideUp 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast::before {
  content: '✓';
  width: 22px;
  height: 22px;
  background: rgba(0,201,245,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--brand-accent);
  flex-shrink: 0;
}

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

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* ============================================================
   RICHTEXT EDITOR TOOLBAR
   ============================================================ */
.rich-toolbar {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.rich-btn {
  padding: 5px 9px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  transition: background 0.1s;
}

.rich-btn:hover { background: var(--border); }
.rich-btn .material-icons-round { font-size: 16px; vertical-align: middle; }
.rich-sep { display: inline-block; width: 1px; height: 18px; background: var(--border); margin: 0 4px; vertical-align: middle; flex-shrink: 0; }
.rich-fontsize-wrap { position: relative; display: inline-flex; align-items: center; }
.rich-fontsize-btn { display: inline-flex; align-items: center; gap: 1px; min-width: 42px; justify-content: space-between; padding: 5px 6px; }
.rich-fontsize-label { min-width: 18px; text-align: center; font-size: 0.8rem; font-weight: 600; }
.rich-fontsize-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  z-index: 200;
  min-width: 62px;
  max-height: 260px;
  overflow-y: auto;
}
.rich-fontsize-dropdown.hidden { display: none; }
.rich-fontsize-item { padding: 5px 16px; font-size: 0.85rem; cursor: pointer; color: var(--text); transition: background 0.1s; }
.rich-fontsize-item:hover { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.richtext-padding-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-alt, #f4f6f8); border: 1.5px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); flex-wrap: wrap; }
.richtext-padding-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
.richtext-padding-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rt-pad-wrap { position: relative; display: inline-flex; align-items: center; }
.rt-pad-btn { display: inline-flex; align-items: center; gap: 2px; min-width: 72px; justify-content: space-between; padding: 6px 8px; }
.rt-pad-label { font-size: 0.8rem; font-weight: 600; min-width: 24px; text-align: left; }
.rt-pad-dropdown {
  position: absolute;
  bottom: calc(100% + 3px);
  top: auto;
  left: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  z-index: 200;
  min-width: 140px;
}
.rt-pad-dropdown.hidden { display: none; }
.rt-pad-item { padding: 6px 14px; font-size: 0.85rem; cursor: pointer; color: var(--text); transition: background 0.1s; }
.rt-pad-item:hover { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.richtext-padding-unit { font-size: 0.75rem; color: var(--text-muted); }
.rich-image-form { display: flex; gap: 6px; align-items: center; padding: 8px; background: var(--bg); border: 1.5px solid var(--border); border-top: none; border-bottom: none; flex-wrap: wrap; }
.rich-image-form.hidden { display: none; }
.rich-image-form input { flex: 1; min-width: 140px; font-size: 0.8rem; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; }
.rich-image-form select { font-size: 0.8rem; padding: 5px 6px; border: 1px solid var(--border); border-radius: 4px; }
.rich-link-form { display: flex; gap: 6px; align-items: center; padding: 8px; background: var(--bg); border: 1.5px solid var(--border); border-top: none; border-bottom: none; flex-wrap: wrap; }
.rich-link-form.hidden { display: none; }
.rich-link-form input { flex: 1; min-width: 180px; font-size: 0.8rem; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; }

.rich-editor {
  width: 100%;
  min-height: 120px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.7;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.rich-editor:focus { border-color: var(--brand); }

/* ---- Navigation toggle rows ---- */
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 6px 0;
}
.toggle-label-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.toggle-label-text .hint { font-weight: 400; }
.toggle-check {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
}
.toggle-sub { padding-top: 4px; padding-left: 2px; }

/* ---- FIX 1: Autosave status indicator ---- */
.autosave-status {
  margin-top: 16px;
  font-size: 0.8rem;
  min-height: 24px;
  color: var(--text-muted, #888);
  transition: color 0.3s;
}
.autosave-status.saving { color: var(--text-muted, #888); }
.autosave-status.saved  { color: #2e7d32; }
.autosave-status.error  { color: var(--danger, #d32f2f); }

/* ---- FIX 3: Drag and drop tab reordering ---- */
.drag-handle { cursor: grab; user-select: none; }
.tab-row.dragging { opacity: 0.4; }

/* ---- FIX 5: Color swatch preview bar ---- */
.color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  cursor: default;
  transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.12); }
.swatch-hint {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  margin-left: 4px;
  font-style: italic;
}

/* ============================================================
   FEATURE 1: Section drag & drop
   ============================================================ */
.section-card.dragging { opacity: 0.4; }
.section-drag-handle { cursor: grab; color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.section-drag-handle:active { cursor: grabbing; }

/* ============================================================
   FEATURE 2: AI Image Generation — input with inline button
   ============================================================ */
.input-with-btn {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.input-with-btn input {
  flex: 1;
  min-width: 0;
}
.input-with-btn .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================================
   FEATURE 3: Live Mobile Preview Panel — two-column editor
   ============================================================ */
.editor-columns {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.editor-left {
  flex: 1;
  min-width: 0;
}
.preview-panel {
  width: 400px;
  flex-shrink: 0;
  position: sticky;
  top: 28px;
  align-self: flex-start;
}

/* ---- Tab editor action buttons (Save / Save & Close / ×) ---- */
.tab-editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* When #tab-editor is inline inside #tabs-list, connect it visually */
#tabs-list .tab-editor {
  margin-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border-top-color: var(--brand);
}
.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.preview-panel-header h3 {
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  margin: 0;
}
.preview-panel-btns {
  display: flex;
  gap: 6px;
}
.phone-frame {
  background: linear-gradient(160deg, #0f85a9 0%, #093653 100%);
  border-radius: 52px;
  padding: 18px 12px 26px;
  box-shadow: 0 28px 64px rgba(9,54,83,0.55), 0 0 0 1px rgba(15,133,169,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.phone-notch {
  width: 36px;
  height: 14px;
  background: #051e2e;
  border-radius: 20px;
  margin: -4px auto 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-notch::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #0a2e45;
  border-radius: 50%;
  border: 2px solid rgba(15,133,169,0.35);
  margin-top: 0;
}
#preview-iframe {
  width: 100%;
  height: 780px;
  border: none;
  border-radius: 14px;
  background: #fff;
  display: block;
}
.preview-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  line-height: 1.5;
}
.preview-hint .material-icons-round { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.preview-hint.hidden { display: none; }

@media (max-width: 1280px) {
  .editor-columns { flex-direction: column; }
  .preview-panel { width: 100%; max-width: 400px; }
  #preview-iframe { height: 620px; }
}

/* ── File Download Upload Row ── */
.filedownload-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filedownload-upload-status {
  font-size: 0.78rem;
  color: var(--brand);
  margin-top: 4px;
}
.filedownload-upload-status.hidden { display: none; }

/* ── Gallery Builder UI ── */
.gallery-upload-progress {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gallery-upload-progress.hidden { display: none; }
.gallery-upload-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.gallery-upload-bar {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 3px;
  transition: width 0.2s;
}
.gallery-upload-status {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gallery-builder-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 10px 0;
  text-align: center;
}

/* Add Section button */
.gallery-add-section-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-top: 12px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.gallery-add-section-btn:hover { background: rgba(15,133,169,0.14); }
.gallery-add-section-btn .material-icons-round { font-size: 18px; }

/* Section box */
.gallery-section-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  overflow: hidden;
}

.gallery-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.gallery-section-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 20px;
  flex-shrink: 0;
}
.gallery-section-label {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  background: #fff;
}
.gallery-section-label:focus { border-color: var(--brand); outline: none; }
.gallery-section-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.gallery-section-delete-btn:hover { color: #c0392b; background: #fef2f2; }
.gallery-section-delete-btn .material-icons-round { font-size: 18px; }

/* Image grid */
.gallery-section-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px;
  min-height: 40px;
}
.gallery-section-empty {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  margin: 0;
}

/* Image thumbnail */
.gallery-builder-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: visible;
  background: var(--bg);
  cursor: grab;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.gallery-builder-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.gallery-builder-thumb.drag-over { border-color: var(--brand); }

.gallery-thumb-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.58rem;
  padding: 2px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  border-radius: 0 0 4px 4px;
  pointer-events: none;
}
.gallery-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  padding: 0;
  z-index: 2;
}
.gallery-thumb-remove:hover { background: #c0392b; }
.gallery-thumb-remove .material-icons-round { font-size: 13px; }

/* Move-to dropdown */
.gallery-thumb-move-wrap {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 10;
}
.gallery-thumb-move-btn {
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  padding: 0;
}
.gallery-thumb-move-btn:hover { background: var(--brand); }
.gallery-thumb-move-btn .material-icons-round { font-size: 13px; }
.gallery-thumb-move-menu {
  display: none;
  position: absolute;
  top: 24px;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 130px;
  padding: 4px 0;
  z-index: 100;
}
.gallery-thumb-move-menu.open { display: block; }
.gallery-move-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 4px 10px 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gallery-move-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-move-opt:hover { background: var(--brand-light); color: var(--brand); }

/* Per-section upload zone */
.gallery-section-upload-zone {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px dashed var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s;
}
.gallery-section-upload-zone:hover {
  background: rgba(15,133,169,0.04);
  color: var(--brand);
}
.gallery-section-upload-zone .material-icons-round { font-size: 18px; flex-shrink: 0; }

/* ── Contacts (Vendor Contacts + Client Contacts) ── */
.contacts-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contacts-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 10px 0;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.contact-row-info {
  flex: 1;
  min-width: 0;
}
.contact-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-row-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.contact-form {
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.contact-form-grid .field { margin-top: 0; }
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input {
  flex: 1;
  padding-right: 36px;
}
.pw-eye {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted, #888);
  display: flex;
  align-items: center;
}
.pw-eye:hover { color: var(--primary, #0f85a9); }
.pw-eye .material-icons-round { font-size: 18px; }
.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.contact-app-access {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.contact-app-access-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.app-access-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.app-access-row:hover { background: #f1f5f9; }
.app-access-check-wrap { display: flex; align-items: center; flex-shrink: 0; }
.app-access-check { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.app-access-name { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.app-access-sub  { font-size: 11px; color: var(--text-light); }

.contact-app-access-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.contact-app-access-header .material-icons-round { font-size: 15px !important; }

.app-notify-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: 1.5px solid #d1d5db;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.app-notify-btn:not(:disabled):hover {
  border-color: #0f85a9;
  color: #0f85a9;
  background: #f0f9ff;
}
.app-notify-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.app-notify-btn.app-notify-sent {
  border-color: #059669;
  color: #059669;
  background: #f0fdf4;
}
.app-notify-btn .material-icons-round { font-size: 13px !important; }

.vs-app-notified {
  display: inline-flex;
  align-items: center;
  color: #059669;
  margin-right: 6px;
}
.vs-app-notified .material-icons-round { font-size: 15px !important; }

.app-access-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 6px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 2px;
}
.aac-col-access { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; min-width: 44px; text-align: center; white-space: nowrap; }
.aac-col-app    { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; flex: 1; }
.aac-col-notify { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; margin-left: auto; }
.client-app-creds { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #475569; font-family: 'Courier New', monospace; margin-left: auto; white-space: nowrap; }
.client-app-creds.hidden { display: none; }
.client-last-sent { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: #0f85a9; margin-right: 6px; white-space: nowrap; cursor: default; }
.client-last-sent .material-icons-round { font-size: 15px !important; }
.client-no-send { color: #cbd5e1; }
.delivery-history-list { display: flex; flex-direction: column; }
.delivery-history-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f1f5f9; }
.delivery-history-row:last-child { border-bottom: none; }
.delivery-history-app { font-size: 12px; font-weight: 500; color: #1e293b; }
.delivery-history-meta { font-size: 11px; color: #64748b; margin-top: 1px; }

/* ── Quick Quote — Adjust column & send modal ── */
.qq-adj-input { width: 100%; max-width: 110px; padding: 4px 7px; font-size: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--text-primary); text-align: right; }
.qq-adj-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(15,133,169,.15); }
.qq-adj-final { font-size: 11px; color: #0f85a9; margin-top: 3px; white-space: nowrap; }
.qq-sent-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 500; color: #0f85a9; margin-top: 4px; cursor: default; white-space: nowrap; }
.qq-sent-badge .material-icons-round { font-size: 12px !important; }
.qq-generated-badge { display: inline-flex; align-items: center; color: #16a34a; cursor: default; }
.qq-generated-badge .material-icons-round { font-size: 13px !important; }
.qq-send-project { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.qq-send-loc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.qq-send-base { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.qq-send-final { margin-top: 6px; font-size: 14px; font-weight: 700; color: #0f85a9; }
.qq-send-final.hidden { display: none; }
.qq-recipient-checks { display: flex; gap: 16px; margin-top: 6px; }
.qq-recipient-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* ============================================================
   HEADER LOGIN TOGGLE
   ============================================================ */

.header-login-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
}
.header-login-toggle:hover { border-color: var(--brand); color: var(--brand); }
.header-login-toggle input[type="checkbox"] { accent-color: var(--brand); width: 14px; height: 14px; }
.header-login-toggle .material-icons-round { font-size: 16px; }

/* ============================================================
   DELIVERY TAB
   ============================================================ */

.delivery-recipient-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.delivery-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.delivery-recipient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 0.12s;
}
.delivery-recipient-row:last-child { margin-bottom: 0; }
.delivery-recipient-row:hover { border-color: var(--brand); }
.delivery-recipient-row input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
}
.delivery-recipient-row .recipient-info { flex: 1; min-width: 0; }
.delivery-recipient-row .recipient-creds {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 2px;
}

.cred-badge {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.cred-badge .material-icons-round { font-size: 16px; }
.cred-badge.cred-ok .material-icons-round { color: var(--success); }
.cred-badge.cred-missing .material-icons-round { color: #f59e0b; }

/* Quill editor */
#delivery-email-editor .ql-editor { min-height: 280px; font-family: 'Inter', sans-serif; font-size: 0.88rem; }
.ql-toolbar.ql-snow { border-color: var(--border); border-top: none; }
.ql-container.ql-snow { border-color: var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ============================================================
   EMAIL COMPOSE FORM
   ============================================================ */

.email-compose-form {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.email-row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  min-height: 38px;
}

.email-row-label {
  flex-shrink: 0;
  width: 72px;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  padding-top: 11px;
}

.email-row-value {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.88rem;
}

.email-row-locked {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.email-subject-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  background: transparent;
  color: var(--text);
  width: 100%;
}

.email-row-recipients {
  align-items: stretch;
}

.email-row-checklist {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-add-btn {
  align-self: flex-start;
  margin-top: 4px;
  color: var(--brand);
  font-size: 0.78rem;
  padding: 3px 6px;
  width: auto;
}
.email-add-btn:hover { background: var(--brand-light) !important; color: var(--brand) !important; }
.email-add-btn .material-icons-round { font-size: 14px; }

.email-body-wrap {
  border-top: 1px solid var(--border);
}

/* Tighten delivery recipient rows inside email form */
.email-row-checklist .delivery-recipient-row {
  background: var(--bg);
  padding: 5px 8px;
  margin-bottom: 3px;
}
.email-row-checklist .delivery-recipient-row:last-of-type { margin-bottom: 0; }

/* ============================================================
   YEAR SECTIONS (builder vendor subsections)
   ============================================================ */

.yr-section { margin-bottom: 2px; }

.yr-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  transition: background 0.15s;
}
.yr-header:hover { background: #e2e8f0; }

.yr-chevron { font-size: 16px !important; color: #94a3b8; }

.yr-label { font-size: 13px; font-weight: 700; color: #1e293b; }

.yr-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  background: #e2e8f0;
  padding: 1px 7px;
  border-radius: 10px;
}

.yr-body { margin-bottom: 4px; }

/* Year badge on app row — subtle, clickable */
.vs-app-year-badge {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.vs-app-year-badge:hover {
  color: #0f85a9;
  border-color: #0f85a9;
  background: #e0f2f8;
}

/* ============================================================
   CHIP PICKER (delivery tab TO/CC selectors)
   ============================================================ */

.chip-picker {
  position: relative;
  width: 100%;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: text;
}
.chip-list:focus-within {
  border-color: #0f85a9;
  box-shadow: 0 0 0 2px rgba(15,133,169,0.15);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e0f2f8;
  color: #0c5a73;
  border-radius: 14px;
  padding: 2px 8px 2px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-contact {
  background: #f0fdf4;
  color: #166534;
}
.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
}
.chip-remove:hover { opacity: 1; }

.chip-input {
  flex: 1;
  min-width: 120px;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  padding: 2px 0;
}

.chip-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
}
.chip-dropdown.hidden { display: none; }

.chip-opt-group {
  padding: 6px 12px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
}

.chip-option {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.chip-option:hover { background: #f0f9ff; }
.chip-option.selected { opacity: 0.4; pointer-events: none; }

.chip-opt-name { font-size: 13px; font-weight: 500; color: #1e293b; }
.chip-opt-email { font-size: 11px; color: #94a3b8; }

.chip-dropdown-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

/* ============================================================
   CLIENT APP PASSWORD (delivery tab)
   ============================================================ */

.delivery-pw-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  box-sizing: border-box;
}
.delivery-pw-value {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: #166534;
  letter-spacing: 0.02em;
}

.delivery-meta-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.delivery-meta-col {
  flex: 1;
  min-width: 0;
}
.delivery-meta-col .field {
  margin-bottom: 0;
}
.delivery-pw-box .btn-ghost { color: #166534; flex-shrink: 0; }

/* ---- App Type Badges ---- */
.badge-amber        { background: #fef3c7; color: #b45309; }
.badge-green-outline { background: transparent; color: var(--success); border: 1px solid var(--success); }

/* ---- Type Filter Bar ---- */
.type-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.type-filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.type-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.type-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   ADMIN QUOTES TABLE — ACCORDION
   ============================================================ */
#quotes-admin-wrap { overflow-x: auto; }

.aq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.aq-col-name   { min-width: 180px; }
.aq-col-addr   { min-width: 140px; }
.aq-col-size   { width: 90px; }
.aq-col-total  { width: 100px; }
.aq-col-date   { width: 110px; }
.aq-col-status { width: 120px; }

.aq-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
}
.aq-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.aq-td-status { text-align: center; color: var(--text-muted); padding: 32px !important; }
.aq-td-error  { color: var(--danger); }

/* Main clickable row */
.aq-main-row { cursor: pointer; transition: background .15s; }
.aq-main-row:hover    { background: #f5f9fc; }
.aq-main-row.expanded { background: #edf5fb; }
.aq-row-archived      { opacity: .5; }

/* Name cell */
.aq-name-wrap { display: flex; align-items: center; gap: 7px; }
.aq-chevron {
  font-size: 18px !important;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .25s ease;
}
.aq-main-row.expanded .aq-chevron { transform: rotate(180deg); color: var(--brand); }
.aq-name     { font-weight: 600; color: var(--text); }
.aq-user-tag { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.aq-addr     { color: var(--text-muted); font-size: .8rem; }
.aq-size     { text-align: right; white-space: nowrap; }
.aq-total    { text-align: right; font-weight: 700; color: var(--brand); white-space: nowrap; }
.aq-date     { color: var(--text-muted); white-space: nowrap; }

/* Status badges */
.aq-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.aq-status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.aqs-active      { color: #6b7b8d; background: rgba(107,123,141,.1); }
.aqs-in-progress { color: var(--brand); background: rgba(15,133,169,.1); }
.aqs-won         { color: #1a9e5e; background: rgba(26,158,94,.1); }
.aqs-lost        { color: #c0392b; background: rgba(192,57,43,.1); }

/* Detail accordion row */
.aq-detail-row .aq-detail-cell { padding: 0 !important; border-top: none !important; }
.aq-detail-inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.aq-detail-row.open .aq-detail-inner { max-height: 360px; }

.aq-detail-body {
  display: flex;
  border-top: 2px solid var(--brand);
  background: #fff;
}

/* Left: map */
.aq-detail-left {
  flex: 1;
  position: relative;
  background: #1a2a36;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.aq-map-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  min-height: 180px;
  max-height: 320px;
}
.aq-no-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  gap: 8px;
  color: rgba(255,255,255,.4);
  font-size: .82rem;
}
.aq-no-map .material-icons-round { font-size: 32px; }
.aq-area-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(6,36,58,.68);
  color: rgba(255,255,255,.9);
  font-size: .72rem;
  padding: 6px 12px;
  text-align: center;
}

/* Right: services + total */
.aq-detail-right {
  width: 260px;
  flex-shrink: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}
.aq-svc-rows { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.aq-svc-row {
  border-radius: 7px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
}
.aq-svc-sub {
  margin-top: 6px;
  padding-top: 6px;
  padding-left: 10px;
  border-top: 1px dashed var(--border);
}
.aq-svc-gpr  { background: rgba(15,133,169,.05); border-color: var(--brand); }
.aq-svc-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.aq-svc-gpr .aq-svc-name  { color: var(--brand); }
.aq-svc-addon .aq-svc-name { color: var(--text); opacity: .75; }
.aq-svc-badge {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--brand);
  color: #fff;
  padding: 1px 6px;
  border-radius: 20px;
}
.aq-svc-desc { font-size: .72rem; color: var(--text-muted); line-height: 1.4; }
.aq-total-card {
  background: var(--brand-dark);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.aq-total-label  { font-size: .75rem; font-weight: 600; opacity: .75; }
.aq-total-amount { font-size: 1.15rem; font-weight: 800; color: #f97316; }

/* ── Home View ──────────────────────────────────────────── */
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 8px 0;
}
.home-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow);
}
.home-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.home-card-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-card-icon .material-icons-round {
  font-size: 28px;
  color: #fff;
}
.home-card-body {
  flex: 1;
}
.home-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.home-card-desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.home-card-arrow {
  flex-shrink: 0;
  font-size: 20px !important;
  color: var(--border);
  transition: color 0.15s, transform 0.15s;
}
.home-card:hover .home-card-arrow {
  color: var(--brand);
  transform: translateX(3px);
}

/* ── Session Log ─────────────────────────────────────────── */
/* ── Settings View ──────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.settings-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
}
.settings-section-header .material-icons-round {
  font-size: 18px;
  color: var(--brand);
}
.settings-section-desc {
  padding: 10px 20px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
.hsl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
}
.hsl-header .material-icons-round {
  font-size: 18px;
  color: var(--brand);
}
.hsl-empty {
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}
.hsl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.hsl-table thead th {
  padding: 9px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.hsl-table tbody tr { border-bottom: 1px solid var(--border); }
.hsl-table tbody tr:last-child { border-bottom: none; }
.hsl-table tbody td { padding: 9px 16px; vertical-align: middle; }
.hsl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 5px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}
.hsl-badge .material-icons-round { font-size: 14px; }
.hsl-login  { background: #e8f6fb; color: #0a6682; }
.hsl-logout { background: #fef3e2; color: #a05a0a; }
.hsl-ts { color: var(--text-muted); white-space: nowrap; }
.hsl-ip { color: var(--text-muted); font-family: monospace; font-size: 0.8rem; }

/* ── Proposals View ─────────────────────────────────────── */
.prop-col-cemetery { min-width: 180px; }
.prop-col-contact  { min-width: 160px; }
.prop-col-size     { width: 100px; }
.prop-col-services { min-width: 200px; }
.prop-col-total    { width: 90px; }
.prop-col-date     { width: 100px; }
.prop-col-projnum  { width: 120px; }
.prop-col-status   { width: 130px; }
.prop-col-actions  { width: 160px; }
.prop-status-cell  { vertical-align: middle; }
.prop-status-cell .prop-status { display: block; margin-bottom: 5px; }
.prop-projnum-wrap { display: flex; align-items: center; gap: 4px; }
.prop-projnum-input { width: 80px; font-size: .78rem; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); }
.prop-projnum-input:focus { outline: none; border-color: var(--accent); }
.prop-projnum-save { padding: 3px 5px; }
.prop-projnum-save .material-icons-round { font-size: .9rem; }

.prop-size-acres   { font-weight: 600; font-size: .85rem; color: var(--text); white-space: nowrap; }
.prop-size-sqft    { font-size: .73rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }
.prop-cemetery     { font-weight: 600; font-size: .88rem; color: var(--text); }
.prop-addr         { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.prop-contact-name { font-size: .85rem; font-weight: 500; }
.prop-contact-sub  { font-size: .73rem; color: var(--text-muted); margin-top: 2px; }

.prop-svcs         { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; }
.prop-svc-tag      { font-size: .68rem; font-weight: 600; text-transform: uppercase;
                     letter-spacing: .03em; background: var(--brand-bg);
                     color: var(--brand); padding: 2px 6px; border-radius: 10px; }

.prop-status       { display: inline-block; font-size: .72rem; font-weight: 700;
                     text-transform: uppercase; letter-spacing: .05em;
                     padding: 3px 8px; border-radius: 20px; }
.props-new          { color: #6b7b8d; background: rgba(107,123,141,.12); }
.props-reviewing    { color: #b07d0a; background: rgba(176,125,10,.12); }
.props-app-created  { color: var(--brand); background: rgba(15,133,169,.12); }
.props-sent         { color: #7c4dbd; background: rgba(124,77,189,.12); }
.props-won          { color: #1a9e5e; background: rgba(26,158,94,.12); }
.props-lost         { color: #c0392b; background: rgba(192,57,43,.12); }

.prop-svc-item    { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.prop-svc-price   { font-size: .68rem; font-weight: 700; color: var(--text); }

.prop-actions      { display: flex; align-items: center; gap: 6px; }
.prop-actions .btn { padding: 4px 7px; }
.prop-actions .material-icons-round { font-size: 1rem; }
.prop-status-select { font-size: .75rem; padding: 3px 6px; border: 1px solid var(--border);
                      border-radius: 6px; background: white; color: var(--text);
                      cursor: pointer; max-width: 110px; font-weight: 600; }

/* ── Proposals portal note ────────────────────────────────────────────────── */
.proposals-portal-note {
  font-size: .78rem; color: var(--text-muted); margin: 10px 2px 0;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.proposals-portal-note .material-icons-round { color: var(--brand); }

/* ── Client Portal credentials popover ────────────────────────────────────── */
.portal-creds-popover {
  position: absolute; z-index: 9999;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
  padding: 14px 16px; min-width: 260px;
}
.pcp-title   { font-size: .8rem; font-weight: 700; color: var(--brand);
               text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.pcp-row     { display: flex; justify-content: space-between; align-items: center;
               gap: 10px; margin-bottom: 7px; }
.pcp-label   { font-size: .75rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.pcp-val     { font-size: .8rem; color: var(--text); font-weight: 500;
               word-break: break-all; text-align: right; }
.pcp-pw      { font-family: monospace; font-size: .85rem; letter-spacing: .05em;
               background: var(--brand-bg); color: var(--brand);
               padding: 2px 7px; border-radius: 5px; font-weight: 700; }
.pcp-open-btn { display: flex; align-items: center; gap: 6px; justify-content: center;
                margin-top: 12px; padding: 8px 14px; border-radius: 7px;
                background: var(--brand); color: #fff; text-decoration: none;
                font-size: .8rem; font-weight: 600; }
.pcp-open-btn:hover { background: var(--brand-dark); }
.pcp-open-btn .material-icons-round { font-size: .9rem; }

/* ── Proposal Template Editor ──────────────────────────────────────────────── */
.pte-wrap    { display:flex; flex-direction:column; height:100%; overflow:hidden; }
.pte-toolbar { display:flex; justify-content:space-between; align-items:center;
               padding:14px 20px; border-bottom:1px solid var(--border); flex-shrink:0;
               background:var(--card); }
.pte-body    { display:flex; flex:1; overflow:hidden; }
.pte-nav     { width:172px; flex-shrink:0; border-right:1px solid var(--border);
               overflow-y:auto; padding:8px 0; background:var(--card); }
.pte-nav-btn { display:block; width:100%; text-align:left; padding:9px 16px;
               background:none; border:none; cursor:pointer; font-size:.82rem;
               color:var(--text); line-height:1.3; }
.pte-nav-btn:hover  { background:var(--brand-light); }
.pte-nav-btn.active { background:var(--brand-light); color:var(--brand);
                      font-weight:600; border-right:3px solid var(--brand); }
.pte-editor  { flex:1; display:flex; flex-direction:column; padding:16px;
               overflow:hidden; background:var(--bg); gap:8px; }
.pte-sec-label { font-size:.72rem; font-weight:700; text-transform:uppercase;
                 letter-spacing:.08em; color:var(--text-muted); }
.pte-ta      { flex:1; width:100%; font-family:'Fira Code','Cascadia Code',
               'Courier New',monospace; font-size:.77rem; line-height:1.6;
               border:1px solid var(--border); border-radius:var(--radius-sm);
               padding:12px 14px; resize:none; background:var(--card);
               color:var(--text); outline:none; tab-size:2; }
.pte-ta:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,133,169,.12); }

/* ── Services View ────────────────────────────────────────── */
#services-wrap { display: flex; flex-direction: column; gap: 20px; }

.svc-global-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.svc-global-title { font-weight: 700; font-size: .85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.svc-global-fields { display: flex; gap: 24px; flex-wrap: wrap; }
.svc-global-field { display: flex; flex-direction: column; gap: 6px; }
.svc-global-field label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }

.svc-price-input { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.svc-price-input span { padding: 0 8px; color: var(--text-muted); font-weight: 600; font-size: .85rem; background: var(--bg); }
.svc-price-input input { border: none; outline: none; background: transparent; padding: 6px 8px 6px 0; width: 90px; font-size: .88rem; color: var(--text); }
.svc-price-input input:focus { box-shadow: none; }

.svc-table { table-layout: fixed; }
.svc-col-drag  { width: 36px; }
.svc-col-label { min-width: 160px; }
.svc-col-desc  { min-width: 200px; }
.svc-col-type  { width: 110px; }
.svc-col-rate  { width: 120px; }
.svc-col-min   { width: 110px; }
.svc-col-flags { width: 130px; }
.svc-col-del   { width: 50px; }

.svc-drag-cell { text-align: center; cursor: grab; }
.svc-drag-icon { font-size: 1.1rem; color: var(--text-muted); opacity: .5; vertical-align: middle; }

.svc-input { width: 100%; font-size: .82rem; padding: 5px 8px; }
.svc-type-select { padding: 5px 6px; font-size: .82rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); cursor: pointer; width: 100%; }

.svc-flags { display: flex; flex-direction: column; gap: 5px; }
.svc-flag-label { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.svc-flag-label input[type="checkbox"] { cursor: pointer; accent-color: var(--brand); }

.svc-req-lock { font-size: 1rem; color: var(--text-muted); opacity: .4; display: block; text-align: center; }

.svc-hint { font-size: .78rem; color: var(--text-muted); font-style: italic; margin-top: 4px; }
