/* =========================
   CRM 儀表板（報表卡片）
========================= */

.dash-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.dash-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #6b7280;
}

.dash-filter select,
.dash-filter input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #111827;
}

.dash-range-text {
    margin-left: auto;
    font-size: 13px;
    color: #6b7280;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin: 20px 0 25px;
}

.dash-card {
    background: white;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    min-width: 0;
}

.dash-wide {
    grid-column: span 2;
}

.dash-wide-all {
    grid-column: 1 / -1;
}

.dash-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.dash-hint {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

.dash-big {
    margin-top: 6px;
    font-size: 30px;
    font-weight: 700;
    color: #111827;
}

.dash-card-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.dash-notice {
    padding: 10px 14px;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
}

.dash-empty {
    padding: 24px 0;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.dash-change {
    margin-left: 4px;
    font-size: 13px;
    font-weight: 600;
}

.dash-change-up { color: #16a34a; }
.dash-change-down { color: #dc2626; }
.dash-change-none { color: #9ca3af; }

.dash-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

/* 折線圖 */
.dash-line-chart {
    width: 100%;
    height: 160px;
    margin-top: 10px;
}

.dash-axis-line { stroke: #e5e7eb; stroke-width: 1; }
.dash-axis-label { font-size: 11px; fill: #9ca3af; }
.dash-line-path { fill: none; stroke: #2563eb; stroke-width: 2; vector-effect: non-scaling-stroke; }
.dash-line-area { fill: rgba(37, 99, 235, .08); stroke: none; }
.dash-line-dot { fill: #2563eb; }

/* 橫條排行 */
.dash-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.dash-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.dash-bar-name { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-value { color: #111827; font-weight: 600; white-space: nowrap; }
.dash-bar-sub { color: #9ca3af; font-weight: 400; }

.dash-bar-track {
    height: 8px;
    margin-top: 4px;
    border-radius: 4px;
    background: #f3f4f6;
}

.dash-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #2563eb;
}

/* 直條圖 */
.dash-columns {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-top: 14px;
}

.dash-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.dash-column-bar {
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    background: #60a5fa;
}

.dash-column-label {
    margin-top: 4px;
    font-size: 11px;
    text-align: center;
    color: #9ca3af;
}

@media (max-width: 760px) {
    .dash-wide { grid-column: auto; }
    .dash-range-text { margin-left: 0; width: 100%; }
}
