/* ═══════════════════════════════════════════════════════════
   NP2 Customer Information Center Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── List Filters ──────────────────────────────────────── */

.cic-list-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* ─── Name Cell ─────────────────────────────────────────── */

.cic-name-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cic-name {
    font-weight: 500;
    color: #111827;
}

.cic-email {
    font-size: 12px;
    color: #9ca3af;
}

/* ─── Type Badges ───────────────────────────────────────── */

.cic-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cic-badge-adv { background: #dbeafe; color: #1d4ed8; }
.cic-badge-sub { background: #dcfce7; color: #15803d; }
.cic-badge-src { background: #fef3c7; color: #92400e; }
.cic-badge-car { background: #ede9fe; color: #6d28d9; }
.cic-badge-ven { background: #ffe4e6; color: #be123c; }
.cic-badge-none { background: #f3f4f6; color: #9ca3af; }

/* ─── Detail Header ─────────────────────────────────────── */

.cic-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.cic-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.cic-avatar-org {
    background: #7c3aed;
    border-radius: 12px;
}

.cic-detail-title {
    flex: 1;
}

.cic-detail-title h1 {
    margin: 0 0 4px 0;
    font-size: 22px;
}

.cic-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.cic-detail-actions {
    flex-shrink: 0;
}

/* ─── Cards ─────────────────────────────────────────────── */

.cic-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .cic-detail-grid { grid-template-columns: 1fr; }
}

.cic-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.cic-card-full {
    margin-bottom: 16px;
}

.cic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.cic-card-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cic-card-header .btn-sm,
.cic-card-header .np2-action-btn {
    flex-shrink: 0;
    width: auto;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
    height: auto;
    white-space: nowrap;
}

.cic-card-body {
    padding: 14px 16px;
}

/* ─── Info Rows ─────────────────────────────────────────── */

.cic-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.cic-info-row:last-child {
    border-bottom: none;
}

.cic-info-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.cic-info-value {
    font-size: 14px;
    color: #111827;
}

.cic-notes {
    margin-top: 10px;
    padding: 8px 10px;
    background: #fffbeb;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
}

.cic-empty {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

/* ─── Organization Rows ─────────────────────────────────── */

.cic-org-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.cic-org-row:last-child { border-bottom: none; }

.cic-org-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cic-org-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.cic-org-role {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.cic-role-editable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.1s;
}

.cic-role-editable:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* ─── Addresses ─────────────────────────────────────────── */

.cic-address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.cic-address-card {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.cic-address-type {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.cic-address-lines {
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.cic-address-notes {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    font-style: italic;
}

/* ─── Accounts Table ────────────────────────────────────── */

.cic-accounts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cic-accounts-table th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #e5e7eb;
}

.cic-accounts-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.cic-accounts-table tr:hover {
    background: #f9fafb;
}

.cic-balance-due {
    color: #dc2626;
    font-weight: 600;
}

.cic-balance-zero {
    color: #059669;
}

/* ─── Form Layout ───────────────────────────────────────── */

.cic-form-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
}

@media (max-width: 768px) {
    .cic-form-grid { grid-template-columns: 1fr; }
}

.cic-form-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cic-form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cic-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cic-form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.cic-form-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
}

.cic-form-field label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.cic-form-field input,
.cic-form-field select,
.cic-card-body textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.cic-form-field input:focus,
.cic-form-field select:focus,
.cic-card-body textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.cic-type-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 13px;
}

.cic-type-check input {
    width: auto;
}

.cic-form-actions {
    padding-top: 4px;
}

/* ─── Typeahead Search ──────────────────────────────────── */

.cic-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: white;
}

.cic-search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.cic-search-result:hover {
    background: #f3f4f6;
}

.cic-search-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.cic-search-type {
    font-size: 12px;
    color: #9ca3af;
}

.cic-search-empty {
    padding: 12px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.cic-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    margin-top: 6px;
}

.cic-clear-selection {
    border: none;
    background: none;
    cursor: pointer;
    color: #dc2626;
    font-size: 16px;
    font-weight: bold;
    padding: 0 4px;
}

/* ─── Org Links ─────────────────────────────────────────── */

.cic-org-link {
    font-size: 14px;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
}

.cic-org-link:hover {
    text-decoration: underline;
}

/* ─── Action Buttons (used by CIC — see shared-components.css for styles) ── */

/* ─── Nav History Buttons ────────────────────────────────── */

.nav-history-buttons {
    display: flex;
    gap: 2px;
    margin-left: 10px;
    flex-shrink: 0;
}

.nav-history-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.15s;
}

.nav-history-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.nav-history-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.nav-history-btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.nav-history-btn.nav-history-active {
    color: #6b7280;
    border-color: #d1d5db;
    background: white;
}

.nav-history-btn.nav-history-active:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #93c5fd;
}

.nav-history-btn svg {
    width: 16px;
    height: 16px;
}