/* ============================================================
   RAKAN AL-SAFFA AL-MATMIZ — DESIGN SYSTEM
   "The Precision Concierge"
   ============================================================ */

/* --- Base & Typography --- */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f7f9fc;
    color: #191c1e;
}

.en-text {
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

/* --- Scrollbars (subtle) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e6e8eb; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #485f82; }

/* --- Tonal Tables (No-Line Rule from DESIGN.md) --- */
table.tonal-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}
table.tonal-table td {
    padding: 14px 16px;
    background: #ffffff;
}
table.tonal-table tr:hover td {
    background: #fafbfd;
}
table.tonal-table td:first-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}
table.tonal-table td:last-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}
table.tonal-table th {
    padding: 0 16px 8px;
    font-weight: 600;
    color: #485f82;
    font-size: 12px;
}

/* --- Form Inputs (Filled Container Style) --- */
.form-input {
    background-color: #f2f4f7;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.form-input:focus {
    background-color: #ffffff;
    border-color: #006e2b;
    box-shadow: 0 4px 6px -1px rgba(0, 110, 43, 0.1);
    outline: none;
}

/* --- Wizard Step Content --- */
.step-content { display: none !important; }
.step-content.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

/* --- View Section Animations (SPA Transition) ---
   Important: Tailwind utility classes like flex-col can win specificity battles.
   We force display via !important to guarantee only the active view shows. */
.view-section {
    display: none !important;
}
.view-section.active {
    display: flex !important;
    animation: fadeIn 0.4s ease;
}

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

/* --- Sidebar Active States --- */
.sidebar-link .active-bar { display: none; }
.sidebar-link.active .active-bar { display: block; }
.sidebar-link.active .bg-overlay { background-color: rgba(255,255,255,0.1); }

/* --- Deal Type Cards Active Borders --- */
.card-active-company {
    border-color: #006e2b !important;
    opacity: 1 !important;
}
.card-active-partnership {
    border-color: #225eab !important;
    opacity: 1 !important;
}
.card-active-investor {
    border-color: #9333ea !important;
    opacity: 1 !important;
}
.card-active-brokerage {
    border-color: #f97316 !important;
    opacity: 1 !important;
}

/* --- Premium Shadows (Tinted Navy, Tonal) --- */
.shadow-premium {
    box-shadow: 0 15px 35px -5px rgba(72, 95, 130, 0.05);
}
.shadow-premium-hover {
    box-shadow: 0 20px 40px -5px rgba(72, 95, 130, 0.08);
}

/* --- Cost Category Badges --- */
.badge-purchase {
    background-color: #dbeafe;
    color: #1e40af;
}
.badge-transport {
    background-color: #cffafe;
    color: #155e75;
}
.badge-repair {
    background-color: #ffedd5;
    color: #c2410c;
}
.badge-preparation {
    background-color: #f3e8ff;
    color: #6b21a8;
}
.badge-other {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* --- Stepper Indicator States --- */
.step-indicator {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}
.step-indicator.pending {
    background-color: #e6e8eb;
    color: #9ca3af;
}
.step-indicator.active {
    background-color: #006e2b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 110, 43, 0.3);
    transform: scale(1.1);
}
.step-indicator.completed {
    background-color: #006e2b;
    color: #ffffff;
}
.step-indicator.completed::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.step-indicator.completed .step-num { display: none; }

/* --- Profit Preview Hero Card --- */
.profit-hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfd 100%);
    border-top: 4px solid #225eab;
    box-shadow: 0 20px 60px -10px rgba(34, 94, 171, 0.12);
}

.profit-hero-card.deal-company { border-top-color: #006e2b; }
.profit-hero-card.deal-partnership { border-top-color: #225eab; }
.profit-hero-card.deal-investor { border-top-color: #9333ea; }
.profit-hero-card.deal-brokerage { border-top-color: #f97316; }

/* --- Calculation Numbers (Display Sizes) --- */
.calc-number {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.calc-number-sm { font-size: 1.5rem; }
.calc-number-md { font-size: 1.875rem; }
.calc-number-lg { font-size: 2.5rem; }
.calc-number-xl { font-size: 3rem; }

/* --- Live Pulse Indicator --- */
.live-pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* --- Distribution Tile --- */
.dist-tile {
    background: #f7f9fc;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
}
.dist-tile-company {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.dist-tile-partner {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}
.dist-tile-investor {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}
.dist-tile-broker {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
}

/* --- Stacked Visual Bar (60/40 etc.) --- */
.stack-bar {
    height: 16px;
    border-radius: 9999px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
.stack-bar-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: white;
    transition: width 0.3s ease;
}

/* --- Approve & Lock Button (the big one) --- */
.approve-lock-btn {
    background: linear-gradient(135deg, #006e2b 0%, #008a36 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 10px 25px -5px rgba(0, 110, 43, 0.35);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    cursor: pointer;
}
.approve-lock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(0, 110, 43, 0.45);
}

/* --- Warning Banner --- */
.warning-banner {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9a3412;
}

/* --- Settlement Note --- */
.settlement-note {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #854d0e;
    font-size: 0.8125rem;
}

/* --- Cost Summary Read-Only --- */
.cost-summary-card {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}
.cost-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}
.cost-summary-row.total {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 0.875rem;
    font-weight: 700;
    font-size: 1rem;
}

/* --- Section Header (Vertical Accent Bar) --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-right: 4px solid #006e2b;
    padding-right: 0.75rem;
}
.section-header.partnership { border-right-color: #225eab; }
.section-header.investor { border-right-color: #9333ea; }
.section-header.brokerage { border-right-color: #f97316; }
.section-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #191c1e;
}

/* --- Status Pills --- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-completed { background: #dcfce7; color: #15803d; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-pending { background: #fef3c7; color: #a16207; }
.status-locked { background: #e0e7ff; color: #3730a3; }

/* --- Receiving stub for unused/dummy clicks --- */
.dummy-clickable {
    cursor: pointer;
}
.dummy-clickable:hover {
    opacity: 0.85;
}
