/* Global strip — inside breadcrumb row, for USD and universal metrics */
#dashboard-global-strip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    float: right;
}

.breadcrumbs {
    display: flex !important;
    align-items: center !important;
}

/* Dashboard notification strip — sits between #branding and #user-tools */
#dashboard-strip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 3px;
    flex: 1;
    padding: 2px 25px 2px 15px;
    overflow: hidden;
    min-width: 0;
}

#dashboard-strip.loading {
    opacity: 0.5;
}

/* Each row within the strip */
.dashboard-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Individual metric pill */
.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    color: #000;
    background: #f0f0f0;
    border: 1px solid #ddd;
    cursor: default;
    transition: background 0.2s;
    position: relative;
}

a.dash-pill {
    cursor: pointer;
}

a.dash-pill:hover {
    background: #e0e0e0;
    color: #000;
    text-decoration: none;
}

.dash-pill .pill-emoji {
    font-size: 12px;
}

.dash-pill .pill-value {
    font-weight: 700;
    font-size: 12px;
    color: #000;
}

.dash-pill .pill-label {
    font-weight: 400;
    color: #000;
}

/* Color variants — backgrounds change but text stays black/bold */
.dash-pill.color-warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.dash-pill.color-critical {
    background: #f8d7da;
    border-color: #dc3545;
}

.dash-pill.color-info {
    background: #d1ecf1;
    border-color: #17a2b8;
}

/* All pill text forced black regardless of color variant */
.dash-pill.color-warning .pill-value,
.dash-pill.color-warning .pill-label,
.dash-pill.color-critical .pill-value,
.dash-pill.color-critical .pill-label,
.dash-pill.color-info .pill-value,
.dash-pill.color-info .pill-label {
    color: #000;
}

/* Refresh button */
#dashboard-refresh {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: transform 0.3s;
}

#dashboard-refresh:hover {
    background: #e8e8e8;
}

#dashboard-refresh.spinning {
    animation: dash-spin 0.8s linear infinite;
}

@keyframes dash-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* "Ver más" link button */
#dashboard-overflow-btn,
a#dashboard-overflow-btn,
a#dashboard-overflow-btn:link,
a#dashboard-overflow-btn:visited {
    background: #0076f1 !important;
    border: 1px solid #005bb5 !important;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    color: #fff !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

a#dashboard-overflow-btn:hover {
    background: #005bb5 !important;
    color: #fff !important;
}

/* Detail tooltip */
.dash-pill[data-detail]:hover::after {
    content: attr(data-detail);
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: pre-wrap;
    max-width: 300px;
    z-index: 1002;
    pointer-events: none;
}

/* PIN modal */
#dashboard-pin-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#dashboard-pin-modal.visible {
    display: flex;
}

#dashboard-pin-modal .pin-dialog {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
}

#dashboard-pin-modal .pin-dialog h3 {
    margin: 0 0 12px;
    font-size: 14px;
}

#dashboard-pin-modal .pin-dialog input {
    width: 100%;
    padding: 8px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#dashboard-pin-modal .pin-dialog .pin-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
}

#dashboard-pin-modal .pin-dialog .pin-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

#dashboard-pin-modal .pin-dialog button {
    padding: 6px 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 13px;
}

#dashboard-pin-modal .pin-dialog button.primary {
    background: #0076f1;
    color: white;
    border-color: #0076f1;
}

/* Make header a flex container */
#header {
    display: flex !important;
    align-items: center !important;
}

#header #branding {
    flex-shrink: 0;
}

#header #user-tools {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 11px;
    text-align: right;
    line-height: 1.6;
}
