/* ========================================
   VPO M&A Connect - Global Design System
   ======================================== */

/* CSS Variables */
:root {
    --bg: #0a0a0f;
    --bg-card: #111118;
    --bg-card-hover: #16161f;
    --bg-input: #0d0d14;
    --border: #1e1e2a;
    --border-hover: #2a2a3a;
    --border-focus: #2563eb;
    --text: #e8e8e8;
    --text-muted: #888;
    --text-dim: #555;
    --accent: #d4a84a;
    --accent-hover: #c89b3e;
    --accent-dim: rgba(212, 168, 74, 0.12);
    --accent-border: rgba(212, 168, 74, 0.3);
    --gold: #d4a84a;
    --gold-dim: rgba(212, 168, 74, 0.12);
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.12);
    --info: #06b6d4;
    --info-dim: rgba(6, 182, 212, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --transition: 0.2s ease;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* ========== Header ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--accent);
    text-decoration: none;
}

.header-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.header-user:hover {
    background: var(--bg-card);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #b8860b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.header-username {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.header-role-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.role-entrepreneur {
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid rgba(212, 168, 74, 0.3);
}

.role-fbc {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.role-boutique {
    background: var(--info-dim);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Notification bell */
.notif-bell {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all var(--transition);
}

.notif-bell:hover {
    color: var(--text);
    background: var(--bg-card);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    background: var(--danger);
    color: #fff;
    border-radius: 8px;
    padding: 0 4px;
}

/* ========== Page Layout ========== */
.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ========== Cards ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ========== Deal Cards ========== */
.deal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.deal-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.08);
}

.deal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.deal-number {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.deal-industry {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.deal-summary {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.deal-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-dim);
}

.deal-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

/* ========== Status Badge ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.status-draft {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.status-under_review {
    background: var(--warning-dim);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-revised {
    background: var(--info-dim);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.status-published {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-unpublished {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.status-closed_deal {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 168, 74, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-dim);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

.form-error {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
}

.field-feedback {
    margin-top: 6px;
    padding: 8px 12px;
    background: var(--warning-dim);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--warning);
}

/* ========== Step Form ========== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    gap: 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-dim);
    transition: all var(--transition);
}

.step-item.active .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.step-item.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
}

.step-item.active .step-label {
    color: var(--accent);
}

.step-item.completed .step-label {
    color: var(--success);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
}

.step-line.completed {
    background: var(--success);
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Tables ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid rgba(30, 30, 42, 0.5);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ========== Grid ========== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ========== Stats ========== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-change {
    font-size: 11px;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--success);
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: var(--success-dim);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.toast-error {
    background: var(--danger-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.toast-info {
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== Empty state ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 13px;
    margin-bottom: 24px;
}

/* ========== Loading ========== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========== Modal ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ========== Feedback panel ========== */
.feedback-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.feedback-reviewer {
    font-size: 13px;
    font-weight: 600;
}

.feedback-date {
    font-size: 11px;
    color: var(--text-dim);
}

.feedback-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .page-container {
        padding: 20px 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .site-header {
        padding: 0 16px;
        height: 56px;
    }

    .step-indicator {
        flex-wrap: wrap;
    }

    .step-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-username {
        display: none;
    }

    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}