/*
 * Tristar dashboard header + unified login polish
 * Build: 2026-08-27
 *
 * This stylesheet is intentionally scoped to the main dashboard and login
 * screen so the shared application layout can continue to evolve separately.
 */

/* -------------------------------------------------------------------------
   Main dashboard hero
   ------------------------------------------------------------------------- */

.dashboard-hero {
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(22px, 3vw, 58px);
    padding: clamp(26px, 2.2vw, 42px) clamp(28px, 3vw, 56px);
    overflow: hidden;
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    left: -130px;
    bottom: -250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 66%);
    pointer-events: none;
}

.dashboard-hero-lockup {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(26px, 3.2vw, 62px);
}

.dashboard-logo-wrap {
    flex: 0 1 360px;
    min-width: 220px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.dashboard-hero-logo {
    display: block;
    width: min(100%, 360px);
    max-height: 122px;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.20));
}

.dashboard-hero-divider {
    flex: 0 0 1px;
    align-self: stretch;
    min-height: 92px;
    max-height: 118px;
    margin-block: auto;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(125, 211, 252, 0.34) 18%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(125, 211, 252, 0.34) 82%,
        transparent
    );
}

.dashboard-hero-copy {
    flex: 1 1 420px;
    min-width: 0;
    text-align: left;
}

.dashboard-hero-copy .eyebrow {
    margin-bottom: 7px;
    font-size: 12px;
    letter-spacing: 1.9px;
}

.dashboard-hero-copy h1 {
    margin: 0;
    font-size: clamp(32px, 2.8vw, 48px);
    line-height: 1.05;
    color: var(--text-hero);
}

.dashboard-hero-copy p {
    margin: 10px 0 0;
    max-width: 620px;
    color: var(--text-hero-muted);
    font-size: 14px;
    line-height: 1.5;
}

.dashboard-hero-actions {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-app-heading {
    margin-top: 2px;
}

@media (min-width: 1100px) and (max-height: 920px) {
    .dashboard-hero {
        min-height: 168px;
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .dashboard-hero-logo {
        max-height: 102px;
        width: min(100%, 320px);
    }

    .dashboard-hero-divider {
        min-height: 82px;
        max-height: 96px;
    }
}

@media (max-width: 900px) {
    .dashboard-hero {
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 22px;
        gap: 18px;
    }

    .dashboard-hero-lockup {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .dashboard-logo-wrap {
        min-width: 0;
        flex-basis: auto;
        justify-content: center;
    }

    .dashboard-hero-logo {
        width: min(70vw, 310px);
        max-height: 112px;
    }

    .dashboard-hero-divider {
        width: min(76%, 360px);
        height: 1px;
        min-height: 1px;
        max-height: 1px;
        align-self: center;
        background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.36), transparent);
    }

    .dashboard-hero-copy {
        flex-basis: auto;
        text-align: center;
    }

    .dashboard-hero-copy h1 {
        font-size: clamp(28px, 7vw, 38px);
    }

    .dashboard-hero-copy p {
        margin-inline: auto;
    }

    .dashboard-hero-actions {
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .dashboard-hero {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .dashboard-hero-logo {
        width: min(74vw, 260px);
        max-height: 94px;
    }

    .dashboard-hero-copy p {
        display: none;
    }

    .dashboard-hero-actions .btn:last-child {
        flex: 1 1 auto;
    }
}

/* -------------------------------------------------------------------------
   Unified staff / supplier login
   ------------------------------------------------------------------------- */

.login-site-subtitle {
    margin: 10px auto 0;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    line-height: 1.55;
}

body.light-mode .login-site-subtitle {
    color: #637089;
}

.login-card.login-access-card {
    max-width: 590px;
    padding: 18px;
}

.login-access-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-mode .login-access-switch {
    background: rgba(226, 232, 240, 0.72);
    border-color: rgba(16, 35, 61, 0.08);
}

.login-access-option {
    min-width: 0;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.68);
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.login-access-option:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.login-access-option.active {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(125, 211, 252, 0.35);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.05);
}

body.light-mode .login-access-option {
    color: #526077;
}

body.light-mode .login-access-option:hover {
    color: #10233d;
    background: rgba(255, 255, 255, 0.62);
}

body.light-mode .login-access-option.active {
    color: #10233d;
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.24);
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.08);
}

.login-access-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.08);
}

body.light-mode .login-access-icon {
    background: #eef5fb;
}

.login-access-option span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.login-access-option strong,
.login-access-option small {
    display: block;
}

.login-access-option strong {
    font-size: 14px;
    line-height: 1.2;
}

.login-access-option small {
    font-size: 11px;
    line-height: 1.25;
    opacity: 0.72;
}

.login-form-panel[hidden] {
    display: none !important;
}

.login-form-panel {
    padding: 8px 10px 10px;
}

.login-panel-heading {
    margin-bottom: 20px;
    text-align: center;
}

.login-panel-heading .login-form-title {
    margin-bottom: 7px;
}

.login-panel-heading p {
    margin: 0 auto;
    max-width: 480px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.5;
}

body.light-mode .login-panel-heading p {
    color: #64748b;
}

.login-form input[type="email"] {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 12px 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.login-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

.login-form input[type="email"]:focus {
    border-color: rgba(117, 160, 255, 0.85);
    box-shadow: 0 0 0 4px rgba(77, 124, 254, 0.14);
    background: rgba(255, 255, 255, 0.16);
}

body.light-mode .login-form input[type="email"] {
    border-color: rgba(16, 35, 61, 0.12);
    background: #ffffff;
    color: #10233d;
}

body.light-mode .login-form input[type="email"]::placeholder {
    color: rgba(16, 35, 61, 0.42);
}

body.light-mode .login-form input[type="email"]:focus {
    border-color: rgba(77, 124, 254, 0.72);
    box-shadow: 0 0 0 4px rgba(77, 124, 254, 0.12);
    background: #ffffff;
}

.supplier-login-submit {
    background: linear-gradient(135deg, #06a5a6, #087b8c);
    box-shadow: 0 12px 26px rgba(6, 165, 166, 0.24);
}

.login-help-text {
    margin: 18px 4px 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.56);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

body.light-mode .login-help-text {
    border-color: rgba(16, 35, 61, 0.08);
    color: #6b778b;
}

.login-error.login-notice {
    color: #eafcff;
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(125, 211, 252, 0.24);
}

body.light-mode .login-error.login-notice {
    color: #075985;
    background: #eefaff;
    border-color: #bae6fd;
}

@media (max-width: 720px) {
    .login-brand-wrap {
        padding-top: 0;
    }

    .login-logo {
        width: min(68vw, 300px);
        margin-bottom: 10px;
    }

    .login-site-subtitle {
        max-width: 420px;
        padding-inline: 8px;
        font-size: 13px;
    }

    .login-card.login-access-card {
        max-width: 540px;
        padding: 12px !important;
    }

    .login-form-panel {
        padding: 8px 6px 8px;
    }
}

@media (max-width: 470px) {
    .login-access-switch {
        grid-template-columns: 1fr;
    }

    .login-access-option {
        min-height: 58px;
    }

    .login-panel-heading .login-form-title {
        font-size: 22px;
    }
}

/* -------------------------------------------------------------------------
   Functional application panels
   Build: 2026-09-08
   ------------------------------------------------------------------------- */

.dashboard-app-heading {
    margin-bottom: 22px;
}

.dashboard-app-heading p {
    max-width: 760px;
    margin: 8px auto 0;
}

.dashboard-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.dashboard-module-panel {
    height: 390px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: relative;
}

.dashboard-module-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.65;
    pointer-events: none;
}

.dashboard-module-panel-header {
    min-height: 112px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.055), transparent);
}

.dashboard-module-panel-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    background: var(--bg-card-soft);
    border: 1px solid var(--border-soft);
    font-size: 23px;
}

.dashboard-module-panel-copy {
    min-width: 0;
}

.dashboard-module-panel-copy h3 {
    margin: 1px 0 6px;
    font-size: 20px;
    line-height: 1.15;
    color: var(--text-main);
}

.dashboard-module-panel-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.dashboard-module-count {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--bg-card-soft);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-module-apps {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.dashboard-module-app {
    min-width: 0;
    min-height: 82px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 13px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: var(--bg-card-soft);
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-module-app:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.10);
}

.dashboard-module-app-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 18px;
    background: rgba(56, 189, 248, 0.08);
}

.dashboard-module-app-copy {
    min-width: 0;
}

.dashboard-module-app-copy strong,
.dashboard-module-app-copy small {
    display: block;
}

.dashboard-module-app-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.3;
}

.dashboard-module-app-copy small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.dashboard-module-app-arrow {
    color: var(--primary);
    font-size: 22px;
    line-height: 1;
    transform: translateX(0);
    transition: transform 0.16s ease;
}

.dashboard-module-app:hover .dashboard-module-app-arrow {
    transform: translateX(3px);
}

@media (max-width: 780px) {
    .dashboard-panel-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-module-panel {
        height: 390px;
    }
}

@media (max-width: 480px) {
    .dashboard-panel-grid {
        gap: 14px;
    }

    .dashboard-module-panel {
        height: 390px;
        border-radius: 20px;
    }

    .dashboard-module-panel-header {
        min-height: 104px;
        padding: 18px 16px 15px;
    }

    .dashboard-module-apps {
        grid-template-columns: 1fr;
        padding: 13px;
    }

    .dashboard-module-app {
        min-height: 66px;
    }
}
