/*
 * Hub-only styles. Loaded AFTER Shared.UI Tailwind.
 * Rules MUST NOT reuse Tailwind utility names (.grid, .flex, .btn as display helpers, etc.).
 */

:root {
    --hub-mint: #3fb585;
    --hub-pearl: #e8eeec;
    --hub-light: #c5d0cb;
    --hub-dust: rgba(168, 181, 176, 0.55);
    --hub-dark: #1c2221;
    --hub-soft: #343e3c;
    --hub-danger: #f87171;
}

/* Portal home / analyses — scoped so they never restyle AdminShell chrome */
.content {
    max-width: 1080px;
    margin: 1.5rem auto;
    padding: 0 1.5rem 2rem;
    color: var(--hub-light);
}

.content h1 {
    font-size: 1.5rem;
    margin: 0 0 0.35rem;
    color: var(--hub-pearl);
}

.content h2 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--hub-pearl);
}

.content .muted,
.muted {
    color: var(--hub-dust);
}

.hint,
.note {
    color: var(--hub-dust);
    font-size: 0.85rem;
}

.note {
    margin-top: 0.75rem;
}

.error {
    color: var(--hub-danger);
    font-weight: 600;
}

.content .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.content .card {
    display: block;
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    color: var(--hub-light);
    text-decoration: none;
}

.content .card.action:hover {
    border-color: var(--hub-mint);
    color: var(--hub-pearl);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.content .card h2 {
    margin: 0 0 0.35rem;
    color: var(--hub-pearl);
}

.content .card p {
    margin: 0.2rem 0;
    color: var(--hub-dust);
    font-size: 0.9rem;
}

.site-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: var(--hub-light);
}

.status {
    margin-left: 0.6rem;
    font-size: 0.72rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
}

.status.ok {
    background: rgba(63, 181, 133, 0.2);
    color: var(--hub-mint);
}

.status.warn {
    background: rgba(217, 119, 6, 0.25);
    color: #fbbf24;
}

.hub-btn,
button.hub-btn-primary {
    cursor: pointer;
    border: 2px solid var(--hub-mint);
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    background: transparent;
    color: var(--hub-mint);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

.hub-btn:hover,
button.hub-btn-primary:hover {
    background: rgba(63, 181, 133, 0.12);
    text-decoration: none;
    color: var(--hub-pearl);
}

/* Back-compat portal buttons — scoped so they never override AdminShell / accounting */
.login-wrap .btn,
.content .btn,
.profiles .btn {
    cursor: pointer;
    border: 2px solid var(--hub-mint);
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    background: transparent;
    color: var(--hub-mint);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

.login-wrap .btn:hover,
.content .btn:hover,
.profiles .btn:hover,
.login-wrap button.primary:hover,
.content button.primary:hover,
.profiles button.primary:hover {
    background: rgba(63, 181, 133, 0.12);
    text-decoration: none;
    color: var(--hub-pearl);
}

.login-wrap button.primary,
.content button.primary,
.profiles button.primary {
    cursor: pointer;
    border: 2px solid var(--hub-mint);
    border-radius: 8px;
    padding: 0.6rem;
    font-size: 0.9rem;
    background: transparent;
    color: var(--hub-mint);
    font-weight: 600;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #282828;
}

.login-card {
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--hub-light);
}

.login-card h1 {
    margin: 0;
    color: var(--hub-pearl);
}

.login-card form,
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1rem;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--hub-dust);
}

.login-card input {
    padding: 0.55rem 0.7rem;
    border: 2px solid var(--hub-dust);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--hub-soft);
    color: var(--hub-pearl);
}

.login-card input:focus {
    outline: none;
    border-color: var(--hub-mint);
}

.hub-client-switcher {
    position: relative;
}

.hub-client-switcher > summary {
    cursor: pointer;
    list-style: none;
}

.hub-client-switcher > summary::-webkit-details-marker {
    display: none;
}

.hub-client-switcher__list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 180px;
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 50;
}

.hub-client-switcher__current {
    padding: 0.35rem 0.55rem;
    color: var(--hub-dust);
    font-weight: 600;
    font-size: 0.85rem;
}

.hub-client-switcher__list a {
    display: block;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    color: var(--hub-light);
    text-decoration: none;
    font-size: 0.88rem;
}

.hub-client-switcher__list a:hover {
    background: rgba(63, 181, 133, 0.15);
    color: var(--hub-pearl);
}

.period-picker {
    margin: 1rem 0;
}

.period-picker select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 2px solid var(--hub-dust);
    margin-left: 0.5rem;
    background: var(--hub-dark);
    color: var(--hub-light);
}

.vat-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.vat-box {
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vat-box .label {
    color: var(--hub-dust);
    font-size: 0.78rem;
}

.vat-box .val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hub-pearl);
}

.vat-box.net.due {
    border-color: var(--hub-danger);
}

.vat-box.net.recover {
    border-color: var(--hub-mint);
}

/* Do NOT name this .grid — that name is a Tailwind utility used by accounting cards */
.hub-data-grid {
    width: 100%;
    border-collapse: collapse;
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 8px;
    overflow: hidden;
}

.hub-data-grid th,
.hub-data-grid td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--hub-dust);
    text-align: left;
    font-size: 0.88rem;
    color: var(--hub-light);
}

.hub-data-grid th {
    background: rgba(0, 0, 0, 0.25);
    color: var(--hub-dust);
    font-weight: 600;
}

.hub-data-grid td.num,
.hub-data-grid th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bar-track {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    height: 14px;
    width: 100%;
    min-width: 120px;
    overflow: hidden;
}

.bar-fill {
    background: var(--hub-mint);
    height: 100%;
    border-radius: 4px;
    transition: width 0.2s ease;
}

.placeholder {
    background: var(--hub-dark);
    border: 2px dashed var(--hub-dust);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    color: var(--hub-dust);
}

.profile-box {
    background: var(--hub-dark);
    border: 2px solid var(--hub-dust);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
}

.profile-box summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--hub-pearl);
}

.profile-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.profile-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--hub-dust);
}

.profile-form input {
    padding: 0.4rem 0.5rem;
    border: 2px solid var(--hub-dust);
    border-radius: 6px;
    background: var(--hub-soft);
    color: var(--hub-pearl);
}
