/* Base Design System Tokens & Global Styles */
:root {
  --primary-navy: #1B3F72;
  --secondary-navy: #2558A8;
  --accent-gold: #D97706;
  --soft-green: #10B981;
  --error-red: #EF4444;
  --bg-dark: #0B0F19;
  --bg-light: #F4F6F9;
  --surface-white: #FFFFFF;
  --surface-alt: #ECEEF1;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Noto Serif', serif;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(27,63,114,0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-dark);
  overflow-x: hidden;
  height: 100vh;
}

/* Desktop Background with Glowing Orbs */
.desktop-background {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, #111827 0%, #030712 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  z-index: 1;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--secondary-navy);
  top: -100px;
  left: 10%;
  animation: floatOrb 15s infinite alternate ease-in-out;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-gold);
  bottom: -150px;
  right: 10%;
  animation: floatOrb 20s infinite alternate-reverse ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 80px) scale(1.1); }
}

/* Central Workspace Container */
.desktop-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  display: flex;
  gap: 60px;
  padding: 40px;
  align-items: center;
}

/* Left Sidebar - Hero Metadata */
.hero-sidebar {
  flex: 1.2;
  color: #F3F4F6;
  max-width: 520px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.app-icon-bg {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 88, 168, 0.4);
}

.app-icon-bg .material-icons {
  font-size: 30px;
  color: #FFFFFF;
}

.logo-area h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(to right, #FFFFFF 30%, #9CA3AF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #D1D5DB;
  transition: all 0.3s;
}

.pill .material-icons {
  font-size: 16px;
  color: var(--secondary-navy);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255,255,255,0.2);
}

.hero-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #9CA3AF;
  margin-bottom: 35px;
}

.help-box {
  background: rgba(217, 119, 6, 0.1);
  border-left: 4px solid var(--accent-gold);
  border-radius: 4px 12px 12px 4px;
  padding: 16px;
  display: flex;
  gap: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #E5E7EB;
}

.help-box .material-icons {
  color: var(--accent-gold);
  font-size: 24px;
  flex-shrink: 0;
}

.badge-inline {
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
}

.mic-inline {
  font-size: 14px;
  color: var(--soft-green);
}

/* Phone Wrapper & Chassis (Mobile Simulator) */
.phone-wrapper {
  flex: 0.8;
  display: flex;
  justify-content: center;
}

.phone-chassis {
  position: relative;
  width: 360px;
  height: 740px;
  background: #1E293B;
  border-radius: 40px;
  padding: 11px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 0 4px #475569;
  border: 1px solid rgba(255,255,255,0.1);
}

.phone-speaker {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: #475569;
  border-radius: 10px;
  z-index: 20;
}

.phone-camera {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #0F172A;
  border-radius: 50%;
  z-index: 20;
  border: 2px solid #334155;
}

/* Phone Screen Canvas */
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-light);
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

/* Simulated Android Status Bar */
.status-bar {
  height: 38px;
  background: var(--surface-white);
  padding: 12px 24px 2px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  z-index: 15;
}

.status-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.icon-sm {
  font-size: 14px !important;
}

/* App Main Navigation Content */
.app-main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tab Switching Panels */
.tab-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.tab-screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Form Styles inside Redactar Tab */
.app-header {
  background: var(--surface-white);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-card.border-bottom {
  border-bottom: 1px solid var(--surface-alt);
  padding-bottom: 12px;
  width: 100%;
}

.gradient-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-badge .material-icons {
  color: #FFFFFF;
  font-size: 22px;
}

.title-meta h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
}

.title-meta span {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

.scrollable-form {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
}

/* Form Modules styled as Compose Cards */
.form-section {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.icon-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-avatar .material-icons {
  font-size: 16px;
}

.sec-bg {
  background: rgba(37, 88, 168, 0.15);
  color: var(--secondary-navy);
}

.pri-bg {
  background: rgba(27, 63, 114, 0.12);
  color: var(--primary-navy);
}

.pri-bg-trans {
  background: rgba(27, 63, 114, 0.1);
  color: var(--primary-navy);
}

.section-title h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-navy);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  background: var(--surface-white);
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-dark);
  transition: all 0.2s;
  outline: none;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--secondary-navy);
  box-shadow: 0 0 0 2px rgba(37, 88, 168, 0.15);
}

.row-inputs {
  display: flex;
  gap: 8px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.flex-1 { flex: 1; }
.flex-1-5 { flex: 1.5; }

.btn-voice-dictate {
  background: rgba(37, 88, 168, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--secondary-navy);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-voice-dictate:hover {
  background: rgba(37, 88, 168, 0.18);
}

.btn-voice-dictate .material-icons {
  font-size: 14px;
}

textarea {
  resize: none;
  height: 100px;
  line-height: 1.5;
}

/* Vector Grounded Precedent Drawer */
.vector-precedents-box {
  background: rgba(27, 63, 114, 0.04);
  border: 1px solid rgba(27, 63, 114, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.precedents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.row-align {
  display: flex;
  align-items: center;
  gap: 4px;
}

.golden-text {
  color: var(--accent-gold);
  font-size: 14px !important;
}

.precedents-header h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-navy);
}

.badge-socrata {
  background: rgba(16, 185, 129, 0.15);
  color: var(--soft-green);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 8px;
  font-weight: 700;
}

.precedent-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.precedent-item:last-child {
  border-bottom: none;
}

.check-icon {
  color: var(--soft-green);
  font-size: 12px !important;
  margin-top: 2px;
}

.prec-meta h5 {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-navy);
}

.prec-meta .desc-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1.3;
}

.prec-meta .regla-jud {
  font-size: 9px;
  color: var(--secondary-navy);
  margin-top: 3px;
  line-height: 1.3;
}

/* Card Option Switch Component */
.card-option {
  background: rgba(27, 63, 114, 0.08);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-text {
  flex: 1;
}

.option-text h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
}

.option-text p {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* Slider Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--secondary-navy);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Main action button */
.btn-submit {
  width: 100%;
  background: var(--primary-navy);
  border: none;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 10px rgba(27,63,114,0.2);
}

.btn-submit:hover {
  background: var(--secondary-navy);
}

.btn-submit:active {
  transform: scale(0.98);
}

/* Bottom Navigation Bar Styles */
.bottom-nav {
  height: 60px;
  background: var(--surface-white);
  border-top: 1px solid var(--surface-alt);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 6px;
  z-index: 15;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.2s;
  width: 80px;
}

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

.nav-item span:not(.material-icons) {
  font-size: 9px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary-navy);
}

.home-indicator {
  height: 5px;
  width: 120px;
  background: #475569;
  border-radius: 10px;
  margin: 0 auto 6px auto;
  flex-shrink: 0;
  z-index: 15;
}

/* Dialog HUD Overlays (Modal style) */
.dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.dialog-card {
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  text-align: center;
  animation: scaleIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.dialog-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 6px;
}

.dialog-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Spinner Animation */
.spinner-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid var(--surface-alt);
  border-top-color: var(--primary-navy);
  border-radius: 50%;
  margin: 0 auto 16px auto;
  animation: spin 1s infinite linear;
}

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

/* Voice HUD - Audio Wave Bouncing CSS */
.voice-card {
  background: var(--primary-navy);
  color: #FFFFFF;
}

.voice-card h3 {
  color: #FFFFFF;
}

.voice-card .dialog-subtitle {
  color: rgba(255,255,255,0.7);
}

.audio-wave {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  height: 48px;
  margin: 18px 0;
}

.bar {
  width: 4px;
  height: 10px;
  background: #FFFFFF;
  border-radius: 4px;
  animation: wave 0.8s infinite ease-in-out alternate;
}

@keyframes wave {
  from { height: 10px; }
  to { height: 42px; }
}

.bar-1 { animation-delay: 0.1s; }
.bar-2 { animation-delay: 0.2s; }
.bar-3 { animation-delay: 0.3s; }
.bar-4 { animation-delay: 0.4s; }
.bar-5 { animation-delay: 0.5s; }
.bar-6 { animation-delay: 0.6s; }
.bar-7 { animation-delay: 0.7s; }
.bar-8 { animation-delay: 0.8s; }

.transcription-text {
  font-size: 12.5px;
  font-style: italic;
  text-align: center;
  color: rgba(255,255,255,0.9);
  line-height: 1.4;
  margin-bottom: 20px;
  max-height: 80px;
  overflow-y: auto;
}

.btn-dialog-stop {
  background: var(--error-red);
  color: #FFFFFF;
  border: none;
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-dialog-stop:active {
  transform: scale(0.95);
}

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

/* Processes Tab Styles */
.processes-content {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
  height: 100%;
}

.processes-list-view,
.process-detail-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scrollable-processes-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty processes state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}

.empty-icon {
  font-size: 56px !important;
  color: rgba(0,0,0,0.15);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.empty-state p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Tutela Case Item Card */
.case-card {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(27,63,114,0.06);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(27,63,114,0.15);
}

.case-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.case-row-top h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-pending { background: #FEF3C7; color: #D97706; }
.badge-paid { background: #D1FAE5; color: #059669; }
.badge-draft { background: #E5E7EB; color: #4B5563; }
.badge-filed { background: #DBEAFE; color: #2563EB; }
.badge-admitted { background: #E0F2FE; color: #0369A1; }
.badge-approved { background: #D1FAE5; color: #047857; }
.badge-rejected { background: #FEE2E2; color: #B91C1C; }

.case-meta-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
}

.case-meta-lines strong {
  color: var(--text-dark);
}

.case-notes-preview {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0,0,0,0.06);
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Detail View Layout & Transitions */
.process-detail-view {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--bg-light);
  z-index: 40;
  transition: transform 0.3s ease;
}

.process-detail-view.hidden {
  transform: translateX(100%);
  display: flex;
}

.detail-header {
  background: var(--surface-white);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10;
}

.btn-back {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

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

.detail-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
}

.scrollable-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
}

/* Telemetry Tracker Component */
.telemetry-card {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.telemetry-header h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
}

.telemetry-header span {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary-navy);
}

.progress-bar-bg {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--secondary-navy), var(--soft-green));
  border-radius: 10px;
  width: 0%;
  transition: width 0.5s ease;
}

.telemetry-status-text {
  font-size: 10.5px;
  color: var(--text-dark);
  line-height: 1.4;
  background: var(--bg-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--secondary-navy);
}

/* Detail info blocks */
.detail-info-block {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-info-block h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 6px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 6px;
}

.grid-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.grid-cell span:first-child {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.grid-cell span:last-child {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dark);
}

.grid-cell-full {
  grid-column: 1 / span 2;
}

.facts-scroll-box {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-dark);
  max-height: 80px;
  overflow-y: auto;
}

/* Document download banner inside detail */
.doc-download-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-download-banner h4 {
  font-size: 11.5px;
  font-weight: 700;
  color: #065F46;
}

.doc-download-banner p {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.btn-open-doc {
  background: var(--soft-green);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-open-doc:hover {
  background: #059669;
}

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

.payment-locked-banner {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payment-locked-banner h4 {
  font-size: 11.5px;
  font-weight: 700;
  color: #92400E;
}

.payment-locked-banner p {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.btn-pay-trigger {
  background: var(--accent-gold);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-pay-trigger:hover {
  background: #B45309;
}

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

/* Notification log panel */
.notification-log-card {
  background: var(--surface-white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-log-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-navy);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: 6px;
}

.logs-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item-ui {
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--text-dark);
  padding: 6px 8px;
  background: var(--bg-light);
  border-radius: 4px;
}

/* Payment Drawer Modal style */
.payment-card {
  text-align: left;
}

.margin-bottom {
  margin-bottom: 8px;
}

.btn-close-payment {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.payment-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-method {
  width: 100%;
  background: var(--bg-light);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.pay-method:hover {
  background: rgba(37, 88, 168, 0.08);
  border-color: rgba(37, 88, 168, 0.2);
}

.pay-method .material-icons {
  color: var(--secondary-navy);
  font-size: 20px;
}

.pay-method span:not(.material-icons) {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Document Reader UI Fullscreen Modal */
.document-card {
  max-width: 90%;
  height: 90%;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.document-header-row {
  height: 52px;
  background: var(--surface-white);
  border-bottom: 1px solid var(--surface-alt);
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.document-header-row h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-navy);
  margin-bottom: 0;
}

.btn-dialog-back {
  background: none;
  border: none;
  color: var(--primary-navy);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

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

.btn-download-txt {
  background: var(--primary-navy);
  border: none;
  color: #FFFFFF;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.document-paper {
  flex: 1;
  overflow-y: auto;
  background: #FAFAF9;
  padding: 24px;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.6;
  color: #2D3748;
}

.document-paper p {
  margin-bottom: 12px;
  white-space: pre-wrap;
}

/* Administrative Lock & Panel Screen Styles */
.admin-lock-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.lock-icon {
  font-size: 48px !important;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.admin-lock-screen h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-navy);
}

.admin-lock-screen p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
  margin-bottom: 24px;
}

.login-box {
  width: 100%;
  background: var(--surface-white);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.btn-login {
  background: var(--surface-white);
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  padding: 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-login:hover {
  background: var(--bg-light);
}

.btn-login .material-icons {
  font-size: 16px;
  color: #DB4437; /* Google Red logo style */
}

/* Admin Dashboard screen UI */
.admin-panel-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-header {
  background: var(--surface-white);
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.admin-header h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-navy);
}

.admin-email-display {
  font-size: 10px;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--error-red);
  cursor: pointer;
}

.scrollable-admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat-card {
  background: var(--surface-white);
  padding: 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
  display: block;
}

.stat-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.admin-section-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-cases-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-case-card {
  background: var(--surface-white);
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.admin-case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.admin-case-header h5 {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-navy);
}

.admin-action-row {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-action-row select {
  font-size: 10px;
  padding: 4px 6px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  font-family: var(--font-sans);
  background: var(--surface-white);
}

.btn-send-alert {
  background: var(--secondary-navy);
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Hide helper utilities */
.hidden {
  display: none !important;
}

/* File Uploader styling */
.file-uploader-box {
  border: 2px dashed rgba(27, 63, 114, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  background: rgba(27, 63, 114, 0.02);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.file-uploader-box:hover {
  background: rgba(27, 63, 114, 0.06);
  border-color: var(--secondary-navy);
}

.file-uploader-box .material-icons {
  font-size: 28px;
  color: var(--secondary-navy);
}

.file-uploader-box p {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.uploaded-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}

.uploaded-file-item {
  background: var(--surface-alt);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dark);
}

.uploaded-file-item .file-name-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 80%;
}

.uploaded-file-item .file-name-meta .material-icons {
  font-size: 14px;
  color: var(--text-muted);
}

.uploaded-file-item .file-name-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-file {
  background: none;
  border: none;
  color: var(--error-red);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.btn-remove-file .material-icons {
  font-size: 14px;
}

/* Download Actions Group styling */
.download-actions-group {
  display: flex;
  gap: 6px;
}

.btn-download {
  border: none;
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-download:hover {
  opacity: 0.9;
}

.btn-download .material-icons {
  font-size: 14px;
}

.btn-txt {
  background: var(--primary-navy);
}

.btn-pdf {
  background: var(--error-red);
}

.btn-doc {
  background: var(--secondary-navy);
}

/* =====================================================================
   TUTELAYA BRAND LOGO STYLING
   ===================================================================== */
.app-header-logo,
.app-sidebar-logo,
.app-admin-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.logo-badge {
  padding: 0 !important;
  overflow: hidden !important;
  background: none !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.admin-logo-badge {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px auto;
  border-radius: 50% !important;
}

/* =====================================================================
   MAIN RESPONSIVE PORTAL LAYOUT (MaxAccidentado Center SaaS Style)
   ===================================================================== */

/* Force desktop wrapper into a clean vertical centered container */
.desktop-background {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: auto;
  background: radial-gradient(circle at 50% 50%, #0d1627 0%, #030712 100%) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 50px 20px !important;
  overflow-y: auto !important;
}

.main-responsive-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px; /* Perfectly sized for a sleek card dashboard */
  margin: 0 auto;
  z-index: 10;
}

/* Brand Portal Header (Visible on Desktop, sleek and clean) */
.brand-portal-header {
  text-align: center;
  color: #FFFFFF;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.brand-logo-container {
  width: 80px;
  height: 80px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(37, 88, 168, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-portal-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: #FFFFFF;
}

.brand-tagline {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 12px;
  color: #9CA3AF;
  max-width: 480px;
  line-height: 1.4;
}

/* App Portal Card (SaaS Container) */
.app-portal-card {
  width: 100%;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  height: 740px; /* Exact emulation height but responsive */
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.phone-screen-responsive {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Make sure inner scrollable form fills card correctly */
.scrollable-form,
.scrollable-processes-list,
.scrollable-admin-content {
  flex: 1;
  overflow-y: auto;
}

/* Hiding legacy emulator layout components */
.phone-speaker,
.phone-camera,
.home-indicator,
.status-bar,
.hero-sidebar,
.phone-chassis {
  display: none !important;
}

/* =====================================================================
   MOBILE RESPONSIVE MEDIA QUERIES (100% Mobile Adaptable Screen)
   ===================================================================== */
@media (max-width: 640px) {
  .desktop-background {
    padding: 0 !important;
    align-items: stretch !important;
    background: var(--bg-light) !important; /* White/Light background on mobile natively */
  }

  .main-responsive-container {
    max-width: 100% !important;
    height: 100vh !important;
    margin: 0 !important;
  }

  .brand-portal-header {
    display: none !important; /* Hide external header to save mobile real estate */
  }

  .app-portal-card {
    border-radius: 0 !important;
    height: 100vh !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   CLERK AUTHENTICATION GRAPHICS & GLASSMORPHISM
   ========================================================================== */

.clerk-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 30% 30%, rgba(13, 27, 42, 0.95) 0%, rgba(5, 10, 20, 0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  box-sizing: border-box;
}

.clerk-login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 32px 24px;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.clerk-login-header {
  margin-bottom: 24px;
  width: 100%;
}

.clerk-logo-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(37, 88, 168, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  overflow: hidden;
}

.clerk-login-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clerk-login-header h2 {
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.clerk-login-header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

#clerk-signin-widget {
  width: 100%;
  min-height: 380px;
  display: flex;
  justify-content: center;
}

/* User profile button styling */
.clerk-user-btn-container {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

.clerk-user-name {
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* ==========================================================================
   IMPUGNACIÓN COMPONENT STYLING
   ========================================================================== */

.impugnacion-card {
  background: linear-gradient(135deg, rgba(219, 68, 55, 0.04) 0%, rgba(27, 63, 114, 0.08) 100%);
  border: 1px solid rgba(219, 68, 55, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-top: 24px;
}

.impugnacion-card h4 {
  color: #FFFFFF;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.impugnacion-card p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.impugnacion-uploader {
  border: 2px dashed rgba(219, 68, 55, 0.3);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.impugnacion-uploader:hover {
  border-color: rgba(219, 68, 55, 0.6);
  background: rgba(219, 68, 55, 0.05);
}

.impugnacion-uploader span {
  font-size: 32px;
  color: #DB4437;
}

.impugnacion-uploader p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.impugnacion-status {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #FFFFFF;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-impugnar {
  width: 100%;
  background: linear-gradient(135deg, #DB4437 0%, #B02F24 100%);
  border: none;
  color: #FFFFFF;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(219, 68, 55, 0.3);
  transition: all 0.2s ease;
}

.btn-impugnar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(219, 68, 55, 0.5);
}

.impugnacion-draft-container {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.impugnacion-draft-container h5 {
  color: #FFFFFF;
  font-size: 14px;
  margin-bottom: 8px;
}

.impugnacion-textarea {
  width: 100%;
  height: 250px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  padding: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.btn-copy-impugnacion {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-copy-impugnacion:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   NUEVOS ESTILOS v5 — TutelaYA
   ============================================================ */

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1F2937;
  color: #F9FAFB;
  border-left: 4px solid var(--secondary-navy);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  pointer-events: auto;
  max-width: 320px;
  animation: toastIn 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  line-height: 1.4;
}

.toast.success { border-left-color: var(--soft-green); }
.toast.error   { border-left-color: var(--error-red); }
.toast.warning { border-left-color: var(--accent-gold); }

.toast .material-icons {
  font-size: 18px;
  flex-shrink: 0;
  color: var(--soft-green);
}
.toast.error .material-icons   { color: var(--error-red); }
.toast.warning .material-icons { color: var(--accent-gold); }
.toast.info .material-icons    { color: var(--secondary-navy); }

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(60px); }
}

/* Form Steps Bar */
.form-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: var(--surface-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.step-item span {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s;
}

.step-item.active .step-circle {
  background: var(--primary-navy);
  color: #fff;
  border-color: var(--secondary-navy);
  box-shadow: 0 0 0 3px rgba(37,88,168,0.15);
}

.step-item.active span {
  color: var(--primary-navy);
}

.step-item.done .step-circle {
  background: var(--soft-green);
  color: #fff;
  border-color: var(--soft-green);
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--surface-alt);
  margin: 0 8px;
  margin-bottom: 13px;
  border-radius: 2px;
  transition: background 0.3s;
  min-width: 20px;
}

.step-connector.done {
  background: var(--soft-green);
}

/* Character Counter */
.char-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
}

.char-counter {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.char-counter.warn  { color: var(--accent-gold); }
.char-counter.limit { color: var(--error-red); }
.char-counter.ok    { color: var(--soft-green); }

.char-hint {
  font-size: 9.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* File Upload Improvements */
.file-uploader-box {
  border: 2px dashed rgba(37,88,168,0.25);
  border-radius: var(--radius-md);
  padding: 18px 14px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: rgba(37,88,168,0.025);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.file-uploader-box:hover,
.file-uploader-box.drag-over {
  border-color: var(--secondary-navy);
  background: rgba(37,88,168,0.07);
}

.upload-icon-main {
  font-size: 28px !important;
  color: var(--secondary-navy);
  opacity: 0.7;
}

.upload-label-main {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-navy);
  margin: 0;
}

.upload-label-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  margin: 0;
}

.upload-type-pills {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.type-pill {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.type-pill.pdf { background: #FEE2E2; color: #B91C1C; }
.type-pill.doc { background: #DBEAFE; color: #1D4ED8; }
.type-pill.img { background: #D1FAE5; color: #065F46; }
.type-pill.txt { background: #F3F4F6; color: #4B5563; }

/* File count badge on label */
.badge-file-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--secondary-navy);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-file-count.hidden { display: none; }

/* Uploaded file item improvements */
.uploaded-file-item {
  background: var(--surface-white);
  border: 1px solid rgba(27,63,114,0.08);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  transition: border-color 0.2s;
}

.uploaded-file-item:hover {
  border-color: rgba(27,63,114,0.2);
}

/* File type icon colors */
.file-icon-pdf  { color: #DC2626; }
.file-icon-doc  { color: #2563EB; }
.file-icon-img  { color: #059669; }
.file-icon-txt  { color: #6B7280; }
.file-icon-def  { color: var(--text-muted); }

/* Form Error Banner */
.form-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 4px solid var(--error-red);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11.5px;
  color: #B91C1C;
  font-weight: 500;
  animation: toastIn 0.25s ease;
}

.form-error-banner.hidden { display: none; }

.form-error-banner .material-icons {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--error-red);
}

/* Input invalid state */
.input-invalid input,
.input-invalid textarea,
.input-invalid select {
  border-color: var(--error-red) !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15) !important;
}

/* Submit button — gradient upgrade */
.btn-submit {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  box-shadow: 0 4px 14px rgba(37,88,168,0.35);
  letter-spacing: 0.3px;
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--secondary-navy) 0%, #3B82F6 100%);
  box-shadow: 0 6px 18px rgba(37,88,168,0.45);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Drafting Steps Overlay */
.drafting-card {
  max-width: 300px !important;
}

.drafting-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-navy), var(--secondary-navy));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  box-shadow: 0 4px 14px rgba(37,88,168,0.4);
}

.drafting-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  text-align: left;
}

.drafting-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  opacity: 0.4;
  transition: all 0.4s;
}

.drafting-step.active {
  background: rgba(37,88,168,0.1);
  border: 1px solid rgba(37,88,168,0.2);
  opacity: 1;
}

.drafting-step.done {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  opacity: 1;
}

.dstep-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(37,88,168,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drafting-step.done .dstep-icon {
  background: rgba(16,185,129,0.15);
}

.dstep-icon .material-icons {
  font-size: 15px;
  color: var(--primary-navy);
}

.drafting-step.active .dstep-icon .material-icons {
  animation: pulse-icon 1.2s infinite alternate;
}

.drafting-step.done .dstep-icon .material-icons {
  color: var(--soft-green);
}

.drafting-step span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dark);
}

@keyframes pulse-icon {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(1.15); opacity: 1; }
}

/* Voice button active state */
.btn-voice-dictate.recording {
  background: rgba(239,68,68,0.12);
  color: var(--error-red);
  animation: pulse-voice 1s infinite alternate;
}

@keyframes pulse-voice {
  from { box-shadow: 0 0 0 0 rgba(239,68,68,0.2); }
  to   { box-shadow: 0 0 0 6px rgba(239,68,68,0.0); }
}

/* Responsive portal container */
.main-responsive-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 10;
  padding: 20px 16px;
  max-height: 100vh;
  overflow-y: auto;
}

/* Brand header improvements */
.brand-portal-header {
  text-align: center;
  color: #F9FAFB;
  margin-bottom: 16px;
  padding: 0 16px;
}

.brand-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.brand-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.brand-portal-header h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(to right, #FFFFFF 20%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
  line-height: 1.5;
}

/* App portal card improvements */
.app-portal-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 10px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}

.phone-screen-responsive {
  background: var(--bg-light);
  border-radius: 16px;
  overflow: hidden;
  height: 680px;
  display: flex;
  flex-direction: column;
}

/* Clerk user header improvements */
.clerk-user-btn-container {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}

.clerk-user-name {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}


/* ============================================================
   REDISEÑO MOBILE-FIRST v7 — TutelaYA
   ============================================================ */

/* Reset completo para vista móvil */
html, body {
  height: 100%;
  overflow: hidden;
  background: #f4f6f9;
}

/* Shell principal — ocupa toda la pantalla */
.mobile-app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 0 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

/* En desktop: fondo oscuro detrás del shell */
@media (min-width: 481px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, #0d1b2e 0%, #020813 100%);
    z-index: -1;
  }
}

/* App main content ocupa todo el shell */
.mobile-app-shell .app-main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-light);
}

/* ── HERO HEADER con gradiente ── */
.hero-header {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 5;
}

.hero-gradient-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
    #0d2447 0%,
    #1B3F72 35%,
    #2558A8 70%,
    #3B7DD8 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 36px;
  gap: 10px;
}

/* Logo grande con anillo luminoso */
.hero-logo-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 3px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 8px rgba(255,255,255,0.06),
    0 8px 32px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  animation: heroPulse 3s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  from { box-shadow: 0 0 0 8px rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.35); }
  to   { box-shadow: 0 0 0 14px rgba(255,255,255,0.03), 0 12px 40px rgba(0,0,0,0.4); }
}

.hero-logo-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
  margin: 0;
  line-height: 1;
}

.hero-title span {
  color: #D97706;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0;
}

/* Ola de transición del hero al contenido blanco */
.hero-wave {
  position: relative;
  z-index: 2;
  height: 28px;
  background: var(--bg-light);
  clip-path: ellipse(55% 100% at 50% 100%);
  margin-top: -1px;
}

/* ── TAB SCREENS en mobile-shell ── */
.mobile-app-shell .tab-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* El scrollable-form llena el espacio restante */
.mobile-app-shell .scrollable-form {
  padding: 12px 14px 100px;
}

/* ── BOTTOM NAV más moderno ── */
.mobile-app-shell .bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(27,63,114,0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px 8px;
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(27,63,114,0.08);
}

.mobile-app-shell .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 12px;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.mobile-app-shell .nav-item.active {
  color: var(--primary-navy);
  background: rgba(27,63,114,0.06);
}

.mobile-app-shell .nav-item .material-icons {
  font-size: 22px;
}

.mobile-app-shell .nav-item span:not(.material-icons) {
  font-size: 9.5px;
  font-weight: 600;
}

/* Home indicator */
.mobile-app-shell .home-indicator {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: rgba(27,63,114,0.2);
  border-radius: 4px;
  z-index: 21;
}

/* ── OCULTAR elementos del diseño desktop ── */
.desktop-background,
.main-responsive-container,
.brand-portal-header,
.app-portal-card,
.phone-screen-responsive,
.glow-orb,
.clerk-user-btn-container {
  display: none !important;
}

/* ── Form sections más compactas en mobile ── */
.mobile-app-shell .form-section {
  border-radius: 12px;
  padding: 14px;
  gap: 10px;
}

.mobile-app-shell .btn-submit {
  border-radius: 14px;
  padding: 16px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(27,63,114,0.4);
  margin-top: 4px;
}

/* ── Dialogs ocupan toda la pantalla en mobile ── */
.mobile-app-shell .dialog-overlay {
  position: fixed;
  z-index: 200;
}

/* ── Process detail slide desde la derecha ── */
.mobile-app-shell .process-detail-view.hidden {
  transform: translateX(100%);
  display: flex;
}

/* ── Scrollable detail content con padding bottom para nav ── */
.mobile-app-shell .scrollable-detail-content {
  padding-bottom: 80px;
}

/* ── Scrollable processes list con padding bottom ── */
.mobile-app-shell .scrollable-processes-list {
  padding-bottom: 80px;
}

/* ── Admin scrollable content ── */
.mobile-app-shell .scrollable-admin-content {
  padding-bottom: 80px;
}

