/* =========================================================
   Receivables Management SaaS
   Clean / Modern / Financial UI
   ========================================================= */

:root {
    --bg: #eef2f7;
    --surface: #ffffff;
    --surface-soft: #f5f7fa;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --text: #172033;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --border: #dce3eb;
    --border-strong: #cbd5e1;

    --success: #059669;
    --success-soft: #ecfdf5;

    --warning: #d97706;
    --warning-soft: #fffbeb;

    --danger: #dc2626;
    --danger-soft: #fef2f2;

    --radius-sm: 9px;
    --radius: 13px;
    --radius-lg: 16px;

    --shadow-sm:
        0 2px 7px rgba(15, 23, 42, 0.045);

    --shadow:
        0 6px 20px rgba(15, 23, 42, 0.06);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font-family:
        "Vazirmatn",
        "IRANSansX",
        Tahoma,
        Arial,
        sans-serif;

    font-size: 15px;
    line-height: 1.7;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}


/* =========================================================
   HEADER
   ========================================================= */

.topbar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #dbeafe;

    box-shadow:
        0 2px 10px rgba(37, 99, 235, 0.06);
}

.topbar-inner {
    width: min(1240px, calc(100% - 48px));

    min-height: 82px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 28px;
}

.topbar-title {
    color: var(--text);

    font-size: 19px;
    font-weight: 900;

    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;

    gap: 9px;
}

.topbar-actions form {
    margin: 0;
}

.dashboard-link,
.logout-button {
    min-height: 40px;

    padding: 8px 17px;

    border-radius: var(--radius-sm);

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.dashboard-link,
.logout-button {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #ffffff;
}

.dashboard-link:hover,
.logout-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #ffffff;

    box-shadow:
        0 3px 10px rgba(37, 99, 235, 0.18);
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.page-container {
    width: min(1240px, calc(100% - 48px));

    margin: 0 auto;

    padding: 30px 0 48px;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1 {
    margin: 0 0 22px;

    color: var(--text);

    font-size: 26px;
    font-weight: 800;

    line-height: 1.4;
}

h2 {
    margin: 0 0 17px;

    color: var(--text);

    font-size: 18px;
    font-weight: 800;

    line-height: 1.5;
}

p {
    margin-top: 0;
}


/* =========================================================
   GENERIC SECTION
   ========================================================= */

.section {
    margin-bottom: 20px;

    padding: 22px 24px;

    background: #fbfcfe;

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.section-heading h2 {
    margin-bottom: 3px;
}

.section-description {
    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
}


/* =========================================================
   DASHBOARD CARDS
   ========================================================= */

.cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 20px;
}

.card {
    min-width: 0;
    min-height: 124px;

    padding: 19px 20px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);

    border-color: #cbd5e1;

    box-shadow: var(--shadow);
}

.card-title {
    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;
}

.card-value {
    color: var(--text);

    font-size: 25px;
    font-weight: 800;

    line-height: 1.35;

    overflow-wrap: anywhere;
}

.card-unit {
    margin-top: 2px;

    color: var(--text-light);

    font-size: 11px;
    font-weight: 600;
}


/* =========================================================
   RISK ITEMS
   ========================================================= */

.risk-item {
    display: flex;

    flex-direction: row;

    direction: ltr;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px 0;

    border-bottom: 1px solid var(--border);
}

.risk-item:first-of-type {
    padding-top: 0;
}

.risk-item:last-of-type {
    padding-bottom: 0;

    border-bottom: 0;
}

.risk-item > div:first-child {
    direction: rtl;

    flex: 1;
    min-width: 0;

    text-align: right;
}

.risk-item > div:first-child strong {
    font-size: 15px;
    font-weight: 800;
}

.risk-item > div:first-child > div {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 13px;
}

.risk-score {
    flex-shrink: 0;

    direction: rtl;

    min-width: 108px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 8px 12px;

    background: var(--primary-soft);

    border: 1px solid #bfdbfe;

    border-radius: var(--radius-sm);
}

.risk-label {
    color: var(--text-muted);

    font-size: 12px;
}

.risk-arrow {
    color: var(--text-light);

    font-size: 12px;
}

.risk-number {
    color: var(--primary);

    font-size: 17px;
    font-weight: 800;
}


/* =========================================================
   EMPTY
   ========================================================= */

.empty {
    padding: 16px;

    background: var(--surface-soft);

    border: 1px dashed var(--border-strong);

    border-radius: var(--radius-sm);

    color: var(--text-muted);

    font-size: 13px;

    text-align: center;
}


/* =========================================================
   IMPORT PAGE
   ========================================================= */

.import-page {
    width: 100%;

    margin: 0 auto;
}

.import-container {
    width: 100%;
}

.import-heading {
    margin-bottom: 19px;
}

.import-kicker {
    margin-bottom: 3px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
}

.import-heading h1 {
    margin-bottom: 5px;
}

.import-heading p {
    max-width: 780px;

    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
}


/* =========================================================
   IMPORT CARD
   ========================================================= */

.import-card {
    margin-bottom: 16px;

    padding: 22px 24px;

    background: #fbfcfe;

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.import-card-header {
    display: flex;
    align-items: center;

    gap: 13px;

    margin-bottom: 18px;
}

.import-card-header h2 {
    margin: 0 0 2px;

    font-size: 17px;
}

.import-card-header p {
    margin: 0;

    color: var(--text-muted);

    font-size: 12px;
}

.import-icon {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-soft);
    border: 1px solid #bfdbfe;

    border-radius: 11px;

    color: var(--primary);

    font-size: 16px;
    font-weight: 800;
}


/* =========================================================
   IMPORT ALERT
   ========================================================= */

.import-alert {
    margin-bottom: 15px;

    padding: 11px 13px;

    background: var(--danger-soft);

    border: 1px solid #fecaca;

    border-radius: var(--radius-sm);

    color: var(--danger);

    font-size: 13px;
}


/* =========================================================
   UPLOAD ZONE
   ========================================================= */

.import-form {
    width: 100%;
}

.upload-zone {
    min-height: 112px;

    display: flex;
    align-items: center;

    gap: 15px;

    padding: 16px;

    background:
        linear-gradient(
            180deg,
            #f9fbfe 0%,
            #f2f6fb 100%
        );

    border: 1.5px dashed #93c5fd;

    border-radius: 13px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.upload-zone:hover {
    background: #eef6ff;

    border-color: var(--primary);

    transform: translateY(-1px);
}

.upload-zone-icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);

    border-radius: 12px;

    color: #ffffff;

    font-size: 21px;
    font-weight: 800;
}

.upload-zone-content {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.upload-zone-content strong {
    color: var(--text);

    font-size: 14px;
    font-weight: 800;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-zone-content strong.selected {
    color: var(--primary);
}

.upload-zone-content span {
    color: var(--text-muted);

    font-size: 12px;
}

.upload-select-button {
    flex-shrink: 0;

    padding: 8px 15px;

    background: #ffffff;

    border: 1px solid #bfdbfe;

    border-radius: 8px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
}

#import-file {
    display: none !important;
}

#import-file,
.import-form > input[type="file"] {
    display: none !important;
}


/* =========================================================
   UPLOAD FOOTER
   ========================================================= */

.upload-footer {
    margin-top: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.upload-hint {
    color: var(--text-light);

    font-size: 11px;
}

.upload-submit {
    flex-shrink: 0;

    min-height: 42px;

    padding: 8px 19px;

    background: var(--primary);

    border: 0;

    border-radius: 9px;

    color: #ffffff;

    font-family: inherit;

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.upload-submit:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);
}


/* =========================================================
   FILE RECEIVED
   ========================================================= */

.import-result {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 16px;

    padding: 14px 16px;

    background: var(--success-soft);

    border: 1px solid #a7f3d0;

    border-radius: var(--radius);
}

.result-icon {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #d1fae5;

    border-radius: 50%;

    color: var(--success);

    font-size: 17px;
    font-weight: 900;
}

.import-result > div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.import-result strong {
    color: #065f46;

    font-size: 13px;
}

.import-result span {
    margin-top: 1px;

    color: #047857;

    font-size: 12px;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   SHEET SELECTION
   ========================================================= */

.secondary-card {
    margin-top: 0;
}

.select-wrapper {
    margin-bottom: 13px;
}

.select-wrapper label {
    display: block;

    margin-bottom: 6px;

    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 700;
}

select {
    width: 100%;

    min-height: 43px;

    padding: 8px 11px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 9px;

    color: var(--text);

    font-family: inherit;
    font-size: 13px;

    outline: none;
}

select:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.09);
}

.secondary-submit {
    min-height: 40px;

    padding: 7px 17px;

    background: var(--surface-soft);

    border: 1px solid var(--border-strong);

    border-radius: 8px;

    color: var(--text-secondary);

    font-family: inherit;

    font-size: 12px;
    font-weight: 800;

    cursor: pointer;
}

.secondary-submit:hover {
    background: #e9eef5;
}


/* =========================================================
   FINANCIAL SUMMARY
   ========================================================= */

.import-summary {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 13px;
}

.import-summary-item {
    min-width: 0;

    padding: 14px 16px;

    background: #f4f7fb;

    border: 1px solid var(--border);

    border-radius: 10px;

    position: relative;

    overflow: hidden;
}

.import-summary-item::before {
    content: "";

    position: absolute;

    top: 0;
    right: 0;

    width: 100%;
    height: 3px;

    background: var(--primary);
}

.import-summary-item span {
    display: block;

    margin-bottom: 6px;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 700;
}

.import-summary-item strong {
    display: block;

    color: var(--text);

    font-size: 22px;
    font-weight: 800;

    line-height: 1.4;

    overflow-wrap: anywhere;
}

.import-summary-item small {
    display: block;

    margin-top: 3px;

    color: var(--text-light);

    font-size: 11px;
}


/* =========================================================
   COLUMNS
   ========================================================= */

.import-columns {
    margin: 0;
    padding: 0;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;

    list-style: none;
}

.import-columns li {
    min-width: 0;

    padding: 9px 11px;

    background: #f4f7fb;

    border: 1px solid var(--border);

    border-radius: 8px;

    color: var(--text-secondary);

    font-size: 12px;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   PREVIEW
   ========================================================= */

.import-preview {
    overflow: hidden;
}

.preview-table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: #ffffff;
}

.preview-table-wrapper table {
    width: 100%;

    border-collapse: collapse;

    font-size: 12px;
}

.preview-table-wrapper th {
    padding: 11px 12px;

    background: #f4f7fb;

    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);

    font-weight: 800;

    text-align: right;

    white-space: nowrap;
}

.preview-table-wrapper td {
    padding: 10px 12px;

    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);

    text-align: right;

    white-space: nowrap;
}

.preview-table-wrapper tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   CUSTOMER PAGE
   ========================================================= */

.customer-page {
    width: 100%;
}

.page-heading {
    margin-bottom: 20px;
}

.customer-heading-content {
    width: 100%;
}

.page-kicker {
    margin-bottom: 2px;

    color: var(--text-muted);

    font-size: 12px;
}

.customer-name {
    color: var(--text);

    font-size: 25px;
    font-weight: 800;
}


/* =========================================================
   CUSTOMER SUMMARY
   ========================================================= */

.summary-list {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;
}

.summary-item {
    min-height: 96px;
    height: 96px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #f4f7fb;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.summary-item span {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 12px;
}

.summary-item strong {
    display: block;

    color: var(--text);

    font-size: 20px;
    font-weight: 800;

    overflow-wrap: anywhere;
}


/* =========================================================
   RISK REASONS
   ========================================================= */

.risk-reasons {
    padding: 13px 15px;

    background: var(--warning-soft);

    border: 1px solid #fde68a;

    border-radius: 9px;

    color: var(--text-secondary);

    font-size: 13px;
}


/* =========================================================
   TABLES
   ========================================================= */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border);

    border-radius: 10px;
}

table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;

    font-size: 13px;
}

thead {
    background: #f4f7fb;
}

th {
    padding: 12px 14px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 800;

    text-align: right;

    border-bottom: 1px solid var(--border);

    white-space: nowrap;
}

td {
    padding: 12px 14px;

    color: var(--text-secondary);

    text-align: right;

    border-bottom: 1px solid var(--border);

    white-space: nowrap;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #f8fafc;
}


/* =========================================================
   LOGIN
   ========================================================= */

.auth-container {
    min-height: 58vh;

    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(400px, 100%);

    padding: 28px;

    background: #fbfcfe;

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin-bottom: 22px;

    font-size: 22px;

    text-align: center;
}

.auth-card p {
    color: var(--danger);

    font-size: 12px;
}

.auth-card form p {
    margin-bottom: 14px;
}

.auth-card label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 700;
}

.auth-card input {
    width: 100%;

    min-height: 43px;

    padding: 8px 11px;

    border: 1px solid var(--border);

    border-radius: 9px;

    font-family: inherit;
    font-size: 13px;

    outline: none;
}

.auth-card input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.09);
}

.auth-card button {
    width: 100%;

    min-height: 43px;

    margin-top: 7px;

    background: var(--primary);

    border: 0;

    border-radius: 9px;

    color: #ffffff;

    font-family: inherit;

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;
}

.auth-card button:hover {
    background: var(--primary-dark);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .page-container,
    .topbar-inner {
        width: min(100% - 32px, 1240px);
    }

    .cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .summary-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 680px) {

    .topbar-inner {
        min-height: 68px;

        gap: 12px;
    }

    .topbar-title {
        font-size: 16px;
    }

    .dashboard-link,
    .logout-button {
        padding: 7px 11px;

        font-size: 11px;
    }

    .page-container {
        width: calc(100% - 24px);

        padding-top: 22px;
    }

    h1 {
        font-size: 22px;
    }

    .section,
    .import-card {
        padding: 18px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .summary-list {
        grid-template-columns: 1fr;
    }

    .import-summary {
        grid-template-columns: 1fr;
    }

    .upload-zone {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .upload-zone-content {
        flex-basis: calc(100% - 63px);
    }

    .upload-select-button {
        margin-right: 63px;
    }

    .upload-footer {
        align-items: stretch;

        flex-direction: column;
    }

    .upload-submit {
        width: 100%;
    }

    .import-columns {
        grid-template-columns: 1fr;
    }

    .risk-item {
        align-items: flex-start;

        gap: 12px;
    }

    .risk-score {
        min-width: 90px;
    }
}

.dashboard-link,
.logout-button {
    background: #2563eb;
    border: 1px solid #2563eb;
    color: #ffffff;
}

.dashboard-link:hover,
.logout-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}


/* azmayesh */

/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-page {
    width: 100%;
}

.dashboard-heading {
    margin-bottom: 24px;
}

.dashboard-kicker,
.dashboard-section-kicker {
    margin-bottom: 3px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-heading h1 {
    margin-bottom: 4px;
}

.dashboard-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}


/* STATS */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 20px;
}

.dashboard-stat-card {
    min-width: 0;
    min-height: 128px;
    padding: 18px 19px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}


.dashboard-stat-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow);
}

.dashboard-stat-label {
    margin-bottom: 9px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-stat-value {
    color: var(--text);
    font-size: 23px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.dashboard-stat-unit {
    margin-top: 3px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 600;
}


/* SECTIONS */

.dashboard-section {
    margin-bottom: 20px;
    padding: 22px 24px;
    background: #fbfcfe;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dashboard-section-header {
    margin-bottom: 18px;
}

.dashboard-section-header h2 {
    margin-bottom: 2px;
}

.dashboard-section-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}


/* RISK LIST */

.dashboard-risk-list {
    border-top: 1px solid var(--border);
}

.dashboard-risk-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 22px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-risk-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-risk-item:first-child {
    padding-top: 14px;
}

.dashboard-risk-main {
    min-width: 0;
}

.dashboard-customer-name {
    display: inline-block;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.dashboard-customer-name:hover {
    color: var(--primary);
}

.dashboard-risk-level {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-risk-score {
    min-width: 108px;
    padding: 7px 12px;
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    text-align: center;
}

.dashboard-risk-score span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
}

.dashboard-risk-score strong {
    display: block;
    margin-top: 1px;
    color: var(--primary);
    font-size: 17px;
}

.dashboard-detail-link {
    min-width: 105px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.dashboard-detail-link:hover {
    border-color: #bfdbfe;
    background: var(--primary-soft);
    color: var(--primary);
}


/* TODAY ACTIONS */

.today-actions-list {
    border-top: 1px solid var(--border);
}

.today-action-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.today-action-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.today-action-item:first-child {
    padding-top: 14px;
}

.today-action-priority {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.today-action-main {
    min-width: 0;
}

.today-action-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.today-action-amount {
    min-width: 145px;
    text-align: right;
}

.today-action-amount strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.today-action-amount span {
    display: block;
    margin-top: 1px;
    color: var(--text-light);
    font-size: 10px;
}

.dashboard-action-button {
    min-width: 72px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.dashboard-action-button:hover {
    background: var(--primary-dark);
    color: #ffffff;
}


/* DASHBOARD RESPONSIVE */

@media (max-width: 1000px) {

    .dashboard-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}

@media (max-width: 700px) {

    .dashboard-stats {
        grid-template-columns: 1fr;
    }


    .dashboard-section {
        padding: 18px;
    }

    .dashboard-risk-item {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .dashboard-risk-score {
        grid-column: 2;
        grid-row: 1;
    }

    .dashboard-detail-link {
        grid-column: 1 / -1;
        width: 100%;
    }

    .today-action-item {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 12px;
    }

    .today-action-amount {
        grid-column: 2;
        min-width: 0;
        text-align: right;
    }

    .dashboard-action-button {
        grid-column: 2;
        width: 100%;
    }

}


/* Dashboard cards - compact */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-stat-card {
    min-height: 96px;
    padding: 14px 16px;
}

.dashboard-stat-label {
    margin-bottom: 5px;
    font-size: 12px;
}

.dashboard-stat-value {
    font-size: 20px;
    line-height: 1.3;
}

.dashboard-stat-unit {
    margin-top: 1px;
    font-size: 10px;
}


/* =========================================================
   CUSTOMER DETAIL - IMPORT STYLE
   ========================================================= */

.customer-detail-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.customer-name {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 26px;
    font-weight: 800;
}

.customer-detail-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.customer-back-button {
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
}

.customer-back-button:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
    color: var(--text);
}


/* MAIN SECTIONS */

.customer-summary-section,
.customer-detail-section {
    margin-bottom: 20px;
    padding: 22px 24px;
    background: #fbfcfe;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.customer-section-title {
    margin-bottom: 18px;
}

.customer-section-title h2 {
    margin: 0;
}


/* SUMMARY CARDS */

.summary-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.summary-item {
    min-width: 0;
    min-height: 112px;
    padding: 18px;
    background: #f4f7fb;
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.summary-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-item strong {
    display: block;
    color: var(--text);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.summary-item small {
    display: block;
    margin-top: 3px;
    color: var(--text-light);
    font-size: 11px;
}

.risk-score-value {
    color: var(--primary) !important;
}


/* RISK */

.risk-reasons {
    padding: 14px 16px;
    background: var(--warning-soft);
    border: 1px solid #fde68a;
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.9;
}


/* INVOICE TABLE */

.customer-detail-section .table-wrapper {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.customer-detail-section table {
    background: #ffffff;
}

.customer-detail-section thead {
    background: #f4f7fb;
}

.invoice-remaining {
    color: var(--text);
}


/* RESPONSIVE */

@media (max-width: 900px) {

    .summary-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 650px) {

    .customer-detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-back-button {
        width: 100%;
        text-align: center;
    }

    .summary-list {
        grid-template-columns: 1fr;
    }

    .customer-summary-section,
    .customer-detail-section {
        padding: 18px;
    }

}


/* Dashboard cards - import style */

.dashboard-stat-card {
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}


/* Customer detail cards - compact dashboard style */

.summary-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.summary-item {
    min-height: 96px;
    height: 96px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

.summary-item span {
    margin-bottom: 5px;
    font-size: 12px;
}

.summary-item strong {
    font-size: 20px;
    line-height: 1.3;
}

.summary-item small {
    margin-top: 1px;
    font-size: 10px;
}


/* Customer detail summary cards */

.customer-summary-section .summary-item {
    background: #f4f7fb !important;
    border: 1px solid var(--border);
    box-shadow: none;
    min-height: 96px;
    height: 96px;
    padding: 14px 16px;
    border-radius: 10px;
}

.customer-summary-section .summary-item::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}


/* LOGIN FINAL */

.auth-container {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
}

.auth-card {
    width: min(420px, 100%);
    padding: 30px;
    background: #fbfcfe;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.auth-heading {
    margin-bottom: 22px;
    text-align: center;
}

.auth-kicker {
    margin-bottom: 3px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.auth-heading h1 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 23px;
    font-weight: 800;
}

.auth-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}


/* خطای ورود */

.login-error {
    margin-bottom: 18px;
    padding: 11px 13px;
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    border-radius: 9px;
    color: var(--danger);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}


/* فیلدها */

.auth-field {
    margin-bottom: 15px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}


/* دکمه */

.auth-card button {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    background: var(--primary);
    border: 0;
    border-radius: 9px;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.auth-card button:hover {
    background: var(--primary-dark);
}


/* LOGIN HOVER */

.auth-card {
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.auth-card:hover {
    border-color: #bfdbfe;
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.08),
        0 0 0 3px rgba(37, 99, 235, 0.04);
    transform: translateY(-2px);
}


/* INPUT HOVER */

.auth-field input {
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-field input:hover {
    border-color: #93c5fd;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* BUTTON HOVER */

.auth-card button {
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.auth-card button:hover {
    background: var(--primary-dark);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

.auth-card button:active {
    transform: translateY(0);
}


/* Header - subtle blue shadow only */

.topbar {
    border-bottom: 1px solid #dbeafe;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.06);
}

.topbar-title {
    font-weight: 900;
}


/* =========================================================
   HEADER BRAND
   ========================================================= */

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.topbar-brand-icon {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    border-radius: 11px;

    color: var(--primary);

    font-size: 19px;
    font-weight: 900;

    box-shadow:
        0 3px 10px rgba(37, 99, 235, 0.08);
}

.topbar-title {
    color: var(--text);

    font-size: 21px;
    font-weight: 900;

    letter-spacing: -0.3px;
    white-space: nowrap;
}


/* IMPORT MAPPING */

.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mapping-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr);
    align-items: center;
    gap: 20px;
    padding: 14px 16px;
    background: #f4f7fb;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.mapping-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mapping-label strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.mapping-label span {
    color: var(--text-light);
    font-size: 10px;
}

.mapping-select select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

.mapping-select select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.mapping-hint {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.8;
}

@media (max-width: 700px) {

    .mapping-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

}


.dashboard-empty-state {
    max-width: 680px;
    margin: 70px auto 40px;
    padding: 42px 40px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.dashboard-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    color: var(--primary);
}

.dashboard-empty-kicker {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-empty-state h1 {
    margin: 0;
    color: var(--text);
    font-size: 23px;
    font-weight: 900;
    line-height: 1.6;
}

.dashboard-empty-state p {
    max-width: 540px;
    margin: 12px auto 24px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 2;
}

.dashboard-empty-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 20px;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dashboard-empty-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

@media (max-width: 700px) {
    .dashboard-empty-state {
        margin: 40px auto 30px;
        padding: 32px 22px;
    }

    .dashboard-empty-state h1 {
        font-size: 20px;
    }
}