/* ============================================================
   KOSHA - Customers Page CSS
   ============================================================ */

/* ─── Customer Detail Drawer ─────────────────────────────────── */
.customer-detail-panel {
    position: fixed; top: 0; right: -420px;
    width: 400px; height: 100vh;
    background: var(--card); z-index: 1050;
    box-shadow: var(--shadow-xl);
    transition: right .3s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    border-left: 1px solid var(--border);
}
.customer-detail-panel.open { right: 0; }
.panel-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.3); z-index: 1049;
    backdrop-filter: blur(2px);
}
.panel-backdrop.show { display: block; }
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.panel-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.panel-body { flex: 1; overflow-y: auto; padding: 1.25rem; }

/* Panel avatar */
.panel-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 800; color: #fff;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.panel-customer-info { text-align: center; margin-bottom: 1.25rem; }

/* Panel stats */
.panel-stats {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: .75rem; margin-bottom: 1.25rem;
}
.panel-stat-card {
    background: var(--bg-secondary); border-radius: var(--radius-md);
    padding: .875rem; text-align: center;
}
.panel-stat-value { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.panel-stat-label { font-size: .72rem; color: var(--text-muted); margin-top: .125rem; }

/* Invoice history in panel */
.panel-invoices-title { font-size: .8125rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .625rem; }
.panel-invoice-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .625rem 0; border-bottom: 1px solid var(--border-light);
    font-size: .8125rem;
}
.panel-invoice-row:last-child { border-bottom: none; }
.panel-invoice-num { font-weight: 600; color: var(--primary); }

/* ─── Avatar in table ────────────────────────────────────────── */
.table-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ─── Row action buttons ─────────────────────────────────────── */
.row-action-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: .3rem .4rem;
    border-radius: var(--radius-sm); transition: var(--transition);
    font-size: .875rem;
}
.row-action-btn:hover { color: var(--primary); background: var(--primary-light); }
.row-action-btn.danger:hover { color: var(--danger); background: var(--danger-light); }
.row-action-btn.success:hover { color: var(--accent-dark); background: var(--accent-light); }

/* ─── Sortable columns ───────────────────────────────────────── */
.kosha-table thead th.sortable { cursor: pointer; }
.kosha-table thead th.sortable:hover { color: var(--primary); }

/* ─── Import CSV modal ───────────────────────────────────────── */
.field-mapping-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: .5rem; align-items: center; margin-bottom: .5rem;
    font-size: .8125rem;
}

/* ─── Status badge in table ──────────────────────────────────── */
.status-active { background: var(--accent-light); color: var(--accent-dark); }
.status-inactive { background: var(--bg-secondary); color: var(--text-muted); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .customer-detail-panel { width: 100%; right: -100%; }
    .panel-stats { grid-template-columns: repeat(2, 1fr); }
}
