﻿/* =========================================================
   FINDASH
   PROJECT-ISOLATED FINANCE & ACCOUNTING
========================================================= */

/* =========================================================
   FINDASH
   PROFESSIONAL FINANCE & PROJECT ACCOUNTING
========================================================= */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #fff1b8;
    --surface: #fffdf5;
    --surface-soft: #fff8dc;

    --text: #172033;
    --muted: #64748b;
    --border: #e6c96a;

    --sidebar: #1d4ed8;
    --sidebar-muted: #dbeafe;

    --shadow:
        0 10px 30px rgba(15, 23, 42, .06);

    --radius: 18px;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    scroll-behavior: smooth;
}


body {
    font-family: "Inter", sans-serif;
    background: linear-gradient(135deg, #fff9df 0%, #ffe79a 48%, #fff1bd 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
}


button,
input,
select,
textarea {
    font: inherit;
}


button {
    cursor: pointer;
}


button:disabled {
    cursor: not-allowed;
    opacity: .5;
}


a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   APP
========================================================= */

.app {
    min-height: 100vh;
}


.main-content {
    margin-left: 250px;
    min-height: 100vh;
    padding: 0 34px 60px;
}


.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4 {
    color: #1e3a8a;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 55%, #e0f2fe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 4px 10px;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    background: var(--sidebar);
    color: white;
    padding: 28px 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}


.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 34px;
}


.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
}


.brand h1 {
    font-size: 20px;
    font-weight: 800;
}


.brand span {
    color: var(--sidebar-muted);
    font-size: 11px;
}


.navigation {
    display: grid;
    gap: 7px;
}


.nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 13px;
    border-radius: 11px;
    color: var(--sidebar-muted);
    transition: .2s ease;
    font-size: 14px;
    font-weight: 600;
}


.nav-link i {
    width: 20px;
    text-align: center;
}


.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,.08);
    color: white;
}


.nav-link.active {
    box-shadow:
        inset 3px 0 0 var(--primary);
}


.sidebar-bottom {
    margin-top: auto;
}


.sidebar-action {
    width: 100%;
    border: 0;
    background: rgba(255,255,255,.06);
    color: var(--sidebar-muted);
    padding: 12px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}


.sidebar-action:hover {
    color: white;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    height: 96px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}


.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
}


.topbar-left {
    gap: 14px;
}


.topbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}


.blcc-logo {
    width: 120px;
    height: 78px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 7px;
    background: #ffffff;
    border: 3px solid #60a5fa;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(30, 58, 138, .28);
}


.topbar-title .section-kicker {
    margin-bottom: 2px;
}


.topbar-title h2 {
    color: #1e3a8a;
    font-size: 20px;
    font-weight: 800;
}


.topbar-actions {
    gap: 12px;
}


.currency-switcher {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 700;
}


.currency-switcher .select-control {
    min-width: 105px;
    padding: 9px 10px;
    color: #1e3a8a;
    font-weight: 700;
}


.eyebrow {
    color: #1e3a8a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 55%, #e0f2fe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    display: inline-block;
    padding: 3px 8px;
}


.topbar h2 {
    font-size: 21px;
    color: #1e3a8a;
    font-weight: 800;
}
 .topbar-title, sakhi {
    font-size: 14px;
    color: rgb(255, 215, 0);
    background-color: blue;
    margin: 0;
    padding: 0;
    font-weight: bold;

    
}


.icon-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: 11px;
    display: grid;
    place-items: center;
}


.icon-button:hover {
    color: var(--primary);
}


.mobile-menu {
    display: none;
}


.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e3a8a;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 12px;
}


.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(8px);
}


.auth-screen.hidden {
    display: none;
}


.auth-card {
    width: min(100%, 410px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}


.auth-card > .brand-logo {
    margin-bottom: 22px;
}


.auth-card h2 {
    font-size: 27px;
    margin-bottom: 5px;
}


.auth-copy,
.auth-note {
    color: var(--muted);
    font-size: 12px;
}


.auth-copy {
    margin-bottom: 22px;
}


.auth-submit {
    width: 100%;
    margin: 7px 0 14px;
}


.auth-note {
    display: block;
    line-height: 1.5;
}


.auth-error {
    min-height: 18px;
    color: var(--danger);
    font-size: 12px;
}


/* =========================================================
   NOTIFICATIONS
========================================================= */

.notification-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    transform: translate(10px,-10px);
}


.notification-panel {
    position: fixed;
    top: 70px;
    right: 34px;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 1500;
    display: none;
}


.notification-panel.show {
    display: block;
}


.notification-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}


.close-small {
    border: 0;
    background: transparent;
    color: var(--muted);
}


.notification-empty {
    min-height: 140px;
    display: grid;
    place-items: center;
    align-content: center;
    color: var(--muted);
    gap: 8px;
    font-size: 13px;
}


/* =========================================================
   PAGE
========================================================= */

.page-section {
    padding: 30px 0;
    scroll-margin-top: 20px;
}


.welcome-row,
.section-heading,
.project-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}


.section-kicker {
    color: #1e3a8a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    margin-bottom: 5px;
}


.white-kicker {
    color: white;
}


.welcome-row h3 {
    color: #1e3a8a;
}


.welcome-row h3,
.section-heading h3 {
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 6px;
}
.year {
    font-size: 14px;
    color: #1e3a8a;
    background: rgb(239, 239, 246);
    font-weight: bold;
    border-radius: 5px;
    padding: 5px 10px;
    margin-bottom: -5px;
    margin-top:10px;
}


.section-description,
.section-heading p {
    color: var(--muted);
    font-size: 13px;
}


.quick-actions {
    display: flex;
    gap: 10px;
}


#desktopAddProject,
#addProjectBtn {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #93c5fd;
}


#desktopAddProject:hover,
#addProjectBtn:hover {
    background: #bfdbfe;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: .2s ease;
}


.btn-primary {
    background: var(--primary);
    color: white;
}


.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}


.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}


.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}


.text-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}


/* =========================================================
   CURRENCY CARDS
========================================================= */

.currency-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 25px 0;
}


.currency-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}


.currency-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}


.currency-badge {
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}


.usd-card .currency-badge {
    background: #eef2ff;
    color: var(--primary);
}


.afn-card .currency-badge {
    background: #ecfdf5;
    color: #059669;
}


.currency-values {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 15px;
    margin-top: 18px;
}


.currency-values small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 3px;
}


.currency-values strong {
    font-size: 18px;
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0;
}


.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 19px;
    display: flex;
    gap: 14px;
    box-shadow: var(--shadow);
}


.stat-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}


.stat-icon.revenue {
    background: #eef2ff;
    color: var(--primary);
}


.stat-icon.cost {
    background: #fff7ed;
    color: #f97316;
}


.stat-icon.profit {
    background: #ecfdf5;
    color: #059669;
}


.stat-icon.projects {
    background: #eff6ff;
    color: var(--info);
}


.stat-content span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}


.stat-content strong {
    display: block;
    font-size: 20px;
    margin: 3px 0;
}


.stat-content small {
    color: var(--muted);
    font-size: 10px;
}


/* =========================================================
   PANELS
========================================================= */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}


.panel-header {
    padding: 20px 21px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.panel-header h3 {
    font-size: 17px;
}


.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0,1.5fr) minmax(320px,.8fr);
    gap: 18px;
    margin-top: 18px;
}


/* =========================================================
   PORTFOLIO
========================================================= */

.portfolio-summary {
    padding: 4px 21px 21px;
}


.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}


.summary-row strong {
    color: var(--text);
}


.summary-row.total strong,
.summary-row.net strong {
    color: var(--primary);
}


.summary-divider {
    height: 15px;
}


/* =========================================================
   CHART
========================================================= */

.chart-wrapper {
    display: flex;
    height: 280px;
    padding: 0 20px;
}


.chart-y-axis {
    width: 68px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 5px 40px 0;
    text-align: right;
    color: #1e3a8a;
    font-size: 10px;
    font-weight: 900;
    text-shadow: none;
}


.chart-area {
    flex: 1;
    position: relative;
    min-width: 0;
}


.grid-lines {
    position: absolute;
    inset: 0 0 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.grid-lines span {
    border-top: 1px dashed rgba(148, 163, 184, 0.75);
}


.finance-chart {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: calc(100% - 40px);
    overflow: visible;
}


.chart-area-fill {
    fill: url(#revenueGradient);
}


.chart-line {
    fill: none;
    stroke: #4f46e5;
    stroke-width: 3.5;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 6px 10px rgba(79, 70, 229, 0.18));
}


.expense-chart-line {
    fill: none;
    stroke: #dc2626;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 6px 10px rgba(220, 38, 38, 0.14));
}


.chart-point {
    fill: #4f46e5;
}


.chart-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    display: flex;
    justify-content: space-between;
    color: #f8fafc;
    font-size: 10.5px;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(15, 23, 42, .9);
}


.chart-y-axis span,
.chart-labels span {
    color: #1e3a8a;
    font-weight: 900;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-shadow: none;
}


.chart-legend {
    padding: 0 21px 20px;
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 11px;
}


.legend-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 5px;
}


.revenue-dot {
    background: var(--primary);
}


.expense-dot {
    background: var(--danger);
}


/* =========================================================
   PROJECT PREVIEW
========================================================= */

.projects-preview {
    margin-top: 18px;
}


.project-mini-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
    padding: 0 21px 21px;
}


.project-mini-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: .2s ease;
}


.project-mini-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}


.project-mini-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.project-mini-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: var(--primary);
}


.project-mini-card h4 {
    margin-top: 12px;
    font-size: 14px;
}


.project-mini-card p {
    color: var(--muted);
    font-size: 11px;
}


.project-mini-profit {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}


.project-mini-profit span {
    display: block;
    color: var(--muted);
    font-size: 9px;
}


.project-mini-profit strong {
    font-size: 12px;
}


/* =========================================================
   FILTERS
========================================================= */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}


.search-box {
    flex: 1;
    min-width: 220px;
    height: 42px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    gap: 8px;
}


.search-box i {
    color: var(--muted);
    font-size: 13px;
}


.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}


.select-control,
.filter-bar select {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    padding: 0 12px;
    outline: 0;
}


/* =========================================================
   TABLE
========================================================= */

.table-panel {
    margin-bottom: 18px;
}


.table-container {
    overflow-x: auto;
}


table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}


tbody tr {
    border-top: 1px solid var(--border);
}


tbody tr:nth-child(even) {
    background: var(--surface-soft);
}


th + th,
td + td {
    border-left: 1px solid var(--border);
}


.transaction-table {
    min-width: 100%;
    table-layout: fixed;
}


.transaction-table th,
.transaction-table td {
    overflow-wrap: anywhere;
}


.transaction-table th {
    white-space: normal;
}


th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 13px 14px;
    text-align: left;
    white-space: nowrap;
}


td {
    padding: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    vertical-align: middle;
}


.amount {
    font-weight: 700;
    white-space: nowrap;
}


.amount.income {
    color: var(--success);
}


.amount.expense {
    color: var(--danger);
}


.transaction-name {
    display: flex;
    align-items: center;
    gap: 10px;
}


.transaction-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #eef2ff;
    color: var(--primary);
    display: grid;
    place-items: center;
}


.transaction-name strong {
    display: block;
}


.transaction-name small {
    display: block;
    color: var(--muted);
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.type-badge,
.status,
.currency-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 800;
}


.type-badge.income {
    background: #ecfdf5;
    color: #059669;
}


.type-badge.expense {
    background: #fef2f2;
    color: #dc2626;
}


.type-badge.direct {
    background: #eff6ff;
    color: #2563eb;
}


.type-badge.overhead {
    background: #fff7ed;
    color: #ea580c;
}


.status.completed {
    background: #ecfdf5;
    color: #059669;
}


.status.pending {
    background: #fffbeb;
    color: #d97706;
}


.status.cancelled {
    background: #fef2f2;
    color: #dc2626;
}


.currency-tag.usd {
    background: #eef2ff;
    color: var(--primary);
}


.currency-tag.afn {
    background: #ecfdf5;
    color: #059669;
}


.table-actions {
    display: flex;
    gap: 6px;
}


.table-action,
.delete-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    color: var(--muted);
}


.table-action:hover {
    color: var(--primary);
}


.delete-btn:hover {
    color: var(--danger);
    border-color: #fecaca;
}


/* =========================================================
   PROJECT DETAILS
========================================================= */

.project-details {
    padding-bottom: 25px;
}


.project-details-header {
    padding: 21px;
    border: 1px solid #93c5fd;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 55%, #e0f2fe 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}


.project-details-header h3 {
    font-size: 20px;
    color: #1e3a8a;
    font-weight: 800;
    margin: 4px 0 5px;
    background: transparent;
    border: 0;
    padding: 0;
}


.project-details-header p:last-child {
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
}


.project-financial-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 12px;
    padding: 20px;
}


.project-financial-card {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 15px;
}


.project-financial-card.highlight {
    background: #eef2ff;
    border-color: #c7d2fe;
}


.project-financial-card span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}


.project-financial-card strong {
    display: block;
    font-size: 16px;
    margin-top: 4px;
}


.project-expenses-section,
.expense-breakdown {
    padding: 0 20px;
    margin-top: 10px;
}


.subsection-heading {
    margin-bottom: 12px;
}


.subsection-heading h4 {
    font-size: 15px;
}


.subsection-heading p {
    color: var(--muted);
    font-size: 11px;
}


/* =========================================================
   BREAKDOWN
========================================================= */

#projectExpenseBreakdown {
    display: grid;
    gap: 10px;
}


.project-breakdown-item {
    display: grid;
    grid-template-columns: 150px 1fr 45px;
    gap: 12px;
    align-items: center;
}


.project-breakdown-item > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
}


.project-breakdown-item strong {
    white-space: nowrap;
}


.project-breakdown-bar {
    height: 7px;
    border-radius: 10px;
    background: var(--surface-soft);
    overflow: hidden;
}


.project-breakdown-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
}


.project-breakdown-item small {
    color: var(--muted);
    text-align: right;
}


.shareholder-grid {
    display: grid;
    gap: 18px;
}


.guarantee-grid {
    display: grid;
    gap: 18px;
}


.guarantee-panel {
    padding: 20px;
    overflow: visible;
}


.guarantee-form {
    margin-bottom: 18px;
}


.guarantee-table {
    min-width: 1100px;
}


.guarantee-table th,
.guarantee-table td {
    white-space: nowrap;
}


.guarantee-table .status {
    white-space: nowrap;
}


.shareholder-panel,
.shareholder-summary-panel {
    padding: 20px;
    overflow: visible;
}


.shareholder-panel .subsection-heading,
.shareholder-summary-panel .subsection-heading {
    margin-bottom: 14px;
}


.compact-form {
    padding: 0;
    margin-bottom: 20px;
}


.compact-form .btn {
    margin-top: 2px;
}


.shareholder-panel .table-container,
.shareholder-summary-panel .table-container {
    margin-top: 12px;
}


.capital-summary-block {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}


.capital-summary-heading h5 {
    margin: 0 0 4px;
    font-size: 15px;
}


.capital-summary-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}


.capital-summary-table {
    min-width: 100%;
}


.capital-summary-table td:last-child {
    font-weight: 700;
}


.debit-summary-block {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}


.debit-summary-heading h5 {
    margin: 0 0 4px;
    font-size: 15px;
}


.debit-summary-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}


.debit-summary-table {
    min-width: 100%;
}


.debit-summary-table td:last-child {
    font-weight: 700;
}


.shareholder-summary-table {
    min-width: 100%;
    table-layout: fixed;
}


.shareholder-summary-table th {
    white-space: normal;
}


.table-empty {
    text-align: center;
    color: var(--muted);
    padding: 20px;
}


.delete-shareholder-record {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}


.delete-shareholder-record:hover {
    color: #dc2626;
}


/* =========================================================
   FORMS / MODALS
========================================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3000;
}


.modal.show {
    display: flex;
}


.modal-card {
    width: min(700px,100%);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(15,23,42,.25);
}


.modal-header {
    padding: 21px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}


.modal-header h3 {
    font-size: 20px;
}


.close-modal {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: 9px;
}


form {
    padding: 21px;
}


.form-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 15px;
}


.form-group {
    margin-bottom: 16px;
}


.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}


.form-group input,
.form-group select,
.form-group textarea,
.currency-readonly {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 9px;
    padding: 11px 12px;
    outline: none;
}


.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}


.currency-readonly {
    background: var(--surface-soft);
    font-weight: 800;
}


.error-message {
    display: block;
    color: var(--danger);
    min-height: 15px;
    margin-top: 4px;
    font-size: 10px;
}


.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}


/* =========================================================
   PAGINATION
========================================================= */

.table-footer {
    padding: 15px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: var(--muted);
    font-size: 11px;
}


.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}


#pagination {
    display: flex;
    gap: 5px;
}


.page-btn {
    min-width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 7px;
    color: var(--muted);
    font-size: 11px;
}


.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}


.empty-state i {
    font-size: 25px;
    margin-bottom: 10px;
    display: block;
}


.empty-state strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}


.empty-state span {
    font-size: 11px;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    background: #174a5f;
    color: white;
    padding: 13px 17px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    gap: 9px;
    transform: translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: .25s ease;
    z-index: 5000;
    font-size: 12px;
}


.toast.show {
    transform: translateY(0);
    opacity: 1;
}


/* =========================================================
   DARK MODE
========================================================= */

body.dark {
    --bg: #163847;
    --surface: #1d4655;
    --surface-soft: #255466;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #263244;
}


body.dark .sidebar {
    background: #1e40af;
}


body.dark .btn-secondary,
body.dark .icon-button,
body.dark .table-action,
body.dark .delete-btn,
body.dark .close-modal,
body.dark .search-box,
body.dark .select-control,
body.dark .filter-bar select,
body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
    background: var(--surface);
    color: var(--text);
}


body.dark .project-financial-card.highlight {
    background: #171f3a;
    border-color: #303d70;
}


body.dark .usd-card .currency-badge {
    background: #1e2147;
}


body.dark .afn-card .currency-badge {
    background: #123326;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }


    .project-financial-grid {
        grid-template-columns: repeat(3,1fr);
    }


    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 900px) {

    .sidebar {
        transform: translateX(-100%);
        transition: .25s ease;
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .main-content {
        margin-left: 0;
        padding: 0 18px 50px;
    }


    .mobile-menu {
        display: grid;
    }


    .project-mini-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .topbar-actions {
        gap: 6px;
    }

    .currency-switcher span {
        display: none;
    }

    .currency-switcher .select-control {
        min-width: 88px;
    }

    .welcome-row,
    .section-heading,
    .project-details-header {
        flex-direction: column;
    }


    .quick-actions {
        width: 100%;
    }


    .quick-actions .btn {
        flex: 1;
    }


    .currency-summary-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }


    .currency-values {
        grid-template-columns: 1fr;
    }


    .project-financial-grid {
        grid-template-columns: repeat(2,1fr);
    }


    .form-grid {
        grid-template-columns: 1fr;
    }


    .table-footer {
        flex-direction: column;
        align-items: flex-start;
    }


    .project-breakdown-item {
        grid-template-columns: 1fr;
    }


    .project-breakdown-item > div:first-child {
        justify-content: space-between;
    }

}


@media (max-width: 450px) {

    .project-financial-grid {
        grid-template-columns: 1fr;
    }


    .topbar h2 {
        font-size: 18px;
    }


    .welcome-row h3,
    .section-heading h3 {
        font-size: 21px;
    }

}


/* =========================================================
   INVOICE MANAGEMENT
========================================================== */
.invoice-manager {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    padding: 16px;
    margin-bottom: 2px;
}

.invoice-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.invoice-manager-header label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 3px;
}

.invoice-manager-header small,
.invoice-help {
    color: var(--muted);
    font-size: 10px;
}

.invoice-table-wrap {
    overflow-x: auto;
}

.invoice-entry-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}

.invoice-entry-table th,
.invoice-entry-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.invoice-entry-table th {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.invoice-entry-table input,
.invoice-entry-table select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 9px;
    outline: none;
}

.invoice-entry-table input:focus,
.invoice-entry-table select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}

.invoice-number {
    font-weight: 800;
    color: #1e3a8a;
    white-space: nowrap;
}

.invoice-delete-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--danger);
}

.invoice-summary-box {
    margin-top: 13px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.invoice-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
    color: var(--muted);
    font-size: 12px;
}

.invoice-summary-row strong {
    color: var(--text);
    font-size: 13px;
}

.invoice-summary-row:last-child strong {
    color: var(--primary);
}

.invoice-help {
    display: block;
    margin-top: 6px;
}

.project-invoices-section {
    padding: 0 20px;
    margin-top: 10px;
}

.project-invoice-summary {
    margin-bottom: 8px;
}

.invoice-empty-row td {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 18px;
}

@media (max-width: 700px) {
    .invoice-manager-header {
        flex-direction: column;
    }

    .invoice-add-btn {
        width: 100%;
    }
}


/* =========================================================
   EXISTING PROJECT INVOICE ENTRY
========================================================== */
.existing-invoice-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(110px, .55fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    margin: 10px 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.existing-invoice-form .form-group {
    margin: 0;
}

.invoice-currency-display {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
}

.existing-invoice-add-btn {
    min-height: 42px;
    white-space: nowrap;
}

.invoice-delete-btn:hover {
    border-color: #fca5a5;
    background: #fee2e2;
}

@media (max-width: 900px) {
    .existing-invoice-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .existing-invoice-form {
        grid-template-columns: 1fr;
    }

    .existing-invoice-add-btn {
        width: 100%;
    }
}
