@import url('../fonts/filament/filament/inter/index.css');

.dashboard-v7 {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    color: var(--crm-ink, #14213d);
    font-synthesis: none;
}

.dashboard-v7, .dashboard-v7 * { box-sizing: border-box; }
.dashboard-v7 button, .dashboard-v7 select { font: inherit; }
.dashboard-v7 a { color: inherit; }
.dashboard-v7 { width: 100%; margin-top: -1rem; padding: 0 0 42px; }

.v7-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
}
.v7-tabs { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.v7-tab { flex: 0 0 auto; padding: 11px 13px; border-bottom: 2px solid transparent; color: #526079; font-size: 12px; font-weight: 800; text-decoration: none; }
.v7-tab:hover { color: var(--crm-primary, #1d4ed8); }
.v7-tab.active { border-color: var(--crm-primary, #2563eb); color: var(--crm-primary, #1d4ed8); }
.v7-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.v7-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px; border: 1px solid var(--crm-border, #cdd8e7); border-radius: 10px; background: var(--crm-surface, #fff); color: #2563eb; font-size: 12px; font-weight: 800; text-decoration: none; box-shadow: 0 5px 14px rgba(39, 70, 120, .05); }
.v7-button.primary { border-color: var(--crm-primary, #2563eb); background: var(--crm-primary, #2563eb); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .22); }
.v7-button.subtle { color: #475569; }

.v7-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 14px; padding: 9px 12px; border: 1px solid var(--crm-border, #e1e8f2); border-radius: 12px; background: var(--crm-surface, #fff); }
.v7-context-summary, .v7-context-controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: #64748b; font-size: 11.5px; }
.v7-package { padding: 4px 9px; border-radius: 999px; background: #e9efff; color: #1d4ed8; font-weight: 850; }
.v7-context details { position: relative; }
.v7-context summary, .v7-preview button, .v7-reset { cursor: pointer; padding: 6px 9px; border: 1px solid #d5dfeb; border-radius: 8px; background: #fff; color: #334155; font-weight: 750; list-style: none; }
.v7-popover { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; display: grid; gap: 5px; width: 260px; max-height: 300px; overflow-y: auto; padding: 8px; border: 1px solid #dce5f0; border-radius: 12px; background: #fff; box-shadow: 0 18px 44px rgba(30, 50, 80, .16); }
.v7-popover form, .v7-popover button { width: 100%; }
.v7-popover button { display: flex; justify-content: space-between; gap: 8px; padding: 9px; border: 0; border-radius: 8px; background: transparent; color: #334155; text-align: left; cursor: pointer; }
.v7-popover button:hover, .v7-popover button.active { background: #eef4ff; color: #1d4ed8; }
.v7-popover small { color: #8290a5; }
.v7-preview { display: flex; gap: 6px; }
.v7-preview select { padding: 6px 8px; border: 1px solid #d5dfeb; border-radius: 8px; background: #fff; }
.v7-reset { color: #b42318; }

.v7-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.v7-kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.v7-kpi, .v7-card { min-width: 0; border: 1px solid var(--crm-border, #dfe7f1); border-radius: 14px; background: var(--crm-surface, #fff); box-shadow: none; }
.v7-kpi { position: relative; padding: 15px; overflow: hidden; }
.v7-kpi::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--crm-primary, #2563eb); }
.v7-kpi:nth-child(2)::before { background: #16a34a; }
.v7-kpi:nth-child(3)::before { background: #0891b2; }
.v7-kpi:nth-child(4)::before { background: #d97706; }
.v7-kpi:nth-child(5)::before { background: #7c3aed; }
.v7-kpi > span { display: block; overflow: hidden; color: #60708b; font-size: 10px; font-weight: 900; letter-spacing: .075em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.v7-kpi > strong { display: block; margin: 9px 0 5px; overflow: hidden; color: var(--crm-ink, #0f1f3d); font-size: clamp(21px, 2vw, 27px); font-weight: 900; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.v7-kpi > strong.text-value { font-size: 19px; }
.v7-kpi > small { display: block; overflow: hidden; color: #718096; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.v7-grid { display: grid; gap: 13px; margin-bottom: 13px; }
.v7-grid.management { grid-template-columns: 1fr 1.12fr .82fr; }
.v7-grid.main-side { grid-template-columns: 1.65fr .7fr; }
.v7-grid.two { grid-template-columns: 1fr 1fr; }
.v7-card { margin-bottom: 13px; padding: 16px; }
.v7-grid .v7-card { margin-bottom: 0; }
.v7-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.v7-card h2 { margin: 0; color: var(--crm-ink, #14213d); font-size: 15px; font-weight: 900; letter-spacing: -.02em; }
.v7-card header p { margin: 4px 0 0; color: #718096; font-size: 11.5px; }
.v7-card header > a { flex: 0 0 auto; color: #2563eb; font-size: 11px; font-weight: 850; text-decoration: none; }

.v7-score-grid { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #e7edf5; border-radius: 12px; }
.v7-score-grid > div { min-width: 0; padding: 11px; border-right: 1px solid #e7edf5; border-bottom: 1px solid #e7edf5; }
.v7-score-grid > div:nth-child(2n) { border-right: 0; }
.v7-score-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.v7-score-grid span { color: #718096; font-size: 9.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.v7-score-grid strong { display: block; margin-top: 6px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.v7-progress { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #edf2f7; }
.v7-progress i { display: block; height: 100%; border-radius: inherit; background: #2563eb; }

.v7-bar-list { display: grid; gap: 10px; }
.v7-bar { display: grid; grid-template-columns: minmax(85px, 120px) 1fr auto; align-items: center; gap: 9px; color: #334155; font-size: 11.5px; font-weight: 750; }
.v7-bar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v7-bar > i { display: block; height: 19px; overflow: hidden; border-radius: 6px; background: #edf2f7; }
.v7-bar em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.v7-bar em.success { background: linear-gradient(90deg, #16a34a, #4ade80); }
.v7-bar em.warning { background: linear-gradient(90deg, #f59e0b, #facc15); }
.v7-bar b { white-space: nowrap; }

.v7-attention { display: grid; gap: 8px; }
.v7-attention > a, .v7-attention > div { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 10px 11px; border: 1px solid #e6edf5; border-radius: 11px; color: #334155; font-size: 11.5px; font-weight: 750; text-decoration: none; }
.v7-attention > a:hover { border-color: #b9cdf2; background: #f8faff; }
.v7-attention span { min-width: 0; }
.v7-attention span strong, .v7-attention span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v7-attention span small { margin-top: 2px; color: #718096; font-weight: 600; }
.v7-attention b { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; }
.v7-attention b.danger { background: #fee2e2; color: #b91c1c; }
.v7-attention b.warning { background: #fef3c7; color: #b45309; }

.v7-table-wrap { overflow-x: auto; }
.v7-table { width: 100%; min-width: 690px; border-collapse: collapse; }
.v7-table th, .v7-table td { padding: 10px 11px; border-bottom: 1px solid #e7edf5; text-align: left; }
.v7-table th { background: var(--crm-soft, #f9fbfe); color: var(--crm-muted, #718096); font-size: 9.5px; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.v7-table td { color: #334155; font-size: 11.5px; }
.v7-table tbody tr:last-child td { border-bottom: 0; }
.v7-table a { color: #1d4ed8; text-decoration: none; }
.v7-rank { display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 900; }
.v7-empty { padding: 24px 10px !important; color: #8290a5 !important; text-align: center !important; }

.v7-funnel { display: grid; gap: 10px; }
.v7-funnel > div:not(.v7-empty) { display: grid; grid-template-columns: 95px 1fr 32px; align-items: center; gap: 9px; color: #334155; font-size: 11.5px; font-weight: 750; }
.v7-funnel i { display: block; max-width: 100%; height: 28px; border-radius: 6px; background: linear-gradient(90deg, #2563eb, #38bdf8); clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%); }
.v7-funnel i.stage-qualification { background: linear-gradient(90deg, #64748b, #94a3b8); }
.v7-funnel i.stage-proposal { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.v7-funnel i.stage-negotiation { background: linear-gradient(90deg, #d97706, #fbbf24); }
.v7-funnel i.stage-closing { background: linear-gradient(90deg, #15803d, #4ade80); }
.v7-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.v7-status > div { padding: 13px; border: 1px solid #e6edf5; border-radius: 11px; text-align: center; }
.v7-status span, .v7-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.v7-status strong { display: block; margin: 9px 0 3px; font-size: 22px; }
.v7-status small { color: #718096; font-size: 11px; }
.v7-status .success, .v7-badge.paid { background: #dcfce7; color: #15803d; }
.v7-status .warning, .v7-badge.unpaid, .v7-badge.partial { background: #fef3c7; color: #b45309; }
.v7-status .danger, .v7-badge.overdue { background: #fee2e2; color: #b91c1c; }

@media (max-width: 980px) {
    .v7-toolbar { align-items: flex-start; flex-direction: column; }
    .v7-actions { justify-content: flex-start; }
    .v7-kpi-grid, .v7-kpi-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .v7-grid.management, .v7-grid.main-side, .v7-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .dashboard-v7 { padding: 12px 12px 30px; }
    .v7-toolbar { gap: 10px; }
    .v7-tabs { width: 100%; }
    .v7-actions { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
    .v7-context { align-items: flex-start; flex-direction: column; }
    .v7-context-controls { width: 100%; }
    .v7-preview { flex: 1 1 100%; }
    .v7-preview select { min-width: 0; flex: 1; }
    .v7-kpi-grid, .v7-kpi-grid.five { grid-template-columns: 1fr; }
    .v7-kpi > strong { font-size: 24px; }
    .v7-status { grid-template-columns: 1fr; }
    .v7-popover { right: auto; left: 0; width: min(280px, calc(100vw - 32px)); }
}
