/* Profile dropdown (topbar avatar) — see profddInit() in 165_appMARC.js */

/* ============================================================
   Container
   ============================================================ */
.profdd {
    width: 320px;
    border-radius: 14px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 8px 24px rgba(15, 23, 42, .08),
        0 24px 48px rgba(15, 23, 42, .10);
}
[data-bs-theme="dark"] .profdd {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .3),
        0 12px 32px rgba(0, 0, 0, .45);
}

/* ============================================================
   Header — avatar + name + plan
   ============================================================ */
.profdd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease;
}
.profdd-header:hover { background: var(--hover-color); }
.profdd-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--bs-border-color);
}
.profdd-header-info { flex: 1; min-width: 0; }
.profdd-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.profdd-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted-color);
}
.profdd-meta-sep { opacity: .5; }
.profdd-plan-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(167, 139, 250, .12);
    border: 1px solid rgba(167, 139, 250, .25);
}
.profdd-plan-icon { font-size: 12px; color: #8b5cf6; }
.profdd-plan-name {
    font-size: 11px;
    font-weight: 600;
    color: #6d28d9;
    letter-spacing: .02em;
}
[data-bs-theme="dark"] .profdd-plan-row {
    background: rgba(167, 139, 250, .18);
    border-color: rgba(167, 139, 250, .35);
}
[data-bs-theme="dark"] .profdd-plan-name { color: #c4b5fd; }
.profdd-plan-pill { display: none; }

/* Pill bonito que muestra el nombre del plan en la cabecera de "Plan capacity". */
.profdd-plan-cap-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(139, 92, 246, .12), rgba(99, 102, 241, .12));
    color: #7c3aed;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.profdd-plan-cap-pill .ti { font-size: 14px; }
[data-bs-theme="dark"] .profdd-plan-cap-pill {
    background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(99, 102, 241, .22));
    color: #c4b5fd;
}

/* ============================================================
   Subscription card (dentro de profdd-section[Plan])
   ============================================================ */
.profdd-sub-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(139,92,246,.16));
    border: 1px solid rgba(99,102,241,.28);
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.profdd-sub-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(99,102,241,.18);
    border-color: rgba(99,102,241,.5);
    text-decoration: none;
}
.profdd-sub-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,.35);
}
.profdd-sub-card-icon .ti { font-size: 20px; color: #fff; }
.profdd-sub-card-text { flex: 1; min-width: 0; }
.profdd-sub-card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6366f1;
    opacity: .9;
    margin-bottom: 2px;
}
.profdd-sub-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profdd-sub-card-arrow {
    color: #6366f1;
    font-size: 18px;
    opacity: .55;
    flex-shrink: 0;
}
.profdd-sub-card:hover .profdd-sub-card-arrow { opacity: .9; transform: translateX(2px); transition: transform .15s ease, opacity .15s ease; }
[data-bs-theme="dark"] .profdd-sub-card {
    background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.22));
    border-color: rgba(167,139,250,.3);
}
[data-bs-theme="dark"] .profdd-sub-card-name { color: #f3f4f6; }
[data-bs-theme="dark"] .profdd-sub-card-label { color: #c4b5fd; }
[data-bs-theme="dark"] .profdd-sub-card-arrow { color: #c4b5fd; }

/* ============================================================
   Sections (Balance, Plan capacity)
   ============================================================ */
.profdd-section {
    margin: 6px 4px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, .025);
    border: 1px solid rgba(15, 23, 42, .04);
}
[data-bs-theme="dark"] .profdd-section {
    background: rgba(255, 255, 255, .025);
    border-color: rgba(255, 255, 255, .04);
}
.profdd-section.profdd-cap-hidden { display: none; }
.profdd-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.profdd-eyebrow {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted-color);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ============================================================
   Balance
   ============================================================ */
.profdd-row-balance {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.profdd-balance-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -.01em;
    line-height: 1.1;
    margin-top: 4px;
}
.profdd-balance-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.profdd-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted-color);
    font-size: 14px;
    border-radius: 6px;
    transition: background .12s, color .12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profdd-icon-btn:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

.profdd-btn-primary, .profdd-btn-secondary {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 7px;
    text-decoration: none;
    transition: opacity .12s, background .12s, transform .08s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}
.profdd-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    box-shadow: 0 1px 2px rgba(99, 102, 241, .25);
}
.profdd-btn-primary:hover {
    opacity: .92;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.profdd-btn-secondary {
    background: var(--bs-body-bg);
    color: var(--text-color);
    border: 1px solid var(--bs-border-color);
}
.profdd-btn-secondary:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

/* ============================================================
   Plan capacity
   ============================================================ */
.profdd-warn-pill {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(239, 68, 68, .12);
    color: #c92a2a;
    border: 1px solid rgba(239, 68, 68, .35);
}
[data-bs-theme="dark"] .profdd-warn-pill {
    background: rgba(239, 68, 68, .18);
    color: #ff7575;
    border-color: rgba(239, 68, 68, .4);
}
.profdd-warn-pill .ti { font-size: 11px; color: inherit; }
.profdd-empty {
    color: var(--text-muted-color);
    font-size: 11px;
    text-align: center;
    padding: 6px 0;
}

.profdd-cap-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
    border-top: 1px solid var(--bs-border-color);
}
.profdd-cap-row:first-child { border-top: none; padding-top: 2px; }
.profdd-cap-row:last-child { padding-bottom: 2px; }
.profdd-cap-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-color);
}
.profdd-cap-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.profdd-cap-warn-icon { color: #c92a2a; font-size: 12px; }
[data-bs-theme="dark"] .profdd-cap-warn-icon { color: #ff7575; }
.profdd-cap-value {
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    color: var(--text-muted-color);
    white-space: nowrap;
}
.profdd-cap-sep { opacity: .5; margin: 0 1px; }
.profdd-cap-row-over .profdd-cap-value { color: #c92a2a; font-weight: 600; }
[data-bs-theme="dark"] .profdd-cap-row-over .profdd-cap-value { color: #ff7575; }
.profdd-cap-row-critical .profdd-cap-label { color: var(--text-color); font-weight: 600; }
.profdd-cap-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(15, 23, 42, .08);
    overflow: hidden;
}
[data-bs-theme="dark"] .profdd-cap-bar { background: rgba(255, 255, 255, .08); }
.profdd-cap-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: #22c55e;
    transition: width .3s ease, background-color .2s ease;
}
.profdd-cap-row-over .profdd-cap-bar-fill {
    background: #ef4444;
    width: 100% !important;
}

.profdd-cap-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s ease, transform .08s ease, box-shadow .15s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, .2);
}
.profdd-cap-cta:hover {
    opacity: .94;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.profdd-cap-cta .ti { font-size: 13px; }

/* ============================================================
   Topbar dot indicator (master + over users/contacts)
   ============================================================ */
li.nav-item.dropdown[data-cap-warn="true"] > a { position: relative; }
li.nav-item.dropdown[data-cap-warn="true"] > a::after {
    content: "";
    position: absolute;
    top: 1px;
    right: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid var(--bs-body-bg);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .5);
    animation: profddCapDotPulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes profddCapDotPulse {
    0%   { box-shadow: 0 0 0 0   rgba(239, 68, 68, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0); }
}

/* ============================================================
   Links
   ============================================================ */
.profdd-links { padding: 4px 4px; }
.profdd-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}
.profdd-link:hover {
    background: var(--hover-color);
    color: var(--text-color);
}

/* Theme switcher */
.profdd-theme-row { cursor: default; }
.profdd-theme-row:hover { background: transparent; }
.profdd-theme-buttons {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: rgba(15, 23, 42, .05);
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}
[data-bs-theme="dark"] .profdd-theme-buttons {
    background: rgba(255, 255, 255, .05);
}
.profdd-theme-buttons button {
    width: 28px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted-color);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, color .12s ease;
}
.profdd-theme-buttons button:hover {
    background: var(--bs-body-bg);
    color: var(--text-color);
}

/* Logout */
.profdd-logout {
    margin-top: 4px;
    border-top: 1px solid var(--bs-border-color);
    padding-top: 4px;
}
.profdd-logout .profdd-link {
    color: var(--text-muted-color);
    font-size: 12px;
}
.profdd-logout .profdd-link:hover {
    background: rgba(239, 68, 68, .08);
    color: #c92a2a;
}
[data-bs-theme="dark"] .profdd-logout .profdd-link:hover {
    background: rgba(239, 68, 68, .12);
    color: #ff7575;
}

/* === Refinos light: botones primarios con ring + highlight + sombra rica === */
[data-bs-theme="light"] .profdd-btn-primary,
[data-bs-theme="light"] .profdd-cap-cta {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff !important;
    box-shadow:
        0 1px 2px rgba(79, 70, 229, .25),
        0 0 0 1px rgba(99, 102, 241, .15),
        inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: background .18s ease, box-shadow .18s ease, transform .08s ease;
}
[data-bs-theme="light"] .profdd-btn-primary *,
[data-bs-theme="light"] .profdd-cap-cta * {
    color: #fff !important;
}
[data-bs-theme="light"] .profdd-btn-primary:hover,
[data-bs-theme="light"] .profdd-cap-cta:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff !important;
    box-shadow:
        0 6px 18px rgba(79, 70, 229, .40),
        0 0 0 1px rgba(99, 102, 241, .30),
        inset 0 1px 0 rgba(255, 255, 255, .35);
    transform: translateY(-1px);
    opacity: 1;
}
[data-bs-theme="light"] .profdd-btn-primary:active,
[data-bs-theme="light"] .profdd-cap-cta:active {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(79, 70, 229, .35),
        0 0 0 1px rgba(99, 102, 241, .25),
        inset 0 1px 2px rgba(0, 0, 0, .15);
}
