:root {
    --wht-blue: #173a8f;
    --wht-blue-2: #2563eb;
    --wht-ink: #0f172a;
    --wht-muted: #64748b;
    --wht-line: #dbe3f0;
    --wht-bg: #f4f7fb;
    --wht-panel: #ffffff;
    --wht-orange: #ff9100;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", system-ui, sans-serif;
}

.customer-login {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    background: #06142f;
}

.login-bg,
.login-bg__overlay,
.login-particles {
    position: fixed;
    inset: 0;
}

.login-bg {
    z-index: 0;
}

.login-bg__slide {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.login-bg__slide--active {
    opacity: 1;
}

.login-bg__overlay {
    z-index: 1;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .3), transparent 28rem),
        linear-gradient(135deg, rgba(23, 58, 143, .88), rgba(6, 20, 47, .94));
}

.login-particles {
    z-index: 2;
    pointer-events: none;
}

.particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.login-container {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-logo img {
    width: 12rem;
    height: auto;
    filter: drop-shadow(0 1rem 2rem rgba(0, 0, 0, .35));
}

.login-card {
    width: min(100%, 28rem);
    padding: 2rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2rem 6rem rgba(0, 0, 0, .32);
    backdrop-filter: blur(18px);
}

.login-card__header {
    margin-bottom: 2rem;
    text-align: center;
}

.login-card__title,
.topbar-title,
.section-heading h2,
.section-heading h3,
.info-panel h3 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    letter-spacing: 0;
}

.login-card__title {
    margin: 0 0 .5rem;
    color: var(--wht-blue);
    font-size: clamp(2rem, 8vw, 2.6rem);
    font-weight: 800;
}

.login-card__subtitle {
    margin: 0;
    color: var(--wht-muted);
}

.form-group,
.panel-form label,
.reply-form label,
.mini-action-form label {
    display: grid;
    gap: .5rem;
}

.form-label,
.panel-form label span,
.reply-form label span,
.mini-action-form label span {
    font-weight: 700;
    color: #243044;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-input,
.panel-form input,
.panel-form select,
.panel-form textarea,
.reply-form input,
.reply-form textarea,
.mini-action-form input,
.mini-action-form textarea {
    width: 100%;
    border: 1px solid var(--wht-line);
    border-radius: .5rem;
    background: #fff;
    padding: .9rem 1rem;
    color: var(--wht-ink);
    outline: none;
}

.form-input:focus,
.panel-form input:focus,
.panel-form select:focus,
.panel-form textarea:focus,
.reply-form input:focus,
.reply-form textarea:focus,
.mini-action-form input:focus,
.mini-action-form textarea:focus {
    border-color: var(--wht-blue-2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.staff-search {
    display: grid;
    gap: 1rem;
    align-items: end;
}

.staff-search label {
    display: grid;
    gap: .5rem;
    font-weight: 700;
    color: #243044;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 3.2rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: .7rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--wht-muted);
    cursor: pointer;
}

.login-options,
.form-actions,
.section-heading--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.login-options {
    margin: 1.25rem 0;
    font-size: .9rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--wht-muted);
}

.forgot-password {
    color: var(--wht-blue);
    font-weight: 700;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    border-radius: .5rem;
    border: 0;
    padding: .8rem 1.1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    background: var(--wht-blue);
    color: #fff;
    box-shadow: 0 .7rem 1.4rem rgba(23, 58, 143, .24);
}

.btn-primary--inline {
    width: auto;
}

.btn-secondary {
    background: #eaf0fb;
    color: var(--wht-blue);
}

.btn-loader {
    display: none;
}

.form-message {
    margin-bottom: 1rem;
    border-radius: .5rem;
    padding: .85rem 1rem;
    font-weight: 700;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
}

.form-message.success {
    background: #dcfce7;
    color: #14532d;
}

.form-message.success p {
    margin: 0 0 .35rem;
    font-weight: 700;
}

.form-message.success p:last-child {
    margin-bottom: 0;
}

.profile-alert {
    display: flex;
    align-items: center;
    gap: .9rem;
    border: 1px solid #fecaca;
    border-radius: .5rem;
    background: #fff1f2;
    color: #7f1d1d;
    padding: .9rem 1rem;
}

.profile-alert form {
    margin-left: auto;
}

.profile-alert--link {
    color: #7f1d1d;
    text-decoration: none;
}

.profile-alert--valid {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #14532d;
}

.profile-alert--valid p {
    color: #166534;
}

.profile-alert strong,
.profile-alert p {
    margin: 0;
}

.profile-alert p {
    color: #991b1b;
}

.profile-alert__badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    animation: profile-alert-pulse 1.15s ease-in-out infinite;
}

.profile-alert--valid .profile-alert__badge {
    background: #16a34a;
    animation: none;
}

@keyframes profile-alert-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .58;
        transform: scale(.96);
    }
}

.form-hint {
    color: var(--wht-muted);
    font-size: .9rem;
    margin: 0 0 1rem;
}

.field-hint {
    color: var(--wht-muted);
    font-size: .86rem;
}

.credentials-card {
    background: #f4f6fb;
    border: 1px solid var(--wht-line);
    border-radius: .6rem;
    padding: 1rem 1.1rem;
    margin: 1rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.credentials-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.credentials-label {
    flex: 0 0 9rem;
    font-weight: 700;
    color: var(--wht-muted);
    font-size: .9rem;
}

.credentials-value {
    flex: 1 1 auto;
    background: #fff;
    border: 1px solid var(--wht-line);
    border-radius: .4rem;
    padding: .5rem .75rem;
    font-family: Consolas, Menlo, monospace;
    font-size: .95rem;
    word-break: break-all;
}

.login-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--wht-line);
    text-align: center;
    color: var(--wht-muted);
}

.back-home,
.login-language {
    position: fixed;
    z-index: 4;
    top: 1.25rem;
}

.back-home {
    left: 1.25rem;
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: .7rem 1rem;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
    text-decoration: none;
    font-weight: 800;
}

.login-language {
    right: 1.25rem;
}

.language-select {
    border: 1px solid rgba(148, 163, 184, .4);
    border-radius: .5rem;
    background: rgba(255, 255, 255, .94);
    padding: .55rem .7rem;
    color: var(--wht-ink);
    font-weight: 800;
}

.customer-app {
    min-height: 100vh;
    margin: 0;
    background: var(--wht-bg);
    color: var(--wht-ink);
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: 17rem;
    transform: translateX(-100%);
    flex-direction: column;
    background: #071735;
    padding: 1rem;
    transition: transform .2s ease;
}

.app-sidebar.is-open {
    transform: translateX(0);
}

.sidebar-brand {
    display: block;
    padding: .5rem .25rem 1.25rem;
}

.sidebar-brand img {
    width: 9rem;
    height: auto;
}

.sidebar-nav {
    display: grid;
    gap: .4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: .5rem;
    padding: .85rem;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 800;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(37, 99, 235, .2);
    color: #fff;
}

.sidebar-link--button {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sidebar-footer {
    margin-top: auto;
}

.nav-icon {
    width: 1.25rem;
    text-align: center;
}

.app-main {
    min-height: 100vh;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--wht-line);
    background: rgba(244, 247, 251, .9);
    padding: .9rem 1rem;
    backdrop-filter: blur(12px);
}

.icon-button {
    border: 1px solid var(--wht-line);
    border-radius: .5rem;
    background: #fff;
    padding: .55rem .7rem;
    font-weight: 800;
}

.topbar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 .2rem;
    color: var(--wht-blue-2);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.user-chip {
    display: none;
    border: 1px solid var(--wht-line);
    border-radius: 999px;
    background: #fff;
    padding: .55rem .85rem;
    color: #334155;
    font-weight: 800;
}

.app-content {
    padding: 1rem;
}

.page-stack {
    display: grid;
    gap: 1rem;
}

.section-heading h2,
.section-heading h3 {
    margin: 0;
    color: #10224a;
    font-size: clamp(1.5rem, 5vw, 2.3rem);
    font-weight: 800;
}

.metric-grid,
.details-grid,
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.metric-card,
.info-panel,
.panel-section {
    border: 1px solid var(--wht-line);
    border-radius: .5rem;
    background: var(--wht-panel);
    padding: 1rem;
    box-shadow: 0 1rem 2.4rem rgba(15, 23, 42, .06);
}

.metric-card span {
    display: block;
    color: var(--wht-muted);
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-top: .35rem;
    color: var(--wht-blue);
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-size: 2rem;
}

.ticket-list,
.compact-list,
.conversation-list {
    display: grid;
    gap: .75rem;
}

.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--wht-line);
    border-radius: .5rem;
    padding: .9rem;
    color: var(--wht-ink);
    text-decoration: none;
}

.ticket-row small,
.compact-list small,
.message-bubble small {
    display: block;
    margin-top: .2rem;
    color: var(--wht-muted);
}

.status-pill {
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill--open,
.status-pill--resolved {
    background: #dcfce7;
    color: #166534;
}

.status-pill--waiting_customer {
    background: #ffedd5;
    color: #c2410c;
}

.status-pill--waiting_staff {
    background: #fee2e2;
    color: #b91c1c;
}

.status-pill--closed {
    background: #111827;
    color: #f9fafb;
}

.data-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .4rem;
    margin: 0;
}

.data-list dt {
    color: var(--wht-muted);
    font-weight: 800;
}

.data-list dd {
    margin: 0 0 .6rem;
    font-weight: 700;
}

.panel-form,
.reply-form,
.mini-action-form {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--wht-line);
    border-radius: .5rem;
    background: #fff;
    padding: 1rem;
}

.mini-action-form--compact {
    align-content: start;
    background: #f8fafc;
}

.mini-action-form--compact p,
.ticket-action-row p {
    margin: 0;
    color: var(--wht-muted);
    font-weight: 700;
}

.profile-checkbox {
    align-content: center;
    align-items: center;
    display: flex;
    min-height: 3rem;
}

.conversation-panel {
    display: grid;
    gap: 1rem;
}

.ticket-actions-panel {
    display: grid;
    gap: 1rem;
}

.ticket-action-row,
.ticket-action-grid {
    display: grid;
    gap: 1rem;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 100%;
    border: 1px solid rgba(37, 99, 235, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--wht-blue);
    padding: .35rem .65rem;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 800;
}

.attachment-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-chip small {
    margin: 0;
    white-space: nowrap;
}

.message-bubble {
    max-width: 46rem;
    border-radius: .5rem;
    padding: .9rem;
}

.message-bubble--customer {
    margin-left: auto;
    background: #dbeafe;
}

.message-bubble--staff {
    margin-right: auto;
    background: #f1f5f9;
}

.empty-state {
    margin: 0;
    color: var(--wht-muted);
}

@media (min-width: 768px) {
    .app-sidebar {
        transform: none;
    }

    .app-main {
        padding-left: 17rem;
    }

    .app-content {
        padding: 1.5rem;
    }

    .metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .details-grid,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-search {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ticket-action-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .ticket-action-grid {
        grid-template-columns: minmax(0, 1fr) minmax(14rem, .35fr);
        align-items: start;
    }

    .user-chip {
        display: block;
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 1.4rem;
    }

    .login-logo img {
        width: 9rem;
    }

    .back-home {
        top: auto;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
    }

    .login-options,
    .section-heading--row,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
