/* =========================================================================
   La Gondola Rossa — Premium Design System & Styles
   Aesthetics: Deep Blue Glassmorphic Theme, Modern Typography, Fluid Motion
   ========================================================================= */

:root {
  /* Color Palette (Deep Sapphire & Indigo Hues) */
  --bg-primary: #0a0f1d;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(22, 30, 49, 0.85);
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.35);
  
  --secondary: #475569;
  --secondary-hover: #334155;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.2);
  
  /* Layout and Shapes */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Base resets & fonts */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  height: 100vh;
  line-height: 1.5;
}

/* Animations definition */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px var(--primary-glow); }
  50% { box-shadow: 0 0 25px rgba(59, 130, 246, 0.55); }
}

/* Layout Containers */
.page-container {
  display: none;
  height: 100vh;
  width: 100vw;
}

.page-container.active {
  display: flex;
}

/* =========================================================================
   LOGIN PAGE
   ========================================================================= */
#login-container {
  background: radial-gradient(circle at top right, #1e293b 0%, #0a0f1d 70%);
  display: none;
  justify-content: center;
  align-items: center;
}

#login-container.active {
  display: flex;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-premium), 0 0 40px rgba(59, 130, 246, 0.1);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-symbol {
  font-size: 44px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
  font-weight: 500;
}

/* Form Controls */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="file"],
select,
textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn.secondary {
  background: var(--secondary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

.btn.danger:hover {
  background: #d32f2f;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
}

.btn-block {
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.link-btn:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.link-btn.danger {
  color: var(--danger);
}

.link-btn.danger:hover {
  color: #f87171;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.hidden {
  display: none !important;
}

/* =========================================================================
   APP MAIN INTERFACE
   ========================================================================= */
#app-container {
  display: none;
}

#app-container.active {
  display: flex;
}

/* Sidebar Layout */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  font-size: 28px;
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

.sidebar-title-group h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sidebar-title-group p {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* User profile widget in sidebar */
.user-profile {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-light);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid var(--border-light);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* Menu items */
.nav-menu {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

/* Main Content Layout */
.main-content {
  flex-grow: 1;
  background-color: var(--bg-primary);
  padding: 40px;
  height: 100vh;
  overflow-y: auto;
}

/* App Panels */
.app-panel {
  display: none;
}

.app-panel.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

/* Panel Header */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.panel-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.panel-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.date-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.action-group {
  display: flex;
  gap: 12px;
}

/* Grid Layouts */
.grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: start;
}

.divider {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 25px 0;
}

.row {
  display: flex;
  gap: 16px;
}

.col-6 {
  flex: 1;
}

/* =========================================================================
   CARDS & STATS
   ========================================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.3);
  background: var(--bg-card-hover);
}

.stat-icon {
  font-size: 32px;
  background: rgba(255, 255, 255, 0.04);
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
}

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* Details Cards */
.details-card {
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-premium);
  margin-bottom: 30px;
}

.details-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.subtitle-card {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -15px;
  margin-bottom: 20px;
}

.dashboard-details {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 30px;
}

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

.card-header h2 {
  margin-bottom: 0;
}

/* =========================================================================
   TABLES
   ========================================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.015);
}

.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
  font-style: italic;
}

/* Status Badges */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.bozza {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.badge.inviato {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
}

.badge.firmato {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.badge.pagato {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.badge.admin {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge.user {
  background: rgba(71, 85, 105, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(71, 85, 105, 0.3);
}

/* Action menus in tables */
.row-actions {
  display: flex;
  gap: 8px;
}

/* =========================================================================
   TIMELINE (AUDIT LOGS)
   ========================================================================= */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}

.activity-item {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-light);
}

/* Colors based on audit action types */
.activity-item.create { border-left-color: var(--success); }
.activity-item.modify { border-left-color: var(--primary); }
.activity-item.delete { border-left-color: var(--danger); }
.activity-item.auth { border-left-color: var(--warning); }

.activity-icon {
  font-size: 16px;
  margin-top: 2px;
}

.activity-body {
  display: flex;
  flex-direction: column;
}

.activity-text {
  font-size: 13px;
  color: var(--text-primary);
}

.activity-text strong {
  font-weight: 600;
  color: #fff;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* =========================================================================
   MODAL WINDOWS
   ========================================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 16, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-premium);
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal.lg {
  max-width: 900px;
}

.modal.xl {
  max-width: 1240px;
  width: 95%;
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: #fff;
}

.modal-overlay form {
  padding: 30px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
}

/* Special Split View Modal (for PDF signing) */
.modal-body-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 480px;
}

.modal-sidebar {
  padding: 20px;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  max-height: 70vh;
}

.modal-sidebar h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-main-content {
  padding: 30px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.section-help {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: -6px;
  margin-bottom: 12px;
}

/* Dynamic Text Overlays row elements */
.overlay-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.overlay-row input {
  padding: 8px 12px;
  font-size: 13px;
}

/* Signature Canvas Styling */
.signature-canvas-container {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#signature-canvas {
  background: #fff;
  cursor: crosshair;
  border: 1px dashed #cbd5e1;
}

#btn-clear-canvas {
  margin-top: 8px;
}

/* PDF Reference Helpers */
.pdf-coord-helper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  flex-grow: 1;
}

.pdf-coord-helper h3 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--primary);
}

.pdf-coord-helper p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.coord-references {
  margin-top: 15px;
  margin-bottom: 20px;
}

.coord-references ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coord-references li {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 4px;
}

.info-alert {
  font-size: 12px;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

/* =========================================================================
   ESTIMATE GENERATOR SPECIFICS
   ========================================================================= */
.gen-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 20px;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}

.gen-item-row input {
  padding: 8px 12px;
  font-size: 13px;
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
}

.info-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.info-box p {
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.totals-preview {
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.totals-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}

.totals-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* =========================================================================
   PDF MERGER SPECIFICS
   ========================================================================= */
.pdf-selection-list {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-select-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.pdf-select-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(59, 130, 246, 0.3);
}

.pdf-select-info {
  display: flex;
  flex-direction: column;
}

.pdf-select-title {
  font-size: 13px;
  font-weight: 600;
}

.pdf-select-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Merger Queue Container */
.pdf-merge-queue {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 25px;
}

.queue-placeholder {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  max-width: 250px;
}

.queue-item {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 58, 138, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  transition: var(--transition-fast);
}

.queue-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateX(2px);
}

.queue-item-drag-indicator {
  color: var(--text-muted);
  font-size: 18px;
  margin-right: 12px;
}

.queue-item-info {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.queue-item-num {
  font-weight: bold;
  color: var(--primary);
  margin-right: 12px;
  background: rgba(59, 130, 246, 0.1);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.queue-item-title {
  font-size: 13px;
  font-weight: 600;
}

.btn-remove-queue {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.btn-remove-queue:hover {
  color: var(--danger);
}

/* =========================================================================
   INPUT GROUP WITH BUTTON (QUICK ADD CUSTOMER)
   ========================================================================= */
.input-group-with-btn {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-group-with-btn select {
  flex-grow: 1;
}

.input-group-with-btn .icon-btn {
  padding: 10px 12px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  color: #fff;
  cursor: pointer;
  transition: var(--transition-fast);
}

.input-group-with-btn .icon-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* =========================================================================
   VISUAL PDF EDITOR STYLES
   ========================================================================= */
.visual-pdf-editor {
  display: flex;
  flex-direction: column;
}

.pdf-viewport-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.pdf-viewport-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.pdf-viewport-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Draggable Overlays */
.draggable-element {
  position: absolute;
  cursor: move;
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  color: #1e3a8a;
  font-weight: bold;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  user-select: none;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.draggable-element.sig-element {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  min-width: 140px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.draggable-element:hover, .draggable-element.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.draggable-element .element-close {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  margin-left: 8px;
  pointer-events: auto;
  transition: transform 0.1s ease;
}

.draggable-element .element-close:hover {
  transform: scale(1.15);
  background: #ef4444;
}

/* Visual Elements Sidebar List */
.visual-element-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  transition: var(--transition-fast);
}

.visual-element-item:hover {
  background: rgba(255,255,255,0.05);
}

.visual-element-item.text-item {
  border-left: 3px solid #3b82f6;
}

.visual-element-item.sig-item {
  border-left: 3px solid #10b981;
}

.visual-element-item .element-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visual-element-item .element-name {
  font-weight: 600;
  color: #fff;
}

.visual-element-item .element-coords {
  color: var(--text-muted);
  font-size: 10px;
}

.visual-element-item .btn-delete-element {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: color 0.15s ease;
}

.visual-element-item .btn-delete-element:hover {
  color: var(--danger);
}

/* Spinner Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Simple Collaborator Checklist */
.share-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

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

.share-user-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.share-user-row label {
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

