/* IPO Form Styles */
.card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease-in-out;
    background-color: #ffffff;
  }
  
  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }
  
  .card-body {
    padding: 2rem;
  }
  
  .form-group {
    margin-bottom: 1.75rem;
  }
  
  .form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #f8f9fa;
  }
  
  .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(96, 85, 205, 0.25);
    background-color: #ffffff;
  }
  
  /* Select Field Styling */
  .form-label-select {
    display: flex;
    align-items: center;
    color: #000d50;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 8px;
  }
  
  .form-label-select i {
    color: #6055cd;
    font-size: 0.875rem;
  }
  
  .select-wrapper {
    position: relative;
    display: block;
  }
  
  .form-control-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-weight: 500;
    color: #000d50;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .form-control-select:hover {
    border-color: #6055cd;
    background-color: #fafbff;
  }
  
  .form-control-select:focus {
    border-color: #6055cd;
    box-shadow: 0 0 0 0.2rem rgba(96, 85, 205, 0.15);
    background-color: #ffffff;
    outline: none;
  }
  
  .form-control-select option {
    padding: 0.5rem;
    font-weight: 500;
  }
  
  .select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6055cd;
    font-size: 0.75rem;
    pointer-events: none;
    transition: transform 0.2s ease;
  }
  
  .form-control-select:focus + .select-arrow {
    transform: translateY(-50%) rotate(180deg);
  }
  
  /* Editable vs Readonly Field Styling */
  .form-label-editable {
    color: #000d50;
    font-weight: 600;
  }
  
  .form-label-editable i {
    color: #6055cd;
  }
  
  .form-label-readonly {
    color: #6c757d;
    font-weight: 500;
  }
  
  .form-label-readonly i {
    color: #6c757d;
  }
  
  .form-control-editable {
    border: 2px solid #6055cd;
    background-color: #ffffff;
    font-weight: 500;
  }
  
  .form-control-editable:focus {
    border-color: #6055cd;
    box-shadow: 0 0 0 0.2rem rgba(96, 85, 205, 0.25);
    background-color: #ffffff;
  }
  
  .form-control-readonly-wrapper {
    position: relative;
  }
  
  .form-control-readonly {
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
    padding-right: 25px;
  }
  
  .form-control-readonly:focus {
    border-color: #e0e0e0;
    box-shadow: none;
    background-color: #f8f9fa;
    outline: none;
  }
  
  .form-control-readonly-highlight {
    background-color: rgba(96, 85, 205, 0.05);
    border-color: rgba(96, 85, 205, 0.2);
    font-weight: 600;
    color: #6055cd;
  }
  
  .form-control-readonly-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.75rem;
    pointer-events: none;
  }
  
  .form-section-divider {
    margin: 16px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(96, 85, 205, 0.1);
  }
  
  .form-section-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6055cd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .form-section-label i {
    font-size: 0.75rem;
  }
  
  .form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #6c757d;
  }
  
  .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
  }
  
  .btn-primary {
    background-color: var(--color-primary);
    border: none;
    color: white;
  }
  
  .btn-primary:hover {
    background-color: var(--color-primary-active);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* Account Table Styling */
  .account-table-wrapper {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background-color: #fff;
  }
  
  .account-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  
  .account-table thead {
    background: linear-gradient(135deg, rgba(96, 85, 205, 0.08) 0%, rgba(96, 85, 205, 0.03) 100%);
  }
  
  .account-table-th,
  .account-table-th-checkbox {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6055cd;
    border-bottom: 2px solid rgba(96, 85, 205, 0.1);
    white-space: nowrap;
  }
  
  .account-table-th i,
  .account-table-th-checkbox i {
    font-size: 0.75rem;
    opacity: 0.8;
  }
  
  .account-table-row {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    cursor: pointer;
  }
  
  .account-table-row:hover {
    background-color: rgba(96, 85, 205, 0.03);
    transform: translateX(2px);
  }

  .account-table-row--select-disabled {
    cursor: default;
    opacity: 0.55;
  }

  .account-table-row--select-disabled:hover {
    background-color: transparent;
    transform: none;
  }

  .ipo-form-account-select-count {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  
  .account-table-cell {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 0.875rem;
    color: #000d50;
  }
  
  .account-table-checkbox-cell {
    padding: 14px 16px;
    vertical-align: middle;
    text-align: center;
    width: 80px;
  }
  
  .account-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .account-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
  }

  .account-checkbox-custom {
    width:  22px;
    height: 22px;
    background-color: #fff;
    border: 1.75px solid #c4c7d4;
    border-radius: 6px;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
  }

  /* checkmark via CSS borders (more reliable than unicode) */
  .account-checkbox-custom::after {
    content: '';
    display: block;
    width:   5px;
    height:  9px;
    border:  2px solid transparent;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0;
    transition: opacity .15s ease;
  }

  .account-checkbox-wrapper:hover .account-checkbox-custom {
    border-color: #6055cd;
    background-color: rgba(96,85,205,.05);
  }

  .account-checkbox:checked ~ .account-checkbox-custom {
    background-color: #6055cd;
    border-color:     #6055cd;
    box-shadow:       0 2px 6px rgba(96,85,205,.35);
  }

  .account-checkbox:checked ~ .account-checkbox-custom::after {
    border-color: #fff;
    opacity: 1;
  }

  .account-checkbox:focus ~ .account-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(96,85,205,.22);
  }
  
  .account-name {
    font-weight: 500;
    color: #000d50;
  }
  
  .account-pan {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #6c757d;
    letter-spacing: 0.5px;
  }
  
  .account-type-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(96, 85, 205, 0.1);
    color: #6055cd;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
  }
  
  .account-bank-details {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
  }
  
  .account-bank-details i {
    font-size: 0.875rem;
  }
  
  .account-bank-details-updated {
    background-color: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.2);
  }
  
  .account-bank-details-updated:hover {
    background-color: rgba(22, 163, 74, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.1);
  }
  
  .account-bank-details-required {
    background-color: rgba(217, 119, 6, 0.1);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.22);
  }

  .account-bank-details-required:hover {
    background-color: rgba(217, 119, 6, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.12);
  }
  
  .account-table-empty {
    padding: 48px 20px;
    text-align: center;
  }

  /* ── Empty-state shell ────────────────────────────── */
  .account-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
    animation: aesIn 0.35s cubic-bezier(.25,.8,.25,1) both;
  }

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

  /* icon bubble */
  .aes-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(96,85,205,.12), rgba(132,39,215,.12));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }

  .aes-icon-wrap--warning {
    background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(217,119,6,.12));
  }

  .aes-icon {
    font-size: 1.6rem;
    color: var(--color-primary, #6055cd);
  }

  .aes-icon-wrap--warning .aes-icon {
    color: #d97706;
  }

  /* text */
  .aes-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e1b4b;
  }

  .aes-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
  }

  /* CTA button */
  .aes-cta {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--color-primary, #6055cd), var(--color-secondary, #8427d7));
    color: #fff !important;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(96,85,205,.28);
    transition: transform .18s ease, box-shadow .18s ease;
  }

  .aes-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(96,85,205,.38);
  }

  .aes-cta:active {
    transform: translateY(0);
  }

  button.aes-cta {
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
  }

  /* kept for backward compat (unused class guards) */
  .account-empty-state-warning .aes-icon { color: #d97706; }
  
  .fade-in {
    animation: fadeIn 0.8s ease-in-out;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  /* Segmented Control Styles */
  .segmented-control-wrapper {
    margin-bottom: 20px;
    padding: 0 16px;
  }
  
  .segmented-control {
    position: relative;
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 0;
  }
  
  .segment-item {
    position: relative;
    z-index: 2;
    padding: 10px 24px;
    border-radius: 50px;
    color: #6055CD;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    user-select: none;
  }
  
  .segment-item:hover {
    color: #6055CD;
  }
  
  .segment-item.active {
    color: #fff;
    background-color: transparent;
  }
  
  .segment-highlight {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background-color: #6055CD;
    border-radius: 50px;
    transition: transform 0.3s ease;
    z-index: 1;
  }
  
  .segment-highlight.active-right {
    transform: translateX(100%);
  }
  
  .segment-highlight.active-left {
    transform: translateX(0%);
  }
  
  /* Hide/show sections */
  .view-ipo-form-dashboard {
    display: block;
  }
  
  .create-ipo-form {
    display: none;
  }
  
  .view-ipo-form-dashboard.hidden {
    display: none;
  }
  
  .create-ipo-form.show {
    display: block;
  }
  
  /* IPO Dashboard Styles */
  @keyframes fadeInUp {
    from { 
      opacity: 0; 
      transform: translateY(6px); 
    }
    to { 
      opacity: 1; 
      transform: translateY(0); 
    }
  }
  
  @keyframes spin {
    to { 
      transform: rotate(360deg); 
    }
  }
  
  .min-h-screen {
    min-height: 100vh;
  }
  
  .bg-background {
    background-color: #f2f4ff;
  }
  
  /* Sticky Header */
  .sticky-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #f2f4ff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    margin-bottom: 0;
  }
  
  .sticky-header .header-content {
    max-width: 1280px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  
  .refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: transparent;
    border: 1px solid #6055cd;
    color: #6055cd;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .refresh-btn i {
    font-size: 1rem;
  }
  
  .refresh-btn:hover:not(:disabled) {
    background-color: #6055cd;
    color: #fff;
    transform: translateY(-1px);
  }
  
  .refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  /* Main Content */
  .main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 0;
  }
  
  /* Search Container */
  .search-container {
    margin-bottom: 24px;
  }
  
  .search-wrapper {
    position: relative;
  }
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #6c757d;
    pointer-events: none;
  }
  
  .search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    color: #000d50;
    font-size: 0.875rem;
    transition: all 0.2s;
  }
  
  .search-input::placeholder {
    color: #6c757d;
  }
  
  .search-input:focus {
    outline: none;
    border-color: #6055cd;
    box-shadow: 0 0 0 3px rgba(96, 85, 205, 0.1);
  }
  
  /* Loading State */
  .loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    gap: 16px;
    color: #6c757d;
  }
  
  .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #6055cd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  
  .loading-container p {
    margin: 0;
    font-size: 0.875rem;
  }
  
  /* Error State */
  .error-alert {
    padding: 12px 16px;
    background-color: rgba(236, 67, 74, 0.1);
    color: #ec434a;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid rgba(236, 67, 74, 0.2);
  }
  
  /* Table Container */
  .table-container {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.3s ease-out;
  }
  
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }
  
  .table-wrapper::-webkit-scrollbar {
    height: 8px;
  }
  
  .table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }
  
  .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(96, 85, 205, 0.3);
    border-radius: 4px;
  }
  
  .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 85, 205, 0.5);
  }
  
  .data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
  }
  
  /* Mobile Card View */
  .mobile-card-view {
    display: none;
  }
  
  .mobile-card {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    overflow: hidden;
  }
  
  .mobile-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
  }
  
  .mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 7px 8px;
    background: linear-gradient(135deg, rgba(96, 85, 205, 0.03) 0%, rgba(96, 85, 205, 0.01) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  
  .mobile-card-title {
    flex: 1;
    min-width: 0;
  }
  
  .mobile-card-ipo-name {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #000d50;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .mobile-card-category-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(96, 85, 205, 0.1);
    color: #6055cd;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.3px;
  }
  
  .mobile-card-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background-color: #6055cd;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
  }
  
  .mobile-card-download-btn:hover:not(:disabled) {
    background-color: #5045b8;
    transform: scale(1.05);
  }
  
  .mobile-card-download-btn:active {
    transform: scale(0.95);
  }
  
  .mobile-card-download-btn i {
    font-size: 0.875rem;
  }
  
  .mobile-card-body {
    padding: 14px 16px;
  }
  
  .mobile-card-section {
    margin-bottom: 12px;
  }
  
  .mobile-card-section:last-child {
    margin-bottom: 0;
  }
  
  .mobile-card-info-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .mobile-card-info-item {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .mobile-card-info-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
  }
  
  .mobile-card-info-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #000d50;
    word-break: break-word;
  }
  
  .mobile-card-info-value.font-mono {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
  }
  
  .mobile-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .mobile-card-grid-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  
  .mobile-card-grid-item-highlight {
    background-color: rgba(96, 85, 205, 0.08);
    border-radius: 6px;
    padding: 8px 4px;
  }
  
  .mobile-card-grid-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
  }
  
  .mobile-card-grid-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000d50;
  }
  
  .mobile-card-grid-item-highlight .mobile-card-grid-value {
    font-size: 0.9375rem;
    color: #6055cd;
  }
  
  .mobile-card-meta {
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }
  
  .mobile-card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .mobile-card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }
  
  .mobile-card-meta-icon {
    font-size: 0.75rem;
    color: #6c757d;
    flex-shrink: 0;
  }
  
  .mobile-card-meta-text {
    font-size: 0.75rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .mobile-card-meta-text.font-mono {
    font-family: 'Courier New', monospace;
  }
  
  .table-header {
    background-color: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .table-header .table-cell {
    padding: 16px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    text-align: left;
  }
  
  .table-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s;
  }
  
  .table-row:hover {
    background-color: rgba(96, 85, 205, 0.03);
  }
  
  .table-row:last-child {
    border-bottom: none;
  }
  
  .table-cell {
    padding: 16px;
    font-size: 0.875rem;
    color: #000d50;
    vertical-align: middle;
  }
  
  .table-cell.text-left {
    text-align: left;
  }
  
  .table-cell.text-center {
    text-align: center;
  }
  
  .table-cell.text-right {
    text-align: right;
  }
  
  .table-cell.text-primary {
    color: #6055cd;
  }
  
  .table-cell.text-muted {
    color: #6c757d;
  }
  
  .table-cell.font-semibold {
    font-weight: 600;
  }
  
  .table-cell.font-medium {
    font-weight: 500;
  }
  
  .table-cell.font-mono {
    font-family: 'Courier New', monospace;
  }
  
  .table-cell.text-sm {
    font-size: 0.875rem;
  }
  
  .table-cell.text-xs {
    font-size: 0.75rem;
  }
  
  .empty-state {
    padding: 60px 20px;
    text-align: center;
  }
  
  .empty-state-content {
    color: #6c757d;
    font-size: 0.875rem;
  }
  
  .ipo-name-wrapper {
    max-width: 300px;
  }
  
  .ipo-name {
    margin: 0;
    color: #000d50;
    font-weight: 500;
    line-height: 1.4;
  }
  
  .category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(108, 117, 125, 0.1);
    color: #000d50;
  }
  
  .download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: #6055cd;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .download-btn i {
    font-size: 1rem;
  }
  
  .download-btn:hover:not(:disabled) {
    background-color: #6055cd;
    color: #fff;
    border-color: #6055cd;
    transform: translateY(-1px);
  }
  
  .download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  /* Pagination Footer */
  .pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.02);
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .pagination-text {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
  }
  
  .page-size-select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    color: #000d50;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 80px;
  }
  
  .page-size-select:focus {
    outline: none;
    border-color: #6055cd;
    box-shadow: 0 0 0 2px rgba(96, 85, 205, 0.1);
  }
  
  .page-size-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  .pagination-info {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
  }
  
  .pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }
  
  .pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: #000d50;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 36px;
  }
  
  .pagination-btn i {
    font-size: 1rem;
  }
  
  .pagination-btn:hover:not(:disabled) {
    background-color: rgba(96, 85, 205, 0.1);
    border-color: #6055cd;
    color: #6055cd;
  }
  
  .pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  
  .pagination-page-info {
    font-size: 0.875rem;
    color: #000d50;
    padding: 0 12px;
    white-space: nowrap;
  }
  
  .pagination-btn-nav .pagination-btn-text {
    display: inline;
  }
  
  .pagination-btn-nav .pagination-btn-icon {
    display: none;
  }
  
  .pagination-btn-nav i {
    font-size: 0.875rem;
  }
  .form-group{
    margin-bottom: 0.4rem;
  }
  .table{
    margin-bottom: 0.4rem ;
  }
  
  /* Responsive Design */
  @media (max-width: 992px) {
    .sticky-header .header-content {
      padding: 0 12px;
    }
  
    .main-content {
      padding: 12px 0;
    }
  
    .table-container .data-table {
      min-width: 900px;
    }
  
    /* Hide less important columns on tablets
    .data-table .col-pan,
    .data-table .col-appno,
    .data-table .col-created {
      display: none;
    } */
  
    .pagination-footer {
      flex-direction: column;
      align-items: stretch;
      padding: 12px;
      gap: 12px;
    }
  
    .pagination-left {
      justify-content: center;
      width: 100%;
    }
  
    .pagination-info {
      text-align: center;
      width: 100%;
      order: 2;
    }
  
    .pagination-controls {
      justify-content: center;
      width: 100%;
      order: 3;
      gap: 6px;
    }
  
    .pagination-btn {
      padding: 10px 14px;
      min-width: 44px;
      font-size: 0.875rem;
    }
  
    .pagination-page-info {
      padding: 0 8px;
      font-size: 0.8125rem;
    }
  }
  
  @media (max-width: 768px) {
    .sticky-header .header-content {
      flex-direction: column;
      align-items: flex-start;
    }
  
    /* Switch to mobile card view */
    .table-wrapper {
      display: none;
    }
  
    .mobile-card-view {
      display: block;
      padding: 12px;
    }
  
    .table-container {
      padding: 0;
    }
  
    .mobile-card {
      margin-bottom: 10px;
    }
  
    .mobile-card-header {
      padding: 7px 8px;
      padding-bottom: 1px;
    }
  
    .mobile-card-ipo-name {
      font-size: 0.9375rem;
    }
  
    .mobile-card-body {
      padding: 7px 8px;
    }
  
    .mobile-card-info-item {
      min-width: 100px;
    }
  
    .mobile-card-grid {
      gap: 8px;
    }
  
    .mobile-card-grid-value {
      font-size: 0.8125rem;
    }
  
    .mobile-card-grid-item-highlight .mobile-card-grid-value {
      font-size: 0.875rem;
    }
  
    .pagination-footer {
      padding: 10px;
      gap: 10px;
    }
  
    .pagination-text {
      font-size: 0.8125rem;
    }
  
    .pagination-info {
      font-size: 0.8125rem;
    }
  
    .pagination-btn {
      padding: 10px 12px;
      min-width: 40px;
      font-size: 0.8125rem;
    }
  
    .pagination-btn-nav .pagination-btn-text {
      display: none;
    }
  
    .pagination-btn-nav .pagination-btn-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
  
    .pagination-page-info {
      padding: 0 6px;
      font-size: 0.75rem;
    }
  }
  
  @media (max-width: 576px) {
    .pagination-footer {
      padding: 8px;
      gap: 8px;
    }
  
    .pagination-left {
      flex-direction: column;
      gap: 6px;
      width: 100%;
    }
  
    .pagination-text {
      font-size: 0.75rem;
    }
  
    .pagination-info {
      font-size: 0.75rem;
    }
  
    .pagination-controls {
      gap: 4px;
    }
  
    .pagination-btn {
      padding: 8px 10px;
      min-width: 36px;
      font-size: 0.75rem;
    }
  
    .pagination-page-info {
      padding: 0 4px;
      font-size: 0.6875rem;
      display: none;
    }
    .form-group{
      margin-bottom: 0;
    }
    .table{
      margin-bottom: 0;
    }
  }

/* Toast placement: IPO Form page only (body.page-ipo-form) */
body.page-ipo-form #toast-container {
  top: auto !important;
  bottom: 1rem;
  right: auto !important;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(400px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

body.page-ipo-form #toast-container .toast {
  width: 100%;
  min-width: min(300px, calc(100vw - 2rem)) !important;
  max-width: min(400px, calc(100vw - 2rem)) !important;
}

/* -------------------------------------------------------------------------- */
/* Page-specific (moved from ipo-form.ejs inline <style>)                       */
/* -------------------------------------------------------------------------- */

#category-radio-group .category-chip {
  border: 1px solid #cfd7ff;
  color: #000d50;
  background: #ffffff;
  transition: all 0.2s ease;
}

#category-radio-group .category-chip:hover {
  border-color: #6055cd;
  background: #eef0ff;
  color: #1a1f73;
  transform: translateY(-1px);
}

#category-radio-group .btn-check:checked + .category-chip {
  background: #6055cd;
  border-color: #6055cd;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(96, 85, 205, 0.28);
}

.update-account-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  padding: 0.38rem 0.9rem;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid #d7dcff;
  background: linear-gradient(135deg, #ffffff 0%, #f3f5ff 100%);
  color: #2f3b8f;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 13, 80, 0.08);
}

.update-account-btn:hover {
  border-color: #6055cd;
  color: #ffffff;
  background: linear-gradient(135deg, #6055cd 0%, #4f46b8 100%);
  box-shadow: 0 8px 16px rgba(96, 85, 205, 0.28);
  transform: translateY(-1px);
}

.update-account-btn .btn-icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.ipo-form-login-gate {
  margin: 1.25rem auto 2rem;
  max-width: 480px;
  padding: 2rem 1.5rem 2.25rem;
  border-radius: 16px;
  border: 1px solid #d7dcff;
  background: linear-gradient(160deg, #ffffff 0%, #f3f5ff 100%);
  box-shadow: 0 8px 28px rgba(0, 13, 80, 0.08);
  text-align: center;
}

.ipo-form-login-gate__illu img {
  display: block;
  margin: 0 auto 1rem;
  max-width: 140px;
  height: auto;
}

.ipo-form-login-gate__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #000d50;
  margin-bottom: 0.5rem;
}

.ipo-form-login-gate__text {
  font-size: 0.95rem;
  color: #3d4a7a;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.ipo-form-login-gate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: #6055cd;
  box-shadow: 0 6px 16px rgba(96, 85, 205, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ipo-form-login-gate__btn:hover {
  background: #4f46b8;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(96, 85, 205, 0.4);
  color: #fff;
}

.ipo-form-download-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1080;
  align-items: center;
  justify-content: center;
  background: rgba(0, 13, 80, 0.42);
  backdrop-filter: blur(2px);
}

.ipo-form-download-overlay.is-active {
  display: flex;
}

.ipo-form-download-overlay__box {
  text-align: center;
  padding: 1.75rem 2rem;
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff 0%, #f3f5ff 100%);
  border: 1px solid #d7dcff;
  box-shadow: 0 12px 40px rgba(0, 13, 80, 0.18);
  min-width: 260px;
  max-width: 90vw;
}

.ipo-form-download-overlay__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px solid #e0e4ff;
  border-top-color: #6055cd;
  animation: ipo-form-download-spin 0.75s linear infinite;
}

.ipo-form-download-overlay__text {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #000d50;
}

@keyframes ipo-form-download-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   Dark Mode — IPO Form Page
   Scoped to body.ipoji-dark-mode (set when ?isDarkMode=true is passed).
   Dark tokens are self-contained here so no external CSS file dependency.
   ============================================================================ */

body.ipoji-dark-mode {
  /* ── Dark palette tokens (local to ipo-form.css) ── */
  --dm-bg:            #0D0E11;
  --dm-surface:       #121316;
  --dm-card:          #181A1F;
  --dm-chip:          #23262D;
  --dm-text-primary:  #E7E1E8;
  --dm-text-secondary:#BFC2CC;
  --dm-text-muted:    #8B9099;
  --dm-primary:       #B7AEFF;   /* accent / icons / highlights */
  --dm-primary-btn:   #6055CD;   /* button fills stay the same purple */
  --dm-border:        rgba(255, 255, 255, 0.12);
  --dm-success:       #7DDC81;
  --dm-warning:       #FFCF66;
  --dm-error:         #FFB4AB;
  --dm-shadow:        0 4px 12px rgba(0, 0, 0, 0.4);
}
body.ipoji-dark-mode{
  background-color: var(--dm-bg)!important;
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode.page-ipo-form {
  background-color: var(--dm-bg);
  color: var(--dm-text-primary);
}

/* ── Segmented control ─────────────────────────────────────────────────── */
/* .bg-white from Bootstrap uses !important; match specificity with the element */
body.ipoji-dark-mode .segmented-control,
body.ipoji-dark-mode .segmented-control.bg-white {
  background: var(--dm-card) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.ipoji-dark-mode .segment-item {
  color: var(--dm-text-secondary);
}

body.ipoji-dark-mode .segment-item.active {
  color: #fff;
}

body.ipoji-dark-mode .segment-highlight {
  background-color: var(--dm-primary-btn);
}

/* ── Page backgrounds ──────────────────────────────────────────────────── */
body.ipoji-dark-mode .bg-background {
  background-color: var(--dm-bg);
}

body.ipoji-dark-mode .sticky-header {
  background-color: var(--dm-bg);
  border-bottom-color: var(--dm-border);
}

/* ── Form card ─────────────────────────────────────────────────────────── */
/* Reset Bootstrap's card CSS variables */
body.ipoji-dark-mode .card {
  --bs-card-bg: var(--dm-card);
  --bs-card-border-color: var(--dm-border);
  --bs-card-color: var(--dm-text-primary);
  --bs-card-cap-bg: var(--dm-chip);
  background-color: var(--dm-card);
  border-color: var(--dm-border);
  color: var(--dm-text-primary);
  box-shadow: var(--dm-shadow);
}

body.ipoji-dark-mode .card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* Bootstrap utility overrides scoped to form create section */
body.ipoji-dark-mode .create-ipo-form .text-muted {
  color: var(--dm-text-muted) !important;
}

body.ipoji-dark-mode .create-ipo-form small.form-text {
  color: var(--dm-text-muted) !important;
}

/* ── Labels ────────────────────────────────────────────────────────────── */
body.ipoji-dark-mode .form-label-select {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .form-label-select i {
  color: var(--dm-primary);
}

body.ipoji-dark-mode .form-label-editable {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .form-label-editable i {
  color: var(--dm-primary);
}

body.ipoji-dark-mode .form-label-readonly {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .form-text {
  color: var(--dm-text-muted);
}

/* ── Select / Dropdown ─────────────────────────────────────────────────── */
body.ipoji-dark-mode .form-control-select {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .form-control-select:hover {
  border-color: var(--dm-primary);
  background-color: var(--dm-chip);
}

body.ipoji-dark-mode .form-control-select:focus {
  border-color: var(--dm-primary);
  background-color: var(--dm-surface);
  box-shadow: 0 0 0 0.2rem rgba(183, 174, 255, 0.15);
}

body.ipoji-dark-mode .form-control-select option {
  background-color: var(--dm-card);
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .select-arrow {
  color: var(--dm-primary);
}

/* ── Editable inputs ───────────────────────────────────────────────────── */
body.ipoji-dark-mode .form-control-editable {
  background-color: var(--dm-surface);
  border-color: var(--dm-primary);
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .form-control-editable:focus {
  background-color: var(--dm-surface);
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 0.2rem rgba(183, 174, 255, 0.2);
}

/* ── Readonly inputs ───────────────────────────────────────────────────── */
body.ipoji-dark-mode .form-control-readonly {
  background-color: var(--dm-chip);
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
}

body.ipoji-dark-mode .form-control-readonly:focus {
  background-color: var(--dm-chip);
  border-color: var(--dm-border);
}

body.ipoji-dark-mode .form-control-readonly-highlight {
  background-color: rgba(183, 174, 255, 0.1);
  border-color: rgba(183, 174, 255, 0.25);
  color: var(--dm-primary);
}

body.ipoji-dark-mode .form-control-readonly-icon {
  color: var(--dm-text-muted);
}

/* ── Form section divider ──────────────────────────────────────────────── */
body.ipoji-dark-mode .form-section-divider {
  border-bottom-color: rgba(183, 174, 255, 0.15);
}

body.ipoji-dark-mode .form-section-label {
  color: var(--dm-primary);
}

/* ── Category radio chips ──────────────────────────────────────────────── */
/* Beat Bootstrap's .bg-white { background-color: #fff !important } */
body.ipoji-dark-mode #category-radio-group,
body.ipoji-dark-mode #category-radio-group.bg-white {
  background: var(--dm-chip) !important;
}

body.ipoji-dark-mode #category-radio-group .category-chip {
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
  background: var(--dm-surface);
}

body.ipoji-dark-mode #category-radio-group .category-chip:hover {
  border-color: var(--dm-primary);
  background: rgba(183, 174, 255, 0.1);
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode #category-radio-group .btn-check:checked + .category-chip {
  background: var(--dm-primary-btn);
  border-color: var(--dm-primary-btn);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(183, 174, 255, 0.2);
}

/* ── Account table ─────────────────────────────────────────────────────── */

/* Wrapper */
body.ipoji-dark-mode .account-table-wrapper {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
}

/* Override Bootstrap 5's .table CSS-variable cascade.
   Bootstrap sets --bs-table-color / --bs-table-bg on the <table> element and
   those values flow into every td/th via the custom-property cascade.  We must
   reset them here at the same element level. */
body.ipoji-dark-mode .account-table {
  --bs-table-color:         var(--dm-text-primary);
  --bs-table-bg:            transparent;
  --bs-table-border-color:  var(--dm-border);
  --bs-table-striped-color: var(--dm-text-primary);
  --bs-table-striped-bg:    rgba(183, 174, 255, 0.03);
  --bs-table-active-color:  var(--dm-text-primary);
  --bs-table-active-bg:     rgba(183, 174, 255, 0.06);
  --bs-table-hover-color:   var(--dm-text-primary);
  --bs-table-hover-bg:      rgba(183, 174, 255, 0.06);
  color: var(--dm-text-primary);
  border-color: var(--dm-border);
}

/* Target every td/th directly — matches Bootstrap's own :not(caption)>*>* pattern */
body.ipoji-dark-mode .account-table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--dm-text-primary);
  border-bottom-color: var(--dm-border);
}

body.ipoji-dark-mode .account-table thead {
  background: linear-gradient(135deg, rgba(183, 174, 255, 0.08) 0%, rgba(183, 174, 255, 0.03) 100%);
}

body.ipoji-dark-mode .account-table-th,
body.ipoji-dark-mode .account-table-th-checkbox {
  color: var(--dm-primary) !important;
  border-bottom-color: rgba(183, 174, 255, 0.15) !important;
}

body.ipoji-dark-mode .account-table-row {
  border-bottom-color: var(--dm-border);
}

body.ipoji-dark-mode .account-table-row:hover > * {
  background-color: rgba(183, 174, 255, 0.05) !important;
}

body.ipoji-dark-mode .account-table-cell {
  color: var(--dm-text-primary) !important;
}

body.ipoji-dark-mode .account-name {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .account-pan {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .account-type-badge {
  background-color: rgba(183, 174, 255, 0.12);
  color: var(--dm-primary);
}

body.ipoji-dark-mode .account-bank-details-updated {
  background-color: rgba(125, 220, 129, 0.12);
  color: var(--dm-success);
  border-color: rgba(125, 220, 129, 0.2);
}

body.ipoji-dark-mode .account-bank-details-required {
  background-color: rgba(255, 207, 102, 0.12);
  color: var(--dm-warning);
  border-color: rgba(255, 207, 102, 0.22);
}

/* ── Custom checkbox ───────────────────────────────────────────────────── */
body.ipoji-dark-mode .account-checkbox-custom {
  background-color: var(--dm-chip);
  border-color: var(--dm-border);
}

body.ipoji-dark-mode .account-checkbox-wrapper:hover .account-checkbox-custom {
  border-color: var(--dm-primary);
  background-color: rgba(183, 174, 255, 0.08);
}

body.ipoji-dark-mode .account-checkbox:checked ~ .account-checkbox-custom {
  background-color: var(--dm-primary-btn);
  border-color:     var(--dm-primary-btn);
  box-shadow:       0 2px 6px rgba(183,174,255,.3);
}

body.ipoji-dark-mode .account-checkbox:focus ~ .account-checkbox-custom {
  box-shadow: 0 0 0 3px rgba(183,174,255,.22);
}

@media (max-width: 767.98px) {
  body.ipoji-dark-mode .account-table-checkbox-cell:has(.account-checkbox:checked) {
    background:       rgba(183,174,255,.1);
    border-left-color: rgba(183,174,255,.25);
  }
}

/* ── Account empty / login-required state ──────────────────────────────── */
body.ipoji-dark-mode .aes-icon-wrap {
  background: linear-gradient(135deg, rgba(183, 174, 255, 0.12), rgba(183, 174, 255, 0.06));
}

body.ipoji-dark-mode .aes-icon-wrap--warning {
  background: linear-gradient(135deg, rgba(255, 207, 102, 0.12), rgba(255, 207, 102, 0.06));
}

body.ipoji-dark-mode .aes-icon {
  color: var(--dm-primary);
}

body.ipoji-dark-mode .aes-icon-wrap--warning .aes-icon {
  color: var(--dm-warning);
}

body.ipoji-dark-mode .aes-title {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .aes-desc {
  color: var(--dm-text-muted);
}

/* ── Update account button ─────────────────────────────────────────────── */
body.ipoji-dark-mode .update-account-btn {
  border-color: var(--dm-border);
  background: linear-gradient(135deg, var(--dm-chip) 0%, var(--dm-surface) 100%);
  color: var(--dm-text-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.ipoji-dark-mode .update-account-btn:hover {
  border-color: var(--dm-primary-btn);
  color: #ffffff;
  background: linear-gradient(135deg, var(--dm-primary-btn) 0%, #4f46b8 100%);
  box-shadow: 0 8px 16px rgba(96, 85, 205, 0.35);
}

/* ── Search ────────────────────────────────────────────────────────────── */
body.ipoji-dark-mode .search-input {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .search-input::placeholder {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .search-input:focus {
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 3px rgba(183, 174, 255, 0.12);
}

body.ipoji-dark-mode .search-icon {
  color: var(--dm-text-muted);
}

/* ── Refresh button ────────────────────────────────────────────────────── */
body.ipoji-dark-mode .refresh-btn {
  border-color: var(--dm-primary);
  color: var(--dm-primary);
  background-color: transparent;
}

body.ipoji-dark-mode .refresh-btn:hover:not(:disabled) {
  background-color: var(--dm-primary-btn);
  color: #fff;
  border-color: var(--dm-primary-btn);
}

/* ── Loading state ─────────────────────────────────────────────────────── */
body.ipoji-dark-mode .loading-container {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .spinner {
  border-color: var(--dm-border);
  border-top-color: var(--dm-primary);
}

/* ── Error alert ───────────────────────────────────────────────────────── */
body.ipoji-dark-mode .error-alert {
  background-color: rgba(255, 180, 171, 0.1);
  color: var(--dm-error);
  border-color: rgba(255, 180, 171, 0.2);
}

/* ── Dashboard table container ─────────────────────────────────────────── */
body.ipoji-dark-mode .table-container {
  background-color: var(--dm-card);
  box-shadow: var(--dm-shadow);
}

body.ipoji-dark-mode .table-header {
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--dm-border);
}

body.ipoji-dark-mode .table-header .table-cell {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .table-row {
  border-bottom-color: var(--dm-border);
}

body.ipoji-dark-mode .table-row:hover {
  background-color: rgba(183, 174, 255, 0.04);
}

body.ipoji-dark-mode .table-cell {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .table-cell.text-primary {
  color: var(--dm-primary);
}

body.ipoji-dark-mode .table-cell.text-muted {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .ipo-name {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .category-badge {
  background-color: rgba(183, 174, 255, 0.1);
  color: var(--dm-text-secondary);
}

body.ipoji-dark-mode .download-btn {
  border-color: var(--dm-border);
  color: var(--dm-primary);
  background-color: transparent;
}

body.ipoji-dark-mode .download-btn:hover:not(:disabled) {
  background-color: var(--dm-primary-btn);
  color: #fff;
  border-color: var(--dm-primary-btn);
}

body.ipoji-dark-mode .empty-state-content {
  color: var(--dm-text-muted);
}

/* ── Table scrollbar ───────────────────────────────────────────────────── */
body.ipoji-dark-mode .table-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

body.ipoji-dark-mode .table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(183, 174, 255, 0.25);
}

body.ipoji-dark-mode .table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(183, 174, 255, 0.45);
}

/* ── Mobile cards ──────────────────────────────────────────────────────── */
body.ipoji-dark-mode .mobile-card-view {
  background: var(--dm-bg) !important;
}

body.ipoji-dark-mode .mobile-card {
  background-color: var(--dm-card);
  border-color: var(--dm-border);
  box-shadow: var(--dm-shadow);
}

body.ipoji-dark-mode .mobile-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.ipoji-dark-mode .mobile-card-header {
  background: linear-gradient(135deg, rgba(183, 174, 255, 0.05) 0%, rgba(183, 174, 255, 0.01) 100%);
  border-bottom-color: var(--dm-border);
}

body.ipoji-dark-mode .mobile-card-ipo-name {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .mobile-card-category-badge {
  background-color: rgba(183, 174, 255, 0.12);
  color: var(--dm-primary);
}

body.ipoji-dark-mode .mobile-card-download-btn {
  background-color: var(--dm-primary-btn);
}

body.ipoji-dark-mode .mobile-card-download-btn:hover:not(:disabled) {
  background-color: #4f46b8;
}

body.ipoji-dark-mode .mobile-card-info-label {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .mobile-card-info-value {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .mobile-card-grid-label {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .mobile-card-grid-value {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .mobile-card-grid-item-highlight {
  background-color: rgba(183, 174, 255, 0.08);
}

body.ipoji-dark-mode .mobile-card-grid-item-highlight .mobile-card-grid-value {
  color: var(--dm-primary);
}

body.ipoji-dark-mode .mobile-card-meta {
  border-top-color: var(--dm-border);
}

body.ipoji-dark-mode .mobile-card-meta-icon {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .mobile-card-meta-text {
  color: var(--dm-text-muted);
}

/* ── Pagination ────────────────────────────────────────────────────────── */
body.ipoji-dark-mode .pagination-footer {
  background-color: rgba(255, 255, 255, 0.02);
  border-top-color: var(--dm-border);
}

body.ipoji-dark-mode .pagination-text {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .page-size-select {
  background-color: var(--dm-surface);
  border-color: var(--dm-border);
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .page-size-select:focus {
  border-color: var(--dm-primary);
  box-shadow: 0 0 0 2px rgba(183, 174, 255, 0.12);
}

body.ipoji-dark-mode .pagination-info {
  color: var(--dm-text-muted);
}

body.ipoji-dark-mode .pagination-btn {
  border-color: var(--dm-border);
  color: var(--dm-text-secondary);
  background-color: transparent;
}

body.ipoji-dark-mode .pagination-btn:hover:not(:disabled) {
  background-color: rgba(183, 174, 255, 0.1);
  border-color: var(--dm-primary);
  color: var(--dm-primary);
}

body.ipoji-dark-mode .pagination-page-info {
  color: var(--dm-text-primary);
}

/* ── Login gate ────────────────────────────────────────────────────────── */
body.ipoji-dark-mode .ipo-form-login-gate {
  border-color: var(--dm-border);
  background: linear-gradient(160deg, var(--dm-card) 0%, var(--dm-surface) 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

body.ipoji-dark-mode .ipo-form-login-gate__title {
  color: var(--dm-text-primary);
}

body.ipoji-dark-mode .ipo-form-login-gate__text {
  color: var(--dm-text-secondary);
}

/* ── Download overlay ──────────────────────────────────────────────────── */
body.ipoji-dark-mode .ipo-form-download-overlay {
  background: rgba(0, 0, 0, 0.65);
}

body.ipoji-dark-mode .ipo-form-download-overlay__box {
  background: linear-gradient(160deg, var(--dm-card) 0%, var(--dm-surface) 100%);
  border-color: var(--dm-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body.ipoji-dark-mode .ipo-form-download-overlay__spinner {
  border-color: var(--dm-border);
  border-top-color: var(--dm-primary);
}

body.ipoji-dark-mode .ipo-form-download-overlay__text {
  color: var(--dm-text-primary);
}

/* ── Bank details modal (overrides inline styles) ──────────────────────── */
body.ipoji-dark-mode #selectAccountModal .modal-content {
  background-color: var(--dm-card) !important;
  border-color: var(--dm-border) !important;
}

body.ipoji-dark-mode #selectAccountModal .modal-header {
  background: linear-gradient(135deg, var(--dm-chip) 0%, var(--dm-card) 100%) !important;
  border-bottom-color: var(--dm-border) !important;
}

body.ipoji-dark-mode #selectAccountModal .modal-icon {
  background: var(--dm-surface) !important;
  color: var(--dm-primary) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

body.ipoji-dark-mode #selectAccountModal .modal-title {
  color: var(--dm-text-primary) !important;
}

body.ipoji-dark-mode #selectAccountModal .modal-body {
  background-color: var(--dm-card);
}

body.ipoji-dark-mode #selectAccountModal .text-muted {
  color: var(--dm-text-muted) !important;
}

body.ipoji-dark-mode #selectAccountModal .fa-info-circle {
  color: var(--dm-primary) !important;
}

body.ipoji-dark-mode #selectAccountModal [style*="border-top"] {
  border-top-color: var(--dm-border) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE — prevent horizontal page scroll
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  body.page-ipo-form {
    overflow-x: hidden;
  }

  body.page-ipo-form main.main-container {
    overflow-x: hidden;
    max-width: 100%;
  }

  .create-ipo-form,
  .create-ipo-form__inner,
  .create-ipo-form .card,
  .create-ipo-form .card-body,
  #ipo-form {
    max-width: 100%;
    overflow-x: hidden;
  }

  #ipo-form .row {
    --bs-gutter-x: 0.5rem;
    margin-left:  0;
    margin-right: 0;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE FORM — IPO select + account cards share one visual language
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  /* shared section labels (Select IPO + Select Account(s)) */
  #ipo-form .form-label-select {
    font-size:      .8125rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color:          #6055cd;
    margin-bottom:  8px;
  }

  #ipo-form .form-label-select i {
    font-size: .8rem;
    color:     #6055cd;
  }

  /* IPO select — styled like an account card row */
  .ipo-select-group {
    margin-bottom: 0;
  }

  .ipo-select-wrapper {
    position:      relative;
    border:        1px solid #e8e8f0;
    border-radius: 12px;
    background:    #fff;
    box-shadow:    0 1px 4px rgba(0, 0, 0, .06);
    overflow:      hidden;
    max-width:     100%;
    box-sizing:    border-box;
    transition:    background .15s, box-shadow .15s;
  }

  .ipo-select-wrapper:focus-within {
    background: rgba(96, 85, 205, .05);
    box-shadow: 0 1px 4px rgba(96, 85, 205, .12);
  }

  .ipo-select-wrapper .form-control-select {
    border:        none;
    border-radius: 0;
    min-height:    48px;
    padding:       12px 48px 12px 14px;
    font-size:     .9375rem;
    font-weight:   700;
    line-height:   1.2;
    color:         #14113a;
    background:    transparent;
    box-shadow:    none;
  }

  .ipo-select-wrapper .form-control-select:hover,
  .ipo-select-wrapper .form-control-select:focus {
    background:   transparent;
    border-color: transparent;
    box-shadow:   none;
    outline:      none;
  }

  /* right chevron strip — mirrors account-card checkbox strip */
  .ipo-select-wrapper .select-arrow {
    right:           0;
    top:             0;
    width:           48px;
    height:          100%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    border-left:     1px solid #ebebf5;
    border-radius:   0 12px 12px 0;
    background:      transparent;
    font-size:       .7rem;
    color:           #6055cd;
    transform:       none;
    transition:      background .15s;
  }

  .ipo-select-wrapper:focus-within .select-arrow {
    background: rgba(96, 85, 205, .04);
    transform:  none;
  }

  /* ── User input + calculated values — card system ─────────────────────── */
  #ipo-form .form-section-divider {
    margin:        14px 0 8px;
    padding:       0;
    border-bottom: none;
  }

  #ipo-form .form-section-label {
    font-size:      .8125rem;
    font-weight:    700;
    letter-spacing: .04em;
    color:          #6055cd;
  }

  #ipo-form .form-section-label i {
    font-size: .8rem;
  }

  .ipo-input-card {
    border:        1px solid #e8e8f0;
    border-radius: 12px;
    background:    #fff;
    box-shadow:    0 1px 4px rgba(0, 0, 0, .06);
    padding:       12px 14px;
    max-width:     100%;
    box-sizing:    border-box;
    transition:    background .15s, box-shadow .15s;
  }

  .ipo-input-card:focus-within {
    background: rgba(96, 85, 205, .05);
    box-shadow: 0 1px 4px rgba(96, 85, 205, .12);
  }

  #ipo-form .form-label-editable,
  #ipo-form .form-label-readonly {
    font-size:      .72rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color:          #8587a8;
    margin-bottom:  6px;
  }

  /* category chips */
  .ipo-category-card {
    margin-top: 0;
    gap:        8px;
  }

  #category-radio-group .category-chip {
    flex:          1 1 calc(33.333% - 6px);
    min-width:     0;
    max-width:     100%;
    margin:        0;
    padding:       10px 6px;
    font-size:     .8125rem;
    border-radius: 10px;
    border:        1px solid #e8e8f0;
    background:    #fff;
    box-shadow:    none;
    transform:     none;
  }

  #category-radio-group .category-chip:hover {
    transform:  none;
    background: rgba(96, 85, 205, .04);
  }

  #category-radio-group .btn-check:checked + .category-chip {
    background: #6055cd;
    border-color: #6055cd;
    box-shadow: 0 1px 4px rgba(96, 85, 205, .22);
  }

  #category-shareholder-option {
    flex: 1 1 calc(50% - 4px);
  }

  #category-shareholder-option .category-chip {
    width: 100%;
  }

  /* lots */
  .ipo-lots-card .form-control-editable {
    border:      none;
    background:  transparent;
    padding:     0;
    min-height:  auto;
    font-size:   1.125rem;
    font-weight: 700;
    color:       #14113a;
    box-shadow:  none;
  }

  .ipo-lots-card .form-control-editable:focus {
    border-color: transparent;
    box-shadow:   none;
    background:   transparent;
  }

  .ipo-lots-card .form-text {
    margin-top: 4px;
    font-size:  .68rem;
    color:      #9ca3af;
  }

  /* calculated value cards */
  .ipo-calc-card .form-control-readonly-wrapper {
    margin: 0;
  }

  .ipo-calc-card .form-control-editable,
  .ipo-calc-card .form-control-readonly {
    border:      none;
    background:  transparent;
    padding:     0;
    min-height:  auto;
    font-size:   .9375rem;
    font-weight: 700;
    color:       #14113a;
    box-shadow:  none;
  }

  .ipo-calc-card .form-control-editable:focus,
  .ipo-calc-card .form-control-readonly:focus {
    border-color: transparent;
    box-shadow:   none;
    background:   transparent;
  }

  .ipo-calc-card .form-control-readonly-icon {
    display: none;
  }

  /* readonly calc cards — muted, no edit focus ring, lock visible */
  .ipo-calc-card--readonly {
    background: #f9fafb;
  }

  .ipo-calc-card--readonly:focus-within {
    background: #f9fafb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  }

  .ipo-calc-card--readonly .form-control-readonly {
    cursor:       not-allowed;
    color:        #6b7280;
    font-weight:  600;
    padding-right: 1.25rem;
  }

  .ipo-calc-card--readonly .form-control-readonly-icon {
    display:  block;
    right:    0;
    top:      50%;
    font-size: .65rem;
    color:    #9ca3af;
  }

  .ipo-calc-card--total .form-control-readonly-highlight {
    background:  transparent;
    border:      none;
    color:       #6055cd;
    font-size:   1.0625rem;
    font-weight: 700;
    cursor:      not-allowed;
  }

  .ipo-calc-card--readonly.ipo-calc-card--total {
    background: rgba(96, 85, 205, .04);
  }

  .ipo-calc-card--readonly.ipo-calc-card--total:focus-within {
    background: rgba(96, 85, 205, .04);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  }

  .ipo-calc-card--readonly.ipo-calc-card--total .form-control-readonly-highlight {
    color: #6055cd;
  }

  .ipo-form-user-input {
    --bs-gutter-y: .5rem;
  }

  /* save button */
  .ipo-form-submit-wrap {
    margin-top: 12px !important;
  }

  #ipo-form #save-download-btn {
    width:         100%;
    min-height:    48px;
    border-radius: 12px;
    font-size:     .9375rem;
    box-shadow:    0 1px 4px rgba(96, 85, 205, .22);
  }
}

/* desktop: ipo-input-card is mobile-only — reset on larger screens */
@media (min-width: 768px) {
  #category-radio-group.ipo-category-card {
    margin-top:    .5rem;
    padding:       .5rem;
    background:    #fff;
    border-radius: .5rem;
  }

  .ipo-lots-card.ipo-input-card,
  .ipo-calc-card.ipo-input-card {
    border:     none;
    box-shadow: none;
    padding:    0;
    background: transparent;
  }
}

@media (max-width: 767.98px) {
  body.ipoji-dark-mode #ipo-form .form-label-select,
  body.ipoji-dark-mode #ipo-form .form-label-select i {
    color: var(--dm-primary);
  }

  body.ipoji-dark-mode .ipo-select-wrapper {
    background:   var(--dm-surface);
    border-color: var(--dm-border);
    box-shadow:   0 1px 4px rgba(0, 0, 0, .22);
  }

  body.ipoji-dark-mode .ipo-select-wrapper:focus-within {
    background: rgba(183, 174, 255, .07);
    box-shadow: 0 1px 4px rgba(183, 174, 255, .12);
  }

  body.ipoji-dark-mode .ipo-select-wrapper .form-control-select {
    color: var(--dm-text);
  }

  body.ipoji-dark-mode .ipo-select-wrapper .select-arrow {
    border-left-color: var(--dm-border);
    color:             var(--dm-primary);
  }

  body.ipoji-dark-mode .ipo-select-wrapper:focus-within .select-arrow {
    background: rgba(183, 174, 255, .06);
  }

  body.ipoji-dark-mode .ipo-input-card {
    background:   var(--dm-surface);
    border-color: var(--dm-border);
    box-shadow:   0 1px 4px rgba(0, 0, 0, .22);
  }

  body.ipoji-dark-mode .ipo-input-card:focus-within {
    background: rgba(183, 174, 255, .07);
    box-shadow: 0 1px 4px rgba(183, 174, 255, .12);
  }

  body.ipoji-dark-mode #ipo-form .form-section-label,
  body.ipoji-dark-mode #ipo-form .form-section-label i {
    color: var(--dm-primary);
  }

  body.ipoji-dark-mode #ipo-form .form-label-editable,
  body.ipoji-dark-mode #ipo-form .form-label-readonly {
    color: var(--dm-text-muted);
  }

  body.ipoji-dark-mode #category-radio-group .category-chip {
    background:   var(--dm-surface);
    border-color: var(--dm-border);
    color:        var(--dm-text);
  }

  body.ipoji-dark-mode #category-radio-group .btn-check:checked + .category-chip {
    background:   var(--dm-primary-btn);
    border-color: var(--dm-primary-btn);
  }

  body.ipoji-dark-mode .ipo-lots-card .form-control-editable,
  body.ipoji-dark-mode .ipo-calc-card .form-control-editable,
  body.ipoji-dark-mode .ipo-calc-card .form-control-readonly {
    color:            var(--dm-text);
    background-color: transparent;
  }

  body.ipoji-dark-mode .ipo-calc-card--readonly {
    background: rgba(255, 255, 255, .03);
  }

  body.ipoji-dark-mode .ipo-calc-card--readonly:focus-within {
    background: rgba(255, 255, 255, .03);
  }

  body.ipoji-dark-mode .ipo-calc-card--readonly .form-control-readonly {
    color: var(--dm-text-muted);
  }

  body.ipoji-dark-mode .ipo-calc-card--readonly.ipo-calc-card--total {
    background: rgba(183, 174, 255, .06);
  }

  body.ipoji-dark-mode .ipo-calc-card--readonly.ipo-calc-card--total:focus-within {
    background: rgba(183, 174, 255, .06);
  }

  body.ipoji-dark-mode .ipo-calc-card--total .form-control-readonly-highlight {
    color:            var(--dm-primary);
    background-color: transparent;
  }
}


/* ════════════════════════════════════════════════════════════════════════════
   ACCOUNT TABLE — mobile card layout (polished)
   Desktop (≥768px) : standard <table>, unchanged
   Mobile  (<768px) :
     [Name / PAN stacked]  [Type badge]      |  [☑ right strip]
                           [✓ Bank linked]
     (if missing)  [⚠ Bank not added pill]  [Update btn]
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

  /* account list — no horizontal scroll */
  .account-table-wrapper {
    overflow-x: hidden;
    overflow-y: visible;
    max-width:  100%;
    border:     none;
    background: transparent;
  }

  .account-table,
  .account-table tbody {
    display:    block;
    max-width:  100%;
    overflow-x: hidden;
  }
  .account-table thead { display: none; }

  /* ── Card ─────────────────────────────────────────────────────────────── */
  .account-table-row {
    display:       flex;
    flex-wrap:     wrap;
    align-items:   stretch;
    position:      relative;
    width:         100%;
    max-width:     100%;
    box-sizing:    border-box;
    padding:       8px 52px 8px 14px;
    border:        1px solid #e8e8f0;
    border-radius: 12px;
    margin-bottom: 8px;
    background:    #fff;
    box-shadow:    0 1px 4px rgba(0,0,0,.06);
    transform:     none !important;
    transition:    background .15s, box-shadow .15s;
    overflow:      hidden;
  }
  .account-table-row:active {
    background: rgba(96,85,205,.05);
    box-shadow: 0 1px 4px rgba(96,85,205,.12);
  }

  /* reset all cells — strip all table-cell padding/borders */
  .account-table-row td {
    display:        block;
    padding:        0 !important;
    margin:         0;
    border:         none;
    vertical-align: unset;
  }

  /* ── Checkbox strip: full height, pinned right ────────────────────────── */
  .account-table-checkbox-cell {
    position:        absolute;
    top: 0; right: 0;
    width:           48px;
    height:          100%;
    display:         flex;
    align-items:     center;
    justify-content: center;
    border-left:     1px solid #ebebf5;
    border-radius:   0 12px 12px 0;
    background:      transparent;
    transition:      background .15s;
  }
  /* label must fill the strip so the checkbox stays centred regardless of card height */
  .account-table-checkbox-cell .account-checkbox-wrapper {
    width:           100%;
    height:          100%;
    display:         flex;
    align-items:     center;
    justify-content: center;
  }
  /* highlight strip when checked */
  .account-table-checkbox-cell:has(.account-checkbox:checked) {
    background:        rgba(96,85,205,.07);
    border-left-color: rgba(96,85,205,.18);
  }
  .account-table-checkbox-cell .account-checkbox-custom {
    width:  24px;
    height: 24px;
    border-radius: 7px;
  }

  /* ══ COLUMN 1 (order 1): Name + PAN — full-width first row ═══════════════ */
  .acct-td-name {
    order:      1;
    flex:       1 1 100%;
    width:      100%;
    max-width:  100%;
    min-width:  0;
    box-sizing: border-box;
    align-self: flex-start;
    position:   relative;
    z-index:    1;
  }
  .acct-td-name .account-name {
    display:       block;
    font-size:     .9375rem;
    font-weight:   700;
    color:         #14113a;
    line-height:   1.2;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
  }
  .acct-pan-text {
    font-size:      .73rem;
    color:          #8587a8;
    letter-spacing: .03em;
  }

  /* PAN + type badge on one compact meta line (mobile only) */
  .acct-pan-meta {
    display:     flex !important;
    align-items: center;
    gap:         8px;
    margin-top:  4px;
    min-width:   0;
    width:       100%;
  }

  .acct-pan-meta .acct-pan-text {
    flex:          0 1 auto;
    min-width:     0;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
  }

  .acct-pan-meta .acct-pan-type-badge {
    flex-shrink:     0;
    padding:         2px 8px;
    font-size:       .65rem;
    font-weight:     600;
    line-height:     1.25;
    border-radius:   6px;
    letter-spacing:  .02em;
    background:      rgba(96, 85, 205, .1);
    color:           #6055cd;
  }

  /* ══ COLUMN 2 (order 2): desktop type col — hidden on mobile ═══════════ */
  .acct-td-type {
    order:       2;
    flex:        0 0 auto;
    margin-left: 10px;
    align-self:  center;
  }

  /* zero-height line break before bank/action row */
  .account-table-row::after {
    content: '';
    flex:    1 1 100%;
    width:   0;
    height:  0;
    order:   2;
  }

  /* ══ LINE 2 (order 3): bank message / action ═══════════════════════════ */
  .acct-td-action {
    order:      3;
    flex:       1 1 100%;
    width:      100%;
    max-width:  100%;
    min-width:  0;
    box-sizing: border-box;
    margin-top: 0;
  }

  .acct-bank-msg {
    display:     inline-flex;
    align-items: center;
    gap:         5px;
    font-size:   .6875rem;
    color:       #92400e;
    line-height: 1.2;
    flex-wrap:   wrap;
    max-width:   100%;
    min-width:   0;
  }
  .acct-bank-msg-icon {
    color:       #d97706;
    font-size:   .6875rem;
    flex-shrink: 0;
  }

  /* bank-ok variant — green icon, normal text colour */
  .acct-bank-msg--ok         { color: #374151; }
  .acct-bank-msg-icon--ok    { color: #16a34a; }
  .acct-bank-name            { font-weight: 600; }
  .acct-bank-sep             { color: #9ca3af; font-size: .6rem; }
  .acct-bank-acno            { letter-spacing: .04em; color: #6b7280; }

  /* inline text-button — no background, just an underlined link feel */
  .acct-bank-msg-btn {
    background:      none;
    border:          none;
    padding:         0;
    font-size:       .6875rem;
    font-weight:     600;
    color:           #6055cd;
    cursor:          pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    line-height:     1.2;
  }
  .acct-bank-msg-btn:hover { color: #4a40a8; }

  /* ── Empty-state cell ──────────────────────────────────────────────────── */
  .account-table-empty { display: block; padding: 32px 16px !important; }
}

/* ── Dark mode overrides (mobile only) ─────────────────────────────────── */
@media (max-width: 767.98px) {
  body.ipoji-dark-mode .account-table-row {
    background:   var(--dm-surface);
    border-color: var(--dm-border);
    box-shadow:   0 1px 4px rgba(0,0,0,.22);
  }
  body.ipoji-dark-mode .account-table-row:active { background: rgba(183,174,255,.07); }
  body.ipoji-dark-mode .account-table-checkbox-cell {
    border-left-color: var(--dm-border);
    background:        rgba(183,174,255,.04);
  }
  body.ipoji-dark-mode .acct-td-name .account-name { color: var(--dm-text); }
  body.ipoji-dark-mode .acct-pan-text { color: var(--dm-text-muted); }
  body.ipoji-dark-mode .acct-pan-meta .acct-pan-type-badge {
    background: rgba(183, 174, 255, .12);
    color:      var(--dm-primary);
  }
  body.ipoji-dark-mode .acct-bank-msg            { color: #fbbf24; }
  body.ipoji-dark-mode .acct-bank-msg-icon       { color: #f59e0b; }
  body.ipoji-dark-mode .acct-bank-msg-btn        { color: var(--dm-primary); }
  body.ipoji-dark-mode .acct-bank-msg--ok        { color: var(--dm-text); }
  body.ipoji-dark-mode .acct-bank-msg-icon--ok   { color: #4ade80; }
  body.ipoji-dark-mode .acct-bank-acno           { color: var(--dm-text-muted); }
  body.ipoji-dark-mode .acct-bank-sep            { color: var(--dm-border); }
}

/* ============================================================================
   SEO / GEO / AEO content sections + H1  (self-contained; hidden for ?isApp)
   ============================================================================ */

/* Page heading (H1) */
.ipo-form-page-head {
  text-align: center;
  max-width: 820px;
  margin: 0 auto .5rem;
  padding: .25rem 0 .5rem;
}
.ipo-form-page-head__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000D50;
  line-height: 1.25;
  margin: 0 0 .4rem;
}
.ipo-form-page-head__sub {
  font-size: .95rem;
  color: #5b6070;
  margin: 0;
}
@media (min-width: 768px) {
  .ipo-form-page-head__title { font-size: 1.9rem; }
}

/* Breadcrumb pinned to the top of the page */
.ipo-form-breadcrumb-top {
  margin-bottom: .25rem;
}

/* Submit hint shown when no demat account is linked yet */
.ipo-form-submit-hint {
  margin: .6rem 0 0;
  font-size: .85rem;
  color: #6c7180;
}
.ipo-form-submit-hint i { color: #6055cd; margin-right: .35rem; }
body.ipoji-dark-mode .ipo-form-submit-hint   { color: var(--dm-text-muted); }
body.ipoji-dark-mode .ipo-form-submit-hint i { color: var(--dm-primary); }

/* Content wrapper */
.ipo-form-seo-content {
  margin-top: 1.75rem;
  padding: 1.75rem .5rem .5rem;
  border-top: 1px solid #e7e9fb;
}
.ipo-form-seo-inner {
  max-width: 820px;
  margin: 0 auto;
}
/* Desktop: keep the SEO content inside the tool column so it aligns under the
   form and fills the space beside the ad sidebar (which stays in column 2). */
@media (min-width: 992px) {
  body.page-ipo-form .ipo-form-seo-content {
    grid-column: 1;
    margin-top: 0;
  }
}
.ipo-form-seo-block { margin-bottom: 2.25rem; }
.ipo-form-seo-lead {
  font-size: 1rem;
  line-height: 1.7;
  color: #40455a;
  margin: 0;
}

/* How-it-works steps */
.ipo-form-steps {
  list-style: none;
  counter-reset: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .85rem;
}
.ipo-form-steps li {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: #f7f8ff;
  border: 1px solid #e7e9fb;
  border-radius: 12px;
  padding: .9rem 1rem;
  font-size: .95rem;
  line-height: 1.6;
  color: #40455a;
}
.ipo-form-steps__n {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6055cd;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Feature list */
.ipo-form-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .65rem;
}
.ipo-form-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font-size: .95rem;
  line-height: 1.6;
  color: #40455a;
}
.ipo-form-feature-list li i {
  color: #6055cd;
  margin-top: .2rem;
  width: 18px;
  text-align: center;
}

/* Category & limits table */
.ipo-form-cat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  border: 1px solid #e7e9fb;
  border-radius: 12px;
  overflow: hidden;
}
.ipo-form-cat-table thead th {
  background: #f1f3ff;
  color: #000D50;
  font-weight: 600;
  text-align: left;
  padding: .7rem .9rem;
}
.ipo-form-cat-table tbody td {
  padding: .7rem .9rem;
  border-top: 1px solid #eef0fb;
  color: #40455a;
  vertical-align: top;
}
.ipo-form-cat-table tbody tr:nth-child(even) td { background: #fafbff; }
.ipo-form-seo-note {
  margin: .9rem 0 0;
  font-size: .85rem;
  color: #6c7180;
}
.ipo-form-seo-note i { color: #6055cd; margin-right: .35rem; }

/* Current IPO form inventory */
.ipo-form-current-table-wrap {
  border: 1px solid #e7e9fb;
  border-radius: 12px;
}
.ipo-form-current-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.ipo-form-current-table th {
  background: #f1f3ff;
  color: #000D50;
  font-weight: 600;
  text-align: left;
  padding: .75rem .85rem;
  white-space: nowrap;
}
.ipo-form-current-table td {
  padding: .8rem .85rem;
  border-top: 1px solid #eef0fb;
  color: #40455a;
  vertical-align: middle;
}
.ipo-form-current-table tbody tr:nth-child(even) td { background: #fafbff; }
.ipo-form-current-name {
  display: block;
  color: #000D50;
  font-weight: 700;
  text-decoration: none;
}
.ipo-form-current-name:hover { color: #6055cd; text-decoration: underline; }
.ipo-form-current-price,
.ipo-form-current-exchange {
  display: block;
  margin-top: .2rem;
  color: #6c7180;
  font-size: .8rem;
}
.ipo-form-current-type {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #eef0ff;
  color: #5147b5;
  font-size: .78rem;
  font-weight: 700;
}
.ipo-form-current-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  padding: .5rem .7rem;
  border-radius: 8px;
  background: #6055cd;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.ipo-form-current-cta:hover { background: #4f45b8; color: #fff; }
.ipo-form-current-empty {
  padding: 1rem;
  border: 1px solid #e7e9fb;
  border-radius: 12px;
  background: #f7f8ff;
}
.ipo-form-current-empty p { margin: 0 0 .65rem; color: #40455a; }
.ipo-form-current-empty a,
.ipo-form-official-note a { color: #5147b5; font-weight: 600; }
.ipo-form-current-empty a + a { margin-left: 1rem; }
.ipo-form-official-note {
  margin: .8rem 0 0;
  color: #5b6070;
  font-size: .84rem;
  line-height: 1.6;
}
.ipo-form-trust-note {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid #dfe3f6;
  border-left: 4px solid #6055cd;
  border-radius: 10px;
  background: #f8f9ff;
  color: #4d5266;
  font-size: .84rem;
  line-height: 1.6;
}
.ipo-form-trust-note p { margin: 0; }
.ipo-form-trust-note p + p { margin-top: .35rem; }

@media (max-width: 767.98px) {
  .ipo-form-current-table { min-width: 680px; }
  .ipo-form-current-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ipo-form-current-empty a {
    display: block;
    width: fit-content;
  }
  .ipo-form-current-empty a + a { margin: .35rem 0 0; }
}

/* Improved logged-in empty state (rendered by ipo-form.js) */
.ipo-form-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  max-width: 360px;
  margin: 0 auto;
}
.ipo-form-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #eef0ff;
  color: #6055cd;
  font-size: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.ipo-form-empty__icon--muted { background: #f1f2f6; color: #9aa0af; }
.ipo-form-empty__title {
  font-weight: 600;
  color: #22263a;
  margin: 0 0 .35rem;
}
.ipo-form-empty__desc {
  font-size: .9rem;
  color: #6c7180;
  margin: 0 0 1.1rem;
}
.ipo-form-empty__cta {
  border: none;
  background: #6055cd;
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s ease;
}
.ipo-form-empty__cta:hover { background: #4f45b8; }

/* ── Dark mode overrides ── */
body.ipoji-dark-mode .ipo-form-seo-content       { border-top-color: var(--dm-border); }
body.ipoji-dark-mode .ipo-form-page-head__title { color: var(--dm-text-primary); }
body.ipoji-dark-mode .ipo-form-page-head__sub   { color: var(--dm-text-secondary); }
body.ipoji-dark-mode .ipo-form-seo-lead,
body.ipoji-dark-mode .ipo-form-steps li,
body.ipoji-dark-mode .ipo-form-feature-list li  { color: var(--dm-text-secondary); }
body.ipoji-dark-mode .ipo-form-steps li {
  background: var(--dm-card);
  border-color: var(--dm-border);
}
body.ipoji-dark-mode .ipo-form-steps__n         { background: var(--dm-primary-btn); }
body.ipoji-dark-mode .ipo-form-feature-list li i,
body.ipoji-dark-mode .ipo-form-seo-note i        { color: var(--dm-primary); }
body.ipoji-dark-mode .ipo-form-cat-table {
  border-color: var(--dm-border);
}
body.ipoji-dark-mode .ipo-form-cat-table thead th {
  background: var(--dm-chip);
  color: var(--dm-text-primary);
}
body.ipoji-dark-mode .ipo-form-cat-table tbody td {
  color: var(--dm-text-secondary);
  border-top-color: var(--dm-border);
}
body.ipoji-dark-mode .ipo-form-cat-table tbody tr:nth-child(even) td { background: var(--dm-surface); }
body.ipoji-dark-mode .ipo-form-seo-note          { color: var(--dm-text-muted); }
body.ipoji-dark-mode .ipo-form-current-table-wrap,
body.ipoji-dark-mode .ipo-form-current-table td  { border-color: var(--dm-border); }
body.ipoji-dark-mode .ipo-form-current-table th  { background: var(--dm-chip); color: var(--dm-text-primary); }
body.ipoji-dark-mode .ipo-form-current-table td  { color: var(--dm-text-secondary); }
body.ipoji-dark-mode .ipo-form-current-table tbody tr:nth-child(even) td { background: var(--dm-surface); }
body.ipoji-dark-mode .ipo-form-current-name       { color: var(--dm-text-primary); }
body.ipoji-dark-mode .ipo-form-current-price,
body.ipoji-dark-mode .ipo-form-current-exchange,
body.ipoji-dark-mode .ipo-form-official-note      { color: var(--dm-text-muted); }
body.ipoji-dark-mode .ipo-form-current-type       { background: var(--dm-chip); color: var(--dm-primary); }
body.ipoji-dark-mode .ipo-form-current-empty,
body.ipoji-dark-mode .ipo-form-trust-note         { background: var(--dm-card); border-color: var(--dm-border); color: var(--dm-text-secondary); }
body.ipoji-dark-mode .ipo-form-current-empty p    { color: var(--dm-text-secondary); }
body.ipoji-dark-mode .ipo-form-empty__icon       { background: var(--dm-chip); color: var(--dm-primary); }
body.ipoji-dark-mode .ipo-form-empty__icon--muted{ background: var(--dm-chip); color: var(--dm-text-muted); }
body.ipoji-dark-mode .ipo-form-empty__title      { color: var(--dm-text-primary); }
body.ipoji-dark-mode .ipo-form-empty__desc       { color: var(--dm-text-muted); }
