/* ===========================================================
   CUSTOMERS + SUPPLIERS (shared "contacts" styling)
   =========================================================== */

/* small avatar circle (for table rows) */
.contact-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6B5BFF, #8676FF);
}
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.contact-avatar.purple { background: linear-gradient(135deg, #6B5BFF, #8676FF); }
.contact-avatar.green  { background: linear-gradient(135deg, #27C96E, #22B864); }
.contact-avatar.amber  { background: linear-gradient(135deg, #FFB547, #FF9F3D); }
.contact-avatar.red    { background: linear-gradient(135deg, #FF6B81, #FF5252); }
.contact-avatar.blue   { background: linear-gradient(135deg, #3A7BFF, #5C8EFF); }
.contact-avatar.teal   { background: linear-gradient(135deg, #22C7C7, #00B8B8); }
.contact-avatar.pink   { background: linear-gradient(135deg, #FF7AB1, #FF66A8); }

.contact-name-cell {
    display: flex; align-items: center; gap: 10px;
    flex-direction: row-reverse;
}
.contact-name-cell .meta { text-align: end; line-height: 1.2; }
.contact-name-cell .meta .name { font-weight: 700; font-size: 13.5px; color: var(--c-text); }
.contact-name-cell .meta .sub  { color: var(--c-text-muted); font-size: 11.5px; margin-top: 2px; }

/* country flag chip */
.flag-chip { display: inline-flex; align-items: center; gap: 6px; }
.flag-chip .flag-svg { width: 22px; height: 16px; border-radius: 3px; background: #ccc; display: inline-block; flex-shrink: 0; overflow: hidden; position: relative; }

/* tier pills */
.tier-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 11.5px; }
.tier-pill .material-symbols-rounded { font-size: 14px; }
.tier-pill.premium  { background: var(--c-purple-soft); color: var(--c-purple); }
.tier-pill.gold     { background: var(--c-amber-soft); color: var(--c-amber); }
.tier-pill.regular  { background: var(--c-bg-soft); color: var(--c-text-muted); }
.tier-pill.walkin   { background: var(--c-teal-soft); color: var(--c-teal); }

/* phone link cell */
.phone-cell { display: inline-flex; align-items: center; gap: 6px; direction: ltr; color: var(--c-text-soft); }
.phone-cell .material-symbols-rounded { color: var(--c-primary); font-size: 16px; }

/* due / outstanding cell */
.due-cell { font-weight: 800; color: var(--c-text); font-size: 13px; }
.due-cell.due { color: var(--c-red); }
.due-cell.zero { color: var(--c-text-muted); font-weight: 600; }

/* ============================
   CUSTOMER DETAILS PAGE
   ============================ */
.cust-grid {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 1380px) { .cust-grid { grid-template-columns: 1fr; } }

/* Right column profile card */
.cust-profile {
    background: var(--c-surface);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    padding: 22px 18px;
    text-align: center;
    display: flex; flex-direction: column; gap: 14px;
}
.cust-profile .big-avatar {
    width: 110px; height: 110px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    display: grid; place-items: center;
    color: #fff; font-size: 38px; font-weight: 800;
    position: relative;
}
.cust-profile .big-avatar .cam-btn {
    position: absolute;
    inset-inline-end: 0; bottom: 0;
    width: 32px; height: 32px;
    background: var(--c-surface);
    color: var(--c-text-soft);
    border: 0;
    border-radius: 50%;
    box-shadow: var(--shadow-card);
    display: grid; place-items: center;
    cursor: pointer;
}
.cust-profile .pname { font-size: 17px; font-weight: 800; color: var(--c-text); }

.cust-metric {
    background: var(--c-surface-2);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
}
.cust-metric .lbl { color: var(--c-text-muted); font-size: 11.5px; font-weight: 600; margin-bottom: 4px; }
.cust-metric .v { font-size: 18px; font-weight: 800; color: var(--c-text); }
.cust-metric .v .small { font-size: 11px; color: var(--c-text-muted); font-weight: 500; margin-inline-start: 4px; }

.cust-contact-cta {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    color: #fff;
    border: 0; border-radius: 14px;
    height: 46px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 18px;
    box-shadow: 0 8px 18px rgba(107,91,255,0.35);
}
.cust-contact-cta .material-symbols-rounded { font-size: 20px; }

.cust-contact-list { display: flex; flex-direction: column; gap: 8px; }
.cust-contact-list .btn {
    justify-content: space-between;
    height: 44px;
}
.cust-contact-list .btn .material-symbols-rounded { font-size: 18px; }

/* Left column info card */
.cust-info-card {
    background: var(--c-surface);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    padding: 18px;
}
.cust-info-card h3 {
    margin: 0 0 14px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--c-text);
    display: flex; justify-content: space-between; align-items: center;
}
.cust-info-list { display: flex; flex-direction: column; gap: 12px; }
.cust-info-row {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--c-border);
}
.cust-info-row:last-of-type { border: 0; padding-bottom: 0; }
.cust-info-row .ico {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--c-surface-2);
    color: var(--c-text-soft);
    display: grid; place-items: center;
    flex-shrink: 0;
}
.cust-info-row .ico .material-symbols-rounded { font-size: 16px; }
.cust-info-row .v { flex: 1; text-align: end; color: var(--c-text); font-weight: 600; font-size: 13px; line-height: 1.4; direction: rtl; }
.cust-info-row .v.ltr { direction: ltr; text-align: end; }
.cust-info-row .ico-action { color: var(--c-green); cursor: pointer; }

/* Notes */
.cust-notes h3 { display: flex; justify-content: space-between; }
.cust-notes h3 a { color: var(--c-primary); font-size: 12px; font-weight: 700; }
.cust-note {
    background: var(--c-surface-2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    text-align: end;
}
.cust-note .when {
    color: var(--c-text-muted);
    font-size: 11px;
    margin-bottom: 4px;
}
.cust-note .body { color: var(--c-text); font-size: 12.5px; line-height: 1.5; }
.cust-note .author { color: var(--c-text-muted); font-size: 11px; margin-top: 6px; }

/* Center column */
.cust-center { display: flex; flex-direction: column; gap: 14px; }

.cust-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 720px) { .cust-kpis { grid-template-columns: repeat(2, 1fr); } }

.cust-chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
}
@media (max-width: 1100px) { .cust-chart-row { grid-template-columns: 1fr; } }

/* ============================
   SUPPLIERS DASHBOARD BOTTOM
   ============================ */
.sup-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}
@media (max-width: 1280px) { .sup-bottom { grid-template-columns: 1fr; } }

.sup-card {
    background: var(--c-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 18px;
}
.sup-card h3 {
    margin: 0 0 14px; font-size: 14.5px; font-weight: 800;
    color: var(--c-text); display: flex; justify-content: space-between; align-items: center;
}

.po-list { display: flex; flex-direction: column; gap: 10px; }
.po-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--c-border);
}
.po-row:last-child { border: 0; padding-bottom: 0; }
.po-row .ico {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--c-bg-soft);
    color: var(--c-text-muted);
    display: grid; place-items: center;
}
.po-row .meta { text-align: end; line-height: 1.2; }
.po-row .meta .pno { font-weight: 800; color: var(--c-text); font-size: 12.5px; }
.po-row .meta .sname { color: var(--c-text-muted); font-size: 11.5px; margin-top: 2px; }
.po-row .amt { font-weight: 800; color: var(--c-text); font-size: 13px; }
.po-row .amt .small { color: var(--c-text-muted); font-size: 10px; font-weight: 500; }

.sup-top-list { display: flex; flex-direction: column; gap: 12px; }
.sup-top-row { display: flex; flex-direction: column; gap: 6px; }
.sup-top-head { display: flex; align-items: center; justify-content: space-between; }
.sup-top-head .pct { font-weight: 800; color: var(--c-text); font-size: 12px; }
.sup-top-head .name { font-weight: 600; color: var(--c-text); font-size: 12.5px; }
.sup-top-head .amt { color: var(--c-text-muted); font-size: 11px; }
.sup-top-bar {
    height: 7px;
    background: var(--c-bg-soft);
    border-radius: 99px;
    overflow: hidden;
}
.sup-top-bar > div {
    height: 100%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    transition: width 360ms;
    border-radius: 99px;
}
