:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #d97706;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-gold: #b45309;
  --accent-gold-hover: #92400e;
  --accent-gold-bg: rgba(180, 83, 9, 0.08);
  --accent-blue: #0284c7;
  --accent-blue-bg: rgba(2, 132, 199, 0.08);
  --onedrive-blue: #0078d4;
  --onedrive-hover: #106ebe;
  --onedrive-bg: rgba(0, 120, 212, 0.1);
  --success-green: #059669;
  --success-bg: rgba(5, 150, 105, 0.08);
  --danger-red: #dc2626;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-signature: 'Great Vibes', 'Brush Script MT', 'Segoe Script', cursive;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Nav */
.navbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 2rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.shield-logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1.5px solid var(--accent-gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.2);
}

.shield-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-name span {
  color: var(--accent-gold);
}

.brand-sub {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Header Navigation Pill Tabs / Buttons */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  padding: 0.3rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nav-item,
a.nav-item,
.navbar a.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569 !important;
  text-decoration: none !important;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
}

.nav-item:hover,
a.nav-item:hover,
.navbar a.nav-item:hover {
  color: #0f172a !important;
  background: #ffffff !important;
  border-color: rgba(180, 83, 9, 0.25) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  transform: translateY(-1px);
  text-decoration: none !important;
}

.nav-item:active,
a.nav-item:active,
.navbar a.nav-item:active {
  color: var(--accent-gold) !important;
  background: #ffffff !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 1px 2px rgba(180, 83, 9, 0.12);
  text-decoration: none !important;
}

.deal-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.deal-selector-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.deal-select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.deal-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(180, 83, 9, 0.35);
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: #cbd5e1;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-onedrive {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.25);
}

.btn-onedrive:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 120, 212, 0.35);
  background: linear-gradient(135deg, #106ebe 0%, #004578 100%);
}

.btn-outline {
  background: transparent;
  border-color: #cbd5e1;
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.9rem 1.8rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-gold {
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid rgba(180, 83, 9, 0.3);
}

.badge-green {
  background: var(--success-bg);
  color: var(--success-green);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.badge-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.badge-lock {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Deal Hero Section */
.deal-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.deal-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-gold) 0%, #0284c7 50%, var(--accent-gold) 100%);
}

.hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-title-group h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-badges {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-value.highlight {
  color: var(--accent-gold);
}

.hero-body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .hero-body {
    grid-template-columns: 1fr;
  }
}

.teaser-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.highlights-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.highlights-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.highlights-list li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.highlights-list li svg {
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Access Gate Banner (When Gated) */
.gate-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid rgba(180, 83, 9, 0.35);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.gate-banner-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-gold-bg);
  border: 1.5px solid var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  margin-bottom: 0.25rem;
}

.gate-banner h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.gate-banner p {
  max-width: 650px;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.gate-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.unlock-existing-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  transition: var(--transition);
}

.unlock-existing-link:hover {
  color: var(--accent-gold);
}

/* Unlocked Deal Room Header Bar */
.unlocked-status-bar {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.08) 0%, #ffffff 100%);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.signer-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.signer-verified-badge {
  width: 40px;
  height: 40px;
  background: var(--success-bg);
  border: 1.5px solid var(--success-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success-green);
  flex-shrink: 0;
}

.signer-text {
  display: flex;
  flex-direction: column;
}

.signer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.signer-cert {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.unlocked-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Data Room Explorer */
.data-room-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.explorer-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.explorer-search {
  position: relative;
  min-width: 280px;
}

.explorer-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.explorer-search input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.explorer-search svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  border-color: #cbd5e1;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Folder Groups & Documents Table */
.folder-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.folder-header {
  padding: 0.9rem 1.4rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.folder-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.folder-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.file-list {
  display: flex;
  flex-direction: column;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid #f1f5f9;
  transition: var(--transition);
  gap: 1rem;
}

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

.file-item:hover {
  background: var(--bg-card-hover);
}

.file-info-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.file-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.icon-pdf {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.icon-xlsx {
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.icon-zip {
  background: rgba(180, 83, 9, 0.08);
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.25);
}

.file-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.file-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 70px;
  text-align: right;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

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

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 1.25rem 1.75rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-title-group p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

/* Agreement Contract Box */
.contract-scroll-box {
  background: var(--bg-primary);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-height: 230px;
  overflow-y: auto;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.65;
}

.contract-scroll-box h4 {
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-top: 0.85rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contract-scroll-box h4:first-child {
  margin-top: 0;
}

.contract-scroll-box p {
  margin-bottom: 0.75rem;
}

/* Signature Pad Component */
.signature-card {
  background: var(--bg-primary);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.sig-mode-switch {
  display: flex;
  background: #e2e8f0;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
}

.sig-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.sig-mode-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.canvas-wrapper {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-sm);
  height: 140px;
  overflow: hidden;
  border: 2px dashed #94a3b8;
}

#signature-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
  display: block;
}

.typed-signature-preview {
  display: none;
  background: #ffffff;
  border-radius: var(--radius-sm);
  height: 140px;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 2px dashed #94a3b8;
}

.typed-sig-text {
  font-family: var(--font-signature);
  font-size: 2.4rem;
  color: #0c2340;
  user-select: none;
}

.canvas-clear-btn {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.canvas-clear-btn:hover {
  color: var(--accent-gold);
}

.terms-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.terms-checkbox-label input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-gold);
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

/* Document Previewer Modal */
.preview-modal-body {
  height: 65vh;
  padding: 0;
  position: relative;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.08);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.preview-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  gap: 1.25rem;
  background: #ffffff;
}

.preview-content-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1.75rem 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-gold);
}


/* Interactive Folder & Subfolder Tree Hierarchy */
.folder-header {
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.folder-header:hover {
  background: #f1f5f9;
}
.folder-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.folder-arrow {
  width: 14px;
  height: 14px;
  color: var(--accent-gold);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.folder-header.collapsed .folder-arrow {
  transform: rotate(-90deg);
}
.folder-header.collapsed {
  border-bottom: none;
}
.folder-content {
  display: flex;
  flex-direction: column;
}
.folder-content.collapsed {
  display: none;
}

/* Subfolder Group Styling */
.subfolder-group {
  margin: 0.65rem 1rem 0.65rem 1.75rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.subfolder-header {
  padding: 0.7rem 1.15rem;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.subfolder-header:hover {
  background: #e2e8f0;
}
.subfolder-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.subfolder-arrow {
  width: 12px;
  height: 12px;
  color: var(--accent-gold);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.subfolder-header.collapsed .subfolder-arrow {
  transform: rotate(-90deg);
}
.subfolder-content {
  display: flex;
  flex-direction: column;
}
.subfolder-content.collapsed {
  display: none;
}
.file-item.nested {
  padding: 0.75rem 1.15rem;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
}
.file-item.nested:last-child {
  border-bottom: none;
}
.file-item.nested:hover {
  background: #f1f5f9;
}

/* In-Browser PDF Preview Modal */
.preview-modal-body-pdf {
  height: 75vh;
  position: relative;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
}
.preview-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}
.preview-watermark-overlay {
  position: absolute;
  top: 10px;
  right: 15px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  pointer-events: none;
}

/* Notification Toast */
.toast-banner {
  position: fixed;
  top: 80px;
  right: 25px;
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 200;
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   SPONSOR PORTAL 2-STEP VERIFICATION & AUTHENTICATION
   ========================================================================== */
.admin-content-locked {
  filter: blur(12px) brightness(0.65);
  pointer-events: none !important;
  user-select: none !important;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

.sponsor-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(241, 245, 249, 0.94) 0%, rgba(226, 232, 240, 0.98) 100%);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.sponsor-gate-card {
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12), 0 0 20px rgba(180, 83, 9, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  animation: fadeInModal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sponsor-gate-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

.auth-step-pane {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sponsor-2fa-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid rgba(180, 83, 9, 0.28);
  margin-bottom: 0.85rem;
}

.sponsor-gate-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.sponsor-gate-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.pass-toggle-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.pass-toggle-btn:hover {
  color: var(--text-primary);
}

.auth-error-banner {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
}

.code-inputs-group {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  margin: 1.25rem 0 1rem;
}

.digit-input {
  width: 48px;
  height: 58px;
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  font-family: 'Inter', monospace;
}

.digit-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.2);
  background: #ffffff;
  transform: translateY(-2px);
}

.auth-setup-drawer {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-top: 0.5rem;
  animation: fadeInModal 0.2s ease;
}

.qr-code-wrapper {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}

.auth-secret-code {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--accent-gold);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  display: inline-block;
  user-select: all;
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem;
  font-size: 0.82rem;
  transition: color 0.2s ease;
}

.link-btn:hover {
  filter: brightness(1.2);
}

.sponsor-auth-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  color: #059669;
  font-weight: 600;
}

.auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 6px #059669;
}

/* ==========================================================================
   INVESTOR PORTAL STYLES (NO CA REQUIRED)
   ========================================================================== */
.portal-deal-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.portal-pill {
  background: var(--bg-card);
  border: 1px solid #cbd5e1;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.portal-pill:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
  background: #f8fafc;
}
.portal-pill.active {
  background: rgba(180, 83, 9, 0.1);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.portal-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.portal-hero-title {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.portal-hero-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.5;
}
.portal-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill-green {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: #059669;
}
.pill-gold {
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.3);
  color: var(--accent-gold);
}
.portal-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  gap: 1.5rem;
}
.portal-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.portal-tab-btn:hover {
  color: var(--text-primary);
}
.portal-tab-btn.active {
  color: var(--accent-gold);
}
.portal-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.report-card:hover {
  border-color: rgba(180, 83, 9, 0.4);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.report-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.report-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 650px;
}
.report-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ==========================================================================
   MOBILE & RESPONSIVE OPTIMIZATION SYSTEM
   ========================================================================== */

/* Global Mobile Viewport Stability */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* iOS Touch Momentum Scrolling */
.contract-scroll-box,
.table-container,
.category-tabs,
.portal-deal-filter,
.portal-tabs-nav,
.modal-body {
  -webkit-overflow-scrolling: touch;
}

/* Mobile Touch Canvas Precision */
#signature-canvas {
  touch-action: none !important;
}
.canvas-wrapper {
  touch-action: none !important;
}

/* --------------------------------------------------------------------------
   TABLET & PHABLET STYLES (Max-Width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .container {
    padding: 0 1.25rem;
  }
  .hero-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .portal-hero-banner {
    padding: 1.5rem;
  }
  .metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   STANDARD TABLET & MOBILE BREAKPOINT (Max-Width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Prevent iOS zoom-on-focus by enforcing minimum 16px font-size */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Header & Navigation */
  .navbar {
    padding: 0.65rem 0;
  }
  .nav-container {
    padding: 0 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .brand-wrapper {
    gap: 0.65rem;
  }
  .shield-logo-img {
    width: 34px;
    height: 34px;
  }
  .brand-name {
    font-size: 1.05rem;
  }
  .brand-sub {
    font-size: 0.7rem;
  }
  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .nav-actions .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    min-height: 38px;
  }
  #deal-selector {
    width: 100%;
    max-width: 100%;
    font-size: 16px !important;
  }

  /* Main Layout */
  .main-content {
    padding: 1.25rem 0 2.5rem;
  }

  /* Deal Hero Card */
  .deal-hero-card {
    padding: 1.35rem 1rem;
    border-radius: var(--radius-md);
  }
  .hero-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.15rem;
  }
  .hero-title-group h1 {
    font-size: 1.45rem;
    line-height: 1.25;
  }
  .hero-subtitle {
    font-size: 0.88rem;
    flex-wrap: wrap;
  }
  .hero-badges {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Key Metrics Ribbon (2x2 Grid on Mobile) */
  .metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
  }
  .metric-label {
    font-size: 0.7rem;
  }
  .metric-value {
    font-size: 1.15rem;
  }

  /* Access Gate Banner */
  .gate-banner {
    padding: 1.75rem 1.15rem;
    border-radius: var(--radius-md);
  }
  .gate-banner-icon {
    width: 52px;
    height: 52px;
  }
  .gate-banner-icon svg {
    width: 26px;
    height: 26px;
  }
  .gate-banner h2 {
    font-size: 1.35rem;
  }
  .gate-banner p {
    font-size: 0.88rem;
    line-height: 1.5;
  }
  .gate-banner .btn-lg {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    justify-content: center;
  }

  /* Unlocked Deal Room Header */
  .unlocked-status-bar {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .unlocked-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .unlocked-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  /* Explorer Header & Search */
  .explorer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .explorer-title {
    font-size: 1.2rem;
  }
  .explorer-search {
    width: 100%;
    min-width: 0;
  }

  /* Subfolder Indentation on Mobile */
  .subfolder-group {
    margin: 0.5rem 0.4rem 0.5rem 0.65rem;
    border-left-width: 2px;
  }
  .subfolder-header {
    padding: 0.65rem 0.85rem;
  }

  /* File Item Rows: Responsive Flex-Wrap Layout */
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }
  .file-info-group {
    width: 100%;
  }
  .file-name {
    white-space: normal;
    word-break: break-word;
    font-size: 0.88rem;
    line-height: 1.35;
  }
  .file-desc {
    white-space: normal;
    font-size: 0.75rem;
    margin-top: 2px;
  }
  .file-meta {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
  }
  .file-size {
    text-align: left;
    width: auto;
  }
  .file-actions {
    gap: 0.4rem;
  }
  .file-actions .btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }

  /* Modals: Mobile Optimized Bottom-Sheet & Dialogs */
  .modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }
  .modal-container {
    max-height: 94vh;
    border-radius: 16px 16px 8px 8px;
    margin: 0;
  }
  .modal-header {
    padding: 1rem 1.15rem;
  }
  .modal-title-group h3 {
    font-size: 1.15rem;
  }
  .modal-body {
    padding: 1.15rem;
    gap: 1.15rem;
  }
  .modal-footer {
    padding: 1rem 1.15rem;
    flex-direction: column-reverse;
    gap: 0.65rem;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    min-height: 44px;
  }

  /* Form Grid on Mobile */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* Signature Component on Mobile */
  .signature-card {
    padding: 0.9rem;
  }
  .canvas-wrapper {
    height: 130px;
  }
  .sig-toggle-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* 2-Step Gate Cards (Sponsor & Investor) */
  .sponsor-gate-overlay {
    padding: 0.75rem;
  }
  .sponsor-gate-card {
    padding: 1.75rem 1.15rem;
    border-radius: var(--radius-md);
  }
  .sponsor-gate-logo {
    width: 54px;
    height: 54px;
    margin-bottom: 0.85rem;
  }
  .sponsor-gate-title {
    font-size: 1.35rem;
  }
  .sponsor-gate-desc {
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
  }

  /* Investor Portal Components */
  .portal-hero-banner {
    padding: 1.25rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .portal-hero-title {
    font-size: 1.35rem;
  }
  .portal-hero-sub {
    font-size: 0.82rem;
  }
  .portal-deal-filter {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  .portal-pill {
    flex-shrink: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
  }
  .portal-tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    gap: 1rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .portal-tab-btn {
    font-size: 0.88rem;
    padding: 0.6rem 0.2rem;
  }
  .report-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .report-card .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  /* Sponsor Admin Dashboard */
  .admin-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  .admin-stat-card {
    padding: 1rem;
  }
  .stat-label {
    font-size: 0.72rem;
  }
  .stat-number {
    font-size: 1.6rem;
  }
  .stat-sub {
    font-size: 0.75rem;
  }
  .copy-input-row {
    flex-direction: column;
  }
  .copy-input-row select,
  .copy-input-row input,
  .copy-input-row button {
    width: 100% !important;
    max-width: 100% !important;
  }
  .table-container table {
    min-width: 650px;
  }
  .table-container th,
  .table-container td {
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
  }

  /* Document Preview Modals */
  .modal-container.modal-lg {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 94vh !important;
    border-radius: 14px 14px 0 0 !important;
  }

  /* Notification Toast */
  .toast-banner {
    top: auto;
    bottom: 20px;
    right: 15px;
    left: 15px;
    font-size: 0.82rem;
    padding: 0.85rem 1rem;
    justify-content: center;
  }

  /* Footer */
  .footer {
    padding: 1.5rem 1rem;
  }
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* --------------------------------------------------------------------------
   SMALL MOBILE PHONES (Max-Width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .brand-name {
    font-size: 0.98rem;
  }
  .brand-sub {
    display: none;
  }
  
  /* 6-Digit Code Inputs Fitting on 375px Screen */
  .code-inputs-group {
    gap: 0.35rem;
  }
  .digit-input {
    width: 38px;
    height: 48px;
    font-size: 1.35rem;
  }

  /* Admin Grid 1-col on very small screens */
  .admin-grid {
    grid-template-columns: 1fr !important;
  }

  .metrics-ribbon {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}


