/* ============================================
   3i Fund Portal — Global Styles
   Dark mode, electric blue accents
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-modal: #141c2e;
    --border-blue: #269edf;
    --border-blue-dim: rgba(38, 158, 223, 0.3);
    --text-primary: #e8ecf1;
    --text-secondary: #8892a4;
    --text-muted: #5a6478;
    --accent-blue: #269edf;
    --accent-blue-hover: #5FC4F5;
    --badge-green: #22c55e;
    --badge-orange: #f59e0b;
    --badge-red: #ef4444;
    --badge-grey: #4b5563;
    --input-bg: #0f1623;
    --input-border: #2a3548;
    --input-focus: #269edf;
    --font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: 6px;
    --transition-speed: 0.2s;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-blue-hover);
}

/* ============================================
   Layout
   ============================================ */

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   Top Navigation Bar
   ============================================ */

.navbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-blue);
    gap: 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.navbar-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.navbar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    min-width: 0;
}

.navbar-company {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.02em;
    margin-right: 0.5rem;
}

.navbar-logout {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-blue-dim);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-logout:hover {
    color: var(--text-primary);
    border-color: var(--border-blue);
}

/* ============================================
   Login Page
   ============================================ */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-blue);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-error {
    display: none;
    padding: 0.6rem 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: var(--badge-red);
    font-size: 0.85rem;
    text-align: left;
}

.login-error.visible {
    display: block;
}

/* ============================================
   Form Elements
   ============================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}

.form-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    padding: 0.7rem 0.9rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: border-color var(--transition-speed);
}

.form-input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-family: var(--font-family);
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--input-border);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-blue-dim);
}

/* ============================================
   Cards
   ============================================ */

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-blue-dim);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color var(--transition-speed);
}

.card:hover {
    border-color: var(--border-blue);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   Dashboard — ELOC List
   ============================================ */

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.eloc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 1rem;
}

.eloc-card {
    cursor: default;
}

.eloc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.eloc-card-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    background-color: rgba(30, 144, 255, 0.15);
    color: var(--accent-blue);
    font-weight: 500;
}

.eloc-card-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-weight: 500;
}

.eloc-card-status.active {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--badge-green);
}

.eloc-card-status.completed {
    background-color: rgba(75, 85, 99, 0.3);
    color: var(--text-secondary);
}

.eloc-card-status.rejected {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--badge-red);
}

.eloc-card-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.eloc-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ============================================
   Dashboard — Real-Time Quote Bar
   ============================================ */

.quote-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-blue-dim);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.quote-symbol {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.03em;
}

.quote-fields {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.quote-field {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.quote-field strong {
    color: var(--text-primary);
    font-weight: 600;
}

.quote-price {
    color: #4caf50;
    font-weight: 700;
}

.quote-size {
    color: #f0a030;
    font-weight: 400;
    font-size: 0.75rem;
    margin: 0 0.4rem;
}

/* ============================================
   Dashboard — Period Rows in ELOC Cards
   ============================================ */

.card-periods {
    margin-top: 0;
}

.period-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(42, 53, 72, 0.3);
}

.period-row:last-child {
    border-bottom: none;
}

.period-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 70px;
}

.period-data {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    text-align: center;
}

.period-data.has-data {
    color: var(--badge-green);
    font-weight: 500;
}

.period-data.outside-window {
    color: var(--badge-orange);
    font-style: italic;
    font-size: 0.8rem;
}

.period-data.pending-eloc {
    color: var(--accent-blue);
    font-style: italic;
    font-size: 0.8rem;
}

.period-btn {
    font-size: 0.77rem;
    padding: 0.4rem 2rem;
    margin-left: 2.5rem;
    border: 1px solid #a85800;
    border-radius: 4px;
    background: #a85800;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    transition: opacity 0.2s;
}

.period-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.period-btn:disabled {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-blue-dim);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ============================================
   Dashboard — Section Divider & Currently Pricing
   ============================================ */

.section-divider {
    border: none;
    border-top: 1px solid var(--border-blue-dim);
    margin: 2rem 0 1rem;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.none-placeholder {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* ============================================
   Tabs (Active ELOCs / Action Items)
   ============================================ */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--input-border);
}

.tab {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all var(--transition-speed);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab.has-actions {
    animation: flash-red 1.5s ease-in-out infinite;
}

.tab.has-actions.active {
    animation: none;
    color: var(--badge-red);
    border-bottom-color: var(--badge-red);
}

@keyframes flash-red {
    0%, 100% { color: var(--text-secondary); }
    50% { color: var(--badge-red); }
}

/* ============================================
   Action Item Cards
   ============================================ */

.action-item-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--badge-red);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-item-type {
    font-weight: 600;
    color: var(--badge-red);
    font-size: 0.95rem;
}

.action-item-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.action-item-details {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-item-symbol {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.action-item-eloc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.action-item-pricing {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.action-item-btn {
    align-self: flex-end;
    margin-top: 0.25rem;
}

/* ============================================
   ELOC Detail — Pricing Table
   ============================================ */

.eloc-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-speed);
}

.back-link:hover {
    color: var(--accent-blue);
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.pricing-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--input-border);
    font-weight: 500;
}

.pricing-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(42, 53, 72, 0.5);
    font-size: 0.95rem;
}

.pricing-table tbody tr:hover {
    background-color: rgba(30, 144, 255, 0.05);
}

.shares-link {
    color: var(--accent-blue);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.shares-link:hover {
    color: var(--accent-blue-hover);
}

/* ============================================
   Workflow Badges
   ============================================ */

.workflow-container {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-blue-dim);
    border-radius: 8px;
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.workflow-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workflow-remove-btn {
    font-size: 0.75rem;
    padding: 0.3rem 1rem;
    border: 1px solid var(--badge-red);
    background: transparent;
    color: var(--badge-red);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.workflow-remove-btn:hover:not(:disabled) {
    background: var(--badge-red);
    color: #ffffff;
}

.workflow-remove-btn:disabled {
    border-color: var(--badge-grey);
    color: var(--badge-grey);
    cursor: not-allowed;
    opacity: 0.5;
}

.workflow-steps {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 130px;
    position: relative;
}

.workflow-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.workflow-badge.awaiting {
    background-color: var(--badge-grey);
    color: #9ca3af;
}

.workflow-badge.pending {
    background-color: var(--badge-orange);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.workflow-badge.completed {
    background-color: var(--badge-green);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.workflow-badge.rejected {
    background-color: var(--badge-red);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.workflow-label {
    font-size: 0.72rem;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.3;
    max-width: 120px;
}

.workflow-step.completed .workflow-label {
    color: var(--text-primary);
}

.workflow-datetime {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-align: center;
}

/* Scheduled VWAP calculation time — shown below FinalVwapPricingCalculated step.
   Matches PRM's display (cyan #4FC3F7, small, centered).
   Only rendered when the backend returns step.scheduled_at on this step. */
.workflow-scheduled {
    font-size: 0.65rem;
    color: #4FC3F7;
    font-weight: 600;
    margin-top: 0.25rem;
    text-align: center;
    max-width: 120px;
}

.workflow-step.has-document .workflow-badge,
.workflow-step.clickable .workflow-badge {
    cursor: pointer;
}

.workflow-step.has-document .workflow-badge:hover,
.workflow-step.clickable .workflow-badge:hover {
    transform: scale(1.1);
}

.workflow-step.clickable .workflow-label {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

/* Connector lines between badges */
.workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 22px);
    width: calc(100% - 44px);
    height: 2px;
    background-color: var(--badge-grey);
}

.workflow-step.completed:not(:last-child)::after {
    background-color: var(--badge-green);
}

.workflow-step.pending:not(:last-child)::after {
    background-color: var(--badge-orange);
}

.workflow-step.rejected:not(:last-child)::after {
    background-color: var(--badge-red);
}

/* ============================================
   Purchase Notice Modal
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-modal);
    border: 1px solid var(--border-blue);
    border-radius: 8px;
    padding: 2rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.modal-info-label {
    color: var(--text-secondary);
}

.modal-info-value {
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-status {
    display: none;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    text-align: center;
}

.modal-status.sending {
    display: block;
    background-color: rgba(30, 144, 255, 0.1);
    border: 1px solid rgba(30, 144, 255, 0.3);
    color: var(--accent-blue);
}

.modal-status.success {
    display: block;
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--badge-green);
}

.modal-status.error {
    display: block;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--badge-red);
}

/* ============================================
   Password Toggle
   ============================================ */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    flex: 1;
    padding-right: 3.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color var(--transition-speed);
}

.password-toggle:hover {
    color: var(--accent-blue);
}

/* Hide number input spinner arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================
   Signatory Signature
   ============================================ */

.sig-preview {
    background-color: #ffffff;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.sig-preview img {
    max-width: 100%;
    max-height: 80px;
}

.sig-preview-empty {
    color: #999;
    font-size: 0.85rem;
    margin: 0;
}

.sig-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.sig-thumbnail {
    max-height: 30px;
    margin-top: 0.25rem;
    display: block;
    background-color: #ffffff;
    padding: 2px 4px;
    border-radius: 3px;
}

.pn-signature-img {
    max-height: 60px;
    max-width: 300px;
    background-color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
}

/* ============================================
   Document Viewer Modal
   ============================================ */

.doc-viewer-modal {
    max-width: 700px;
}

.doc-viewer-content {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* ============================================
   Admin Page
   ============================================ */

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--input-border);
    font-weight: 500;
}

.admin-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(42, 53, 72, 0.5);
    font-size: 0.9rem;
}

.admin-table tbody tr:hover {
    background-color: rgba(30, 144, 255, 0.05);
}

/* Admin action buttons (inline in table rows) */
.btn-action {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    margin-right: 0.3rem;
    border: 1px solid var(--border-blue-dim);
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--accent-blue);
    cursor: pointer;
    font-family: var(--font-family);
    transition: all var(--transition-speed);
}

.btn-action:hover {
    background: var(--accent-blue);
    color: #ffffff;
}

/* ============================================
   Loading & Empty States
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-blue-dim);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .workflow-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .workflow-step {
        flex-direction: row;
        gap: 0.75rem;
        min-width: unset;
    }

    .workflow-step:not(:last-child)::after {
        display: none;
    }

    .eloc-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 1rem;
    }
}

/* ============================================
   Purchase Notice Document
   ============================================ */

/* ============================================
   Dashboard — Signatory Warning
   ============================================ */

.signatory-warning {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: var(--badge-red);
    font-size: 0.9rem;
}

/* ============================================
   Purchase Notice Document
   ============================================ */

.pn-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.pn-error {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

.pn-error .btn {
    margin-top: 1.5rem;
}

.pn-document {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border-blue-dim);
    border-radius: var(--border-radius);
    padding: 2.5rem;
}

.pn-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin: 1.5rem 0;
    letter-spacing: 0.05em;
}

.pn-section {
    margin-bottom: 1.5rem;
}

.pn-header-block {
    border-bottom: 1px solid var(--border-blue-dim);
    padding-bottom: 1rem;
}

.pn-field-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.pn-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 5rem;
    flex-shrink: 0;
}

.pn-value {
    color: var(--text-primary);
}

.pn-body-text {
    white-space: pre-wrap;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.pn-fields-table {
    width: 100%;
    border-collapse: collapse;
}

.pn-fields-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pn-field-label {
    font-weight: 600;
    color: var(--text-secondary);
    width: 200px;
}

.pn-field-value {
    color: var(--text-primary);
}

.pn-signature-block,
.pn-accepted-block {
    border-top: 1px solid var(--border-blue-dim);
    padding-top: 1.25rem;
}

.pn-block-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 0.75rem;
}

.pn-entity-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.pn-signature-line {
    flex: none;
    width: 33%;
    min-width: 120px;
    border-bottom: 1px solid var(--text-secondary);
    height: 1.2em;
}

.pn-signatory-select-row {
    margin-bottom: 0.75rem;
}

.pn-select {
    flex: 1;
    max-width: 350px;
}

.pn-dated-line {
    border-top: 1px solid var(--border-blue-dim);
    padding-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.pn-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-blue-dim);
}

/* Print styles for purchase notice */
@media print {
    .navbar,
    .pn-actions,
    .pn-signatory-select-row {
        display: none !important;
    }

    body {
        background: white;
        color: #000;
    }

    .pn-document {
        background: white;
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 1.5rem;
        max-width: 100%;
    }

    .pn-title {
        color: #000;
    }

    .pn-block-title {
        color: #333;
    }

    .pn-label {
        color: #555;
    }

    .pn-field-label {
        color: #555;
    }

    .pn-value,
    .pn-field-value,
    .pn-body-text,
    .pn-entity-name {
        color: #000;
    }

    .pn-fields-table td {
        border-bottom-color: #ccc;
    }

    .pn-signature-block,
    .pn-accepted-block,
    .pn-dated-line,
    .pn-header-block {
        border-color: #ccc;
    }

    .pn-signature-line {
        border-bottom-color: #000;
    }
}

/* ============================================
   Purchase Notice — Confirmation Modal
   ============================================ */

.pn-confirm-modal {
    max-width: 640px;
}

.pn-confirm-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.pn-confirm-scroll h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin: 1.25rem 0 0.4rem;
}

.pn-confirm-scroll p {
    margin-bottom: 0.5rem;
}

.pn-confirm-warning {
    text-align: center;
    font-weight: 700;
    color: var(--badge-red);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}

.pn-confirm-terms {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1rem;
}

.pn-confirm-terms td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.88rem;
}

.pn-confirm-terms td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    width: 160px;
}

.pn-confirm-list {
    margin: 0.5rem 0 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.pn-confirm-list li {
    margin-bottom: 0.35rem;
}

.pn-confirm-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
    cursor: pointer;
}

.pn-confirm-checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-danger {
    background-color: var(--badge-red);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-accept {
    background-color: var(--badge-green);
    color: #ffffff;
}

.btn-accept:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-accept:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
