/* ============================================================================
 * STYLESHEET: QUẢN LÝ KHÁCH HÀNG (PHOTO STUDIO ERP)
 * Thiết kế giao diện cao cấp, chuẩn hóa theo hình mẫu
 * ==========================================================================*/

:root {
    --cust-primary: #2563eb;
    --cust-primary-hover: #1d4ed8;
    --cust-bg: #f8fbff;
    --cust-card-bg: #ffffff;
    --cust-border: #e2e8f0;
    --cust-border-subtle: #edf2f7;
    --cust-text: #0f172a;
    --cust-text-muted: #64748b;
    --cust-text-sub: #94a3b8;
    --cust-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --cust-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
    --cust-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body.theme-dark {
    --cust-primary: #3b82f6;
    --cust-primary-hover: #60a5fa;
    --cust-bg: #091322;
    --cust-card-bg: #112237;
    --cust-border: #1e3550;
    --cust-border-subtle: #172c44;
    --cust-text: #f1f5f9;
    --cust-text-muted: #94a3b8;
    --cust-text-sub: #64748b;
    --cust-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --cust-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --cust-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.customers-view {
    padding: 0 0 40px;
}

/* ------------------------------------------------------------- HEADER */
.customer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cust-border);
}

.customer-head__breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    color: var(--cust-text-muted);
    font-size: 11px;
    font-weight: 600;
}

.customer-head__breadcrumb i {
    font-size: 10px;
}

.customer-head__breadcrumb strong {
    color: var(--cust-primary);
}

.customer-head__title {
    margin: 0 0 2px;
    color: var(--cust-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.customer-head__sub {
    margin: 0;
    color: var(--cust-text-muted);
    font-size: 12px;
    font-weight: 400;
}

.customer-head__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------- BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn i {
    font-size: 12px;
}

.btn-primary {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    color: var(--cust-text);
    background: var(--cust-card-bg);
    border-color: var(--cust-border);
    box-shadow: var(--cust-shadow-sm);
}

.btn-secondary:hover {
    background: var(--cust-bg);
    border-color: #cbd5e1;
    color: var(--cust-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 6px;
}

.btn-clear-filter {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-clear-filter:hover {
    background: #fecaca;
}

/* ------------------------------------------------------------- KPI CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-grid.g-auto-sm {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 18px;
    background: var(--cust-card-bg);
    border: 1px solid var(--cust-border);
    border-radius: 12px;
    box-shadow: var(--cust-shadow-sm);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cust-shadow-md);
}

.kpi-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 18px;
    flex-shrink: 0;
}

.kpi-card__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-card__title {
    color: var(--cust-text-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
}

.kpi-card__value {
    color: var(--cust-text);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 1px;
}

/* ------------------------------------------------------------- CARD & TOOLBAR */
.card {
    background: var(--cust-card-bg);
    border: 1px solid var(--cust-border);
    border-radius: 12px;
    box-shadow: var(--cust-shadow-sm);
    overflow: hidden;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cust-border-subtle);
    flex-wrap: wrap;
    background: var(--cust-card-bg);
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: min(320px, 100%);
}

.search-wrap i {
    position: absolute;
    left: 12px;
    color: var(--cust-text-sub);
    font-size: 12.5px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    background: var(--cust-bg);
    border: 1px solid var(--cust-border);
    border-radius: 8px;
    color: var(--cust-text);
    font-size: 12.5px;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.search-input:focus {
    border-color: var(--cust-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-input::placeholder {
    color: var(--cust-text-sub);
}

.select-filter {
    height: 36px;
    padding: 0 28px 0 12px;
    background: var(--cust-bg)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E")
        no-repeat right 9px center / 12px;
    border: 1px solid var(--cust-border);
    border-radius: 8px;
    color: var(--cust-text);
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease;
}

.select-filter:focus {
    border-color: var(--cust-primary);
}

.toolbar-spacer {
    flex: 1;
}

.chip-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--cust-bg);
    border: 1px solid var(--cust-border);
    border-radius: 6px;
    color: var(--cust-text-muted);
    font-size: 12px;
    font-weight: 600;
}

/* ------------------------------------------------------------- TABLE */
.customer-wide-table {
    position: relative;
    width: 100%;
}

.customer-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 10px;
    margin-bottom: -10px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.customer-scroll-top::-webkit-scrollbar {
    height: 6px;
}

.customer-scroll-top::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.tbl-wrap {
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.tbl-wrap::-webkit-scrollbar {
    height: 6px;
}

.tbl-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.tbl-main {
    width: 100%;
    min-width: 1060px;
    border-collapse: collapse;
    text-align: left;
    font-size: 12.5px;
}

.tbl-main thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 9px 12px;
    background: var(--cust-bg);
    color: var(--cust-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--cust-border);
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.tbl-main tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--cust-border-subtle);
    color: var(--cust-text);
    vertical-align: middle;
}

.tbl-main tbody tr {
    transition: background-color 0.12s ease;
}

.tbl-main tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.035);
}

.tbl-main tbody tr.row-selected {
    background-color: rgba(37, 99, 235, 0.08);
}

.tbl-main .center {
    text-align: center;
}
.tbl-main .right {
    text-align: right;
}
.tbl-main .font-bold {
    font-weight: 700;
}
.tbl-main .font-medium {
    font-weight: 500;
}
.tbl-main .num {
    font-variant-numeric: tabular-nums;
}
.tbl-main .strong {
    font-weight: 700;
}
.tbl-main .text-muted {
    color: var(--cust-text-muted);
}

.cust-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--cust-primary);
    cursor: pointer;
}

.cust-code {
    display: inline-block;
    color: var(--cust-primary);
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.cust-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
}

.customer-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
    user-select: none;
}

.customer-avatar.avatar--lg {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 15px;
}

.cust-name-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cust-name-title {
    font-size: 13px;
    font-weight: 650;
    color: var(--cust-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.cust-name-sub {
    font-size: 11.5px;
    color: var(--cust-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* ------------------------------------------------------------- STATUS PILL */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge--green {
    background: #e8f8f0;
    color: #059669;
}
.badge--green .status-dot {
    background: #10b981;
}

.badge--blue {
    background: #edf5ff;
    color: #2563eb;
}
.badge--blue .status-dot {
    background: #3b82f6;
}

.badge--slate {
    background: #f1f5f9;
    color: #64748b;
}
.badge--slate .status-dot {
    background: #94a3b8;
}

.badge--orange {
    background: #fff7ed;
    color: #ea580c;
}
.badge--orange .status-dot {
    background: #f97316;
}

/* ------------------------------------------------------------- CSKH BUTTON */
.btn-cskh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cskh:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
    transform: scale(1.02);
}

.cskh-count {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    margin-left: 1px;
}

/* ------------------------------------------------------------- ROW ACTIONS */
.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.row-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--cust-border);
    border-radius: 6px;
    background: var(--cust-card-bg);
    color: var(--cust-text-muted);
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.row-btn:hover {
    color: var(--cust-primary);
    border-color: var(--cust-primary);
    background: var(--cust-bg);
}

/* ------------------------------------------------------------- PAGINATION */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--cust-border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

.pagi-info {
    color: var(--cust-text-muted);
    font-size: 12px;
}

.pagi-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagi-cur {
    color: var(--cust-text);
    font-size: 12px;
    font-weight: 600;
}

.tbl-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--cust-text-muted);
}

.tbl-empty i {
    font-size: 36px;
    color: var(--cust-text-sub);
    margin-bottom: 12px;
    display: block;
}

.tbl-empty strong {
    display: block;
    font-size: 15px;
    color: var(--cust-text);
    margin-bottom: 6px;
}

.tbl-empty p {
    font-size: 12.5px;
    margin-bottom: 14px;
}

/* ------------------------------------------------------------- DRAWER */
.drawer-backdrop,
.app-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1040 !important;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.drawer-backdrop.is-active,
.app-drawer-backdrop.is-active {
    opacity: 1;
    pointer-events: auto !important;
}

.drawer-panel {
    width: min(540px, 92vw);
    height: 100vh;
    background: var(--cust-card-bg);
    box-shadow: var(--cust-shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto !important;
    z-index: 1045 !important;
}

.drawer-panel * {
    pointer-events: auto;
}

.drawer-panel.drawer-panel--wide {
    width: min(820px, 95vw);
}

.drawer-backdrop.is-active .drawer-panel,
.app-drawer-backdrop.is-active .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--cust-border);
    gap: 12px;
}

.drawer-header-cust {
    display: flex;
    align-items: center;
    gap: 13px;
}

.drawer-cust-name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--cust-text);
}

.drawer-cust-meta {
    font-size: 12px;
    color: var(--cust-text-muted);
    margin-top: 3px;
    font-weight: 500;
}

.drawer-close-btn,
.modal-close-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--cust-border);
    background: var(--cust-bg);
    color: var(--cust-text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.12s ease;
}

.drawer-close-btn:hover,
.modal-close-btn:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

.drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px 28px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.drawer-body::-webkit-scrollbar {
    width: 6px;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.drawer-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--cust-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--cust-card-bg);
}

/* ------------------------------------------------------------- TABS */
.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--cust-border);
    padding-bottom: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cust-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}

.tab-btn:hover {
    color: var(--cust-primary);
    background: var(--cust-bg);
}

.tab-btn.is-active {
    color: var(--cust-primary);
    background: #edf5ff;
}

body.theme-dark .tab-btn.is-active {
    background: #1e3a5f;
}

.tab-badge {
    display: inline-grid;
    place-items: center;
    padding: 2px 6px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
}

.drawer-sec-title,
.modal-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 12px;
    color: var(--cust-text);
    font-size: 13px;
    font-weight: 700;
}

.drawer-sec-title i,
.modal-sec-title i {
    color: var(--cust-primary);
    font-size: 13px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px 24px;
}

.customer-details-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.customer-details-grid .info-item:nth-child(2),
.customer-details-grid .info-item:nth-child(5) {
    grid-column: span 2;
}

.customer-contact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item__label {
    font-size: 11px;
    color: var(--cust-text-muted);
    margin-bottom: 2px;
    font-weight: 500;
}

.info-item__value {
    font-size: 13px;
    color: var(--cust-text);
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chart-container {
    position: relative;
    height: 180px;
    width: 100%;
    margin-top: 8px;
    background: var(--cust-bg);
    border: 1px solid var(--cust-border);
    border-radius: 10px;
    padding: 10px;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px;
    background: var(--cust-bg);
    border: 1px solid var(--cust-border);
    border-radius: 10px;
    margin-top: 14px;
    text-align: center;
}

.strip-label {
    font-size: 11.5px;
    color: var(--cust-text-muted);
}

.strip-val {
    font-size: 15px;
    margin-top: 4px;
}

/* ------------------------------------------------------------- CSKH LIST */
.cskh-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cskh-item {
    padding: 12px 14px;
    background: var(--cust-bg);
    border: 1px solid var(--cust-border);
    border-radius: 8px;
}

.cskh-item__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 11.5px;
    color: var(--cust-text-muted);
}

.cskh-type {
    font-weight: 700;
    color: var(--cust-primary);
}

.cskh-item__content {
    color: var(--cust-text);
    font-size: 13px;
    line-height: 1.5;
}

.cskh-empty {
    text-align: center;
    padding: 30px 10px;
    color: var(--cust-text-muted);
}

.cskh-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--cust-text-sub);
}

/* ------------------------------------------------------------- MODAL */
.modal-backdrop,
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1060 !important;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-backdrop.is-active,
.app-modal-backdrop.is-active {
    opacity: 1;
    pointer-events: auto !important;
}

.modal-dialog,
.app-modal-dialog {
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    background: var(--cust-card-bg);
    border-radius: 14px;
    box-shadow: var(--cust-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto !important;
    position: relative;
    z-index: 1065 !important;
    margin: 0; /* Reset Bootstrap margin */
}

.modal-dialog *,
.app-modal-dialog * {
    pointer-events: auto;
}

.modal-dialog--lg {
    max-width: 720px;
}
.modal-dialog--sm {
    max-width: 420px;
}

.modal-backdrop.is-active .modal-dialog,
.app-modal-backdrop.is-active .app-modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--cust-border);
}

.modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cust-text);
}

.modal-sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--cust-text-muted);
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--cust-border);
    background: var(--cust-card-bg);
}

/* ------------------------------------------------------------- FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--cust-text);
    margin-bottom: 4px;
}

.form-label .req {
    color: #ef4444;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--cust-bg);
    border: 1px solid var(--cust-border);
    border-radius: 8px;
    color: var(--cust-text);
    font-size: 12.5px;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--cust-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-error {
    display: none;
    font-size: 11px;
    color: #ef4444;
    margin-top: 3px;
    font-weight: 500;
}

.field.has-error .form-input,
.field.has-error .form-select,
.field.has-error .form-textarea {
    border-color: #ef4444;
    background: #fff5f5;
}

.field.has-error .field-error {
    display: block;
}

/* ------------------------------------------------------------- TIMELINE */
.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    padding-left: 20px;
}

.timeline-feed::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--cust-border);
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.timeline-badge {
    position: absolute;
    left: -20px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e8f8f0;
    color: #059669;
    display: grid;
    place-items: center;
    font-size: 8.5px;
    border: 2px solid var(--cust-card-bg);
}

.timeline-item--quote .timeline-badge {
    background: #eff6ff;
    color: #2563eb;
}

.timeline-item--contract .timeline-badge {
    background: #f5f3ff;
    color: #7c3aed;
}

.timeline-item--order .timeline-badge {
    background: #fff7ed;
    color: #ea580c;
}

.timeline-item--delivery .timeline-badge {
    background: #ecfdf5;
    color: #059669;
}

.timeline-body {
    display: flex;
    flex-direction: column;
}

.timeline-body strong {
    font-size: 13px;
    color: var(--cust-text);
}

.timeline-body p {
    margin: 2px 0 3px;
    font-size: 12px;
    color: var(--cust-text-muted);
}

.timeline-body small {
    font-size: 11px;
    color: var(--cust-text-sub);
}

/* ------------------------------------------------------------- DRAWER METRIC CARDS (IMAGE 4) */
.drawer-metric-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    background: var(--cust-card-bg);
    border: 1px solid var(--cust-border);
    border-radius: 10px;
    box-shadow: var(--cust-shadow-sm);
}

.drawer-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.drawer-metric-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.drawer-metric-title {
    color: var(--cust-text-muted);
    font-size: 11.5px;
    font-weight: 600;
}

.drawer-metric-val {
    color: var(--cust-text);
    font-size: 18px;
    font-weight: 700;
    margin-top: 1px;
}

/* ------------------------------------------------------------- CSKH CARDS (IMAGE 5) */
.cskh-card-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.cskh-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.cskh-card-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cskh-bubble-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 10px;
}

.cskh-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #edf5ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
}

.cskh-type-badge .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2563eb;
}

.cskh-author-date {
    color: var(--cust-text-muted);
    font-size: 11.5px;
}

.cskh-card-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cskh-time-text {
    color: var(--cust-text-sub);
    font-size: 11.5px;
}

.cskh-del-btn {
    border: 0;
    background: transparent;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.12s;
}

.cskh-del-btn:hover {
    background: #fee2e2;
}

.cskh-card-box {
    padding: 12px 14px;
    border: 1px solid var(--cust-border);
    border-radius: 8px;
    background: var(--cust-bg);
    color: var(--cust-text);
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .customer-head {
        flex-direction: column;
        align-items: stretch;
    }
    .customer-head__actions {
        width: 100%;
    }
    .customer-head__actions .btn {
        flex: 1;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .drawer-kpi-row {
        grid-template-columns: 1fr !important;
    }
    .info-grid {
        grid-template-columns: 1fr !important;
    }

    .customer-details-grid .info-item:nth-child(2),
    .customer-details-grid .info-item:nth-child(5) {
        grid-column: auto;
    }
}

@media (min-width: 769px) and (max-width: 980px) {
    .customer-details-grid,
    .customer-contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-details-grid .info-item:nth-child(2),
    .customer-details-grid .info-item:nth-child(5) {
        grid-column: span 1;
    }
}
