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

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}


/* Карточка */

.dashboard-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    height: 88px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}


/* Заголовок */

.dashboard-card .card-title {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}


/* Значение */

.dashboard-card .card-value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 600;
    color: #111827;
}


/* Hover */

.dashboard-card:hover {
    background-color: #f9fafb;
}


/* Активная */

.dashboard-card.active {
    background-color: #fffdfa;
    border-color: #f3c892;
}


/* Tablet */

@media (max-width:1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* mobile */

@media (max-width:768px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .dashboard-card {
        padding: 14px;
        height: auto;
    }
    .card-title {
        font-size: 12px;
    }
    .card-value {
        font-size: 20px;
    }
}


/* Small mobile */

@media (max-width: 380px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}


/* =========================
   DASHBOARD TOPBAR FILTERS
   ========================= */

.db-topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.db-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}


/* ── Pill select (branch) ── */

.db-pill-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    color: #374151;
    transition: border-color 0.2s;
}

.db-pill-select-wrap:focus-within {
    border-color: #c4a97d;
    box-shadow: 0 0 0 2px rgba(196, 169, 125, 0.15);
}

.db-pill-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: inherit;
    outline: none;
    border-radius: 7px;
}

.db-pill-icon {
    display: flex;
    align-items: center;
    color: #6b7280;
    flex-shrink: 0;
}

.db-pill-icon svg {
    width: 14px;
    height: 14px;
}

.db-pill-prefix {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

.db-pill-value {
    font-size: 13px;
    color: #111827;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-pill-chevron {
    display: flex;
    align-items: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.db-pill-chevron.rotated {
    transform: rotate(180deg);
}

.db-pill-chevron svg {
    width: 16px;
    height: 16px;
}


/* ── Branch dropdown ── */

.db-branch-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.db-branch-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
}

.db-branch-search-icon {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

.db-branch-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #111827;
}

.db-branch-search-input::placeholder {
    color: #9ca3af;
}

.db-branch-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.db-branch-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 12px;
    font-size: 13px;
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s;
}

.db-branch-option:hover {
    background: #f9fafb;
}

.db-branch-option.active {
    background: #fdf6ec;
    color: #92691a;
    font-weight: 500;
}

.db-branch-empty {
    padding: 10px 12px;
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
}


/* ── Pill date range ── */

.db-pill-date-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    color: #374151;
    transition: border-color 0.2s;
}

.db-pill-date-wrap:focus-within {
    border-color: #c4a97d;
    box-shadow: 0 0 0 2px rgba(196, 169, 125, 0.15);
}

.db-pill-date {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #111827;
    width: 122px;
    cursor: pointer;
    padding: 0;
}


/* .db-pill-date::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 0;
    padding: 0;
    margin: 0;
} */

.db-pill-date-sep {
    color: #6b7280;
    font-size: 13px;
    padding: 0 2px;
}


/* Dark mode */

.dark .db-pill-select-wrap,
.dark .db-pill-date-wrap {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.dark .db-pill-trigger {
    color: #e2e8f0;
}

.dark .db-pill-value,
.dark .db-pill-date {
    color: #f1f5f9;
}

.dark .db-pill-prefix,
.dark .db-pill-date-sep {
    color: #cbd5e1;
}

.dark .db-pill-icon,
.dark .db-pill-chevron {
    color: #94a3b8;
}

.dark .db-branch-dropdown {
    background: #1e293b;
    border-color: #334155;
}

.dark .db-branch-search-wrap {
    border-bottom-color: #334155;
}

.dark .db-branch-search-input {
    color: #f1f5f9;
}

.dark .db-branch-option {
    color: #e2e8f0;
}

.dark .db-branch-option:hover {
    background: #263347;
}

.dark .db-branch-option.active {
    background: #2d2416;
    color: #c4a97d;
}


/* =========================
   DASHBOARD CHARTS GRID
   ========================= */

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-chart-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.chart-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}

.chart-card-badge {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}


/* Debit / Credit & Commissions layout */

.debit-credit-header {
    margin-bottom: 8px;
}

.debit-credit-body {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 16px;
    align-items: center;
}

.debit-credit-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

.text-green {
    color: #22c55e;
}

.text-red {
    color: #ef4444;
}

.debit-credit-chart {
    max-width: 140px;
}


/* Selected border for Debit/Credit */

.debit-credit-card {
    border: 2px solid #3b82f6;
}


/* Two-col layout for history tab in reports */

.reports-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
    .reports-two-col {
        grid-template-columns: 1fr;
    }
    .debit-credit-body {
        grid-template-columns: 1fr;
    }
}


/* Dark mode */

.dark .dashboard-chart-card {
    background: #1e293b;
    border-color: #334155;
}

.dark .chart-card-title {
    color: #f1f5f9;
}

.dark .stat-label {
    color: #94a3b8;
}


/* ── Dashboard stat strip ────────────────────────────────────────────────── */

.dashboard-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dashboard-stat-item {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1.125rem;
    border-radius: 0.75rem;
    border-left: 4px solid transparent;
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
}

.dashboard-stat-green {
    border-left-color: #22c55e;
}

.dashboard-stat-red {
    border-left-color: #ef4444;
}

.dashboard-stat-blue {
    border-left-color: #3b82f6;
}

.dashboard-stat-amber {
    border-left-color: #f59e0b;
}

.dashboard-stat-emerald {
    border-left-color: #10b981;
}

.dashboard-stat-rose {
    border-left-color: #f43f5e;
}


/* dark mode */

.dark .dashboard-stat-item {
    background: rgba(255, 255, 255, 0.04);
}

.dark .dashboard-stat-label {
    color: var(--gray-400, #9ca3af);
}

.dark .dashboard-stat-value {
    color: var(--gray-100, #f3f4f6);
}
