:root {
    --brand-primary: #0d6efd;
    --brand-secondary: #6610f2;
    --brand-accent: #f8f9fa;
    --brand-text: #212529;
    --sidebar-width: 280px;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(102, 16, 242, 0.12));
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--brand-text);
}

.dashboard-body {
    min-height: 100vh;
    background: #f5f6fa;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    border: none;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #ffffffee;
    backdrop-filter: blur(6px);
    box-shadow: 0 1.2rem 2.4rem rgba(13, 110, 253, 0.15);
}

.auth-card__header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    padding: 2.5rem 2rem 2rem;
}

.auth-card__header h1 {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.auth-card__header p {
    margin: 0;
    opacity: 0.85;
}

.auth-card__body {
    padding: 2rem 2.5rem 2.25rem;
}

.auth-card form .form-control,
.auth-card form .form-select {
    border-radius: 0.9rem;
    padding: 0.75rem 1rem;
}

.auth-card form .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.auth-card .btn-primary {
    border-radius: 0.9rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 0.75rem 1.75rem rgba(13, 110, 253, 0.35);
}

.auth-card__footer {
    padding: 0 2.5rem 2.25rem;
}

.auth-footer-link {
    color: var(--brand-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-footer-link:hover,
.auth-footer-link:focus {
    color: var(--brand-secondary);
}

.support-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 1rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.85;
}

.brand-badge .bi {
    font-size: 1.1rem;
}

.language-switcher {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.language-switcher__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.language-switcher__link {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.language-switcher__link:hover,
.language-switcher__link:focus {
    opacity: 1;
    border-color: #fff;
    text-decoration: none;
}

.language-switcher__link--active {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
    border-color: #fff;
}

@media (max-width: 576px) {
    .auth-card__body,
    .auth-card__footer {
        padding: 1.75rem 1.5rem 2rem;
    }

    .auth-card__header {
        padding: 2rem 1.5rem 1.75rem;
    }
}

.alert-container {
    max-width: 520px;
    margin: 1.5rem auto;
}

.alert-container .alert {
    border-radius: 1rem;
}

.dashboard-layout {
    min-height: 100vh;
    display: flex;
    background: transparent;
}

.dashboard-sidebar {
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    background: #fff;
    box-shadow: 0 1.2rem 2.4rem rgba(13, 110, 253, 0.12);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1030;
}

.dashboard-sidebar__header {
    padding: 2rem 1.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(102, 16, 242, 0.05));
}

.dashboard-sidebar__welcome {
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 0.95rem;
    color: rgba(33, 37, 41, 0.75);
}

.dashboard-menu {
    padding: 1.5rem 1.75rem 2rem;
    flex: 1 1 auto;
}

.dashboard-menu__title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(33, 37, 41, 0.6);
    margin-bottom: 1.25rem;
}

.dashboard-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-menu__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    text-decoration: none;
    color: var(--brand-text);
    background: rgba(13, 110, 253, 0.08);
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-weight: 600;
}

.dashboard-menu__link--active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2), rgba(102, 16, 242, 0.18));
    box-shadow: inset 0 0 0 1px rgba(102, 16, 242, 0.2);
}

.dashboard-menu__link .bi {
    font-size: 1.1rem;
    color: var(--brand-primary);
}

.dashboard-menu__link:hover,
.dashboard-menu__link:focus {
    background: rgba(102, 16, 242, 0.12);
    transform: translateY(-1px);
    color: var(--brand-text);
    text-decoration: none;
}

.dashboard-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.dashboard-header__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
}

.dashboard-header__toggle .bi {
    font-size: 1.1rem;
}

.dashboard-header__spacer {
    flex: 1 1 auto;
}

.dashboard-header__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-header__change-password {
    white-space: nowrap;
    border-radius: 999px;
    padding-inline: 1rem;
}

.dashboard-header__logout {
    white-space: nowrap;
    border-radius: 999px;
    padding-inline: 1rem;
}

.dashboard-header__user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.dashboard-header__user-name {
    font-weight: 600;
}

.dashboard-header__user-email {
    font-size: 0.85rem;
    color: rgba(33, 37, 41, 0.65);
}

.dashboard-content {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3rem;
}

.dashboard-card {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 1.5rem 3rem rgba(13, 110, 253, 0.08);
}

.dashboard-card .card-body {
    padding: 2.5rem;
}

.dashboard-form__header {
    max-width: 720px;
}

.dashboard-form__header .card-title {
    font-weight: 700;
}

.rma-form .form-label {
    font-weight: 600;
    color: rgba(33, 37, 41, 0.85);
}

.rma-form .form-control,
.rma-form .form-select,
.rma-form .form-check-input {
    border-radius: 0.9rem;
    padding: 0.75rem 1rem;
}

.rma-form .form-control:focus,
.rma-form .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.rma-form .form-text {
    color: rgba(33, 37, 41, 0.6);
    margin-top: 0.45rem;
}

.rma-form .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
    margin-right: 0.6rem;
}

.rma-form .btn-primary {
    padding: 0.75rem 1.75rem;
    border-radius: 0.9rem;
    font-weight: 600;
    box-shadow: 0 1rem 2rem rgba(13, 110, 253, 0.2);
}

@media (max-width: 576px) {
    .dashboard-card .card-body {
        padding: 2rem;
    }

    .rma-form .btn-primary {
        width: 100%;
    }
}

.language-switcher--dashboard {
    background: #fff;
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0.75rem 1.5rem rgba(13, 110, 253, 0.1);
    margin-top: 0;
    align-self: center;
}

.language-switcher--dashboard .language-switcher__label {
    color: var(--brand-primary);
}

.language-switcher--dashboard .language-switcher__link {
    color: var(--brand-primary);
    border-color: rgba(13, 110, 253, 0.35);
    background-color: rgba(13, 110, 253, 0.1);
    opacity: 1;
}

.language-switcher--dashboard .language-switcher__link:hover,
.language-switcher--dashboard .language-switcher__link:focus {
    background-color: rgba(13, 110, 253, 0.18);
    border-color: rgba(13, 110, 253, 0.5);
}

.language-switcher--dashboard .language-switcher__link--active {
    background-color: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.rma-detail-summary,
.rma-detail-conversation {
    border: none;
    border-radius: 1.1rem;
    box-shadow: 0 1.2rem 2.2rem rgba(13, 110, 253, 0.08);
}

.rma-detail-summary__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0;
}

.rma-detail-summary__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.rma-detail-summary__item dt {
    margin: 0;
    font-weight: 600;
    color: rgba(33, 37, 41, 0.7);
}

.rma-detail-summary__item dd {
    margin: 0;
    font-weight: 500;
    color: rgba(33, 37, 41, 0.85);
    text-align: right;
}

.rma-detail-summary__section {
    border-top: 1px solid rgba(13, 110, 253, 0.12);
    padding-top: 1.25rem;
}

.rma-conversation {
    border-radius: 1rem;
    background: rgba(13, 110, 253, 0.03);
    padding: 1.25rem;
    overflow-y: auto;
}

.rma-conversation__list {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.rma-message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    gap: 0.35rem;
}

.rma-message__meta {
    font-size: 0.8rem;
    color: rgba(33, 37, 41, 0.6);
    display: flex;
    gap: 0.5rem;
}

.rma-message--incoming .rma-message__meta {
    justify-content: flex-start;
}

.rma-message--outgoing .rma-message__meta {
    justify-content: flex-end;
}

.rma-message__body {
    padding: 0.95rem 1.1rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 0.85rem 1.6rem rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.08);
    max-width: 100%;
    word-break: break-word;
}

.rma-message__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rma-message__attachment-link {
    display: inline-block;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(13, 110, 253, 0.15);
    background: #fff;
    box-shadow: 0 0.65rem 1.25rem rgba(13, 110, 253, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 140px;
    width: 100%;
}

.rma-message__attachment-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.85rem 1.6rem rgba(13, 110, 253, 0.16);
}

.rma-message__attachment-link:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
}

.rma-message__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: cover;
    cursor: zoom-in;
}

.rma-message--incoming .rma-message__body {
    align-self: flex-start;
    background: rgba(13, 110, 253, 0.08);
    border-color: rgba(13, 110, 253, 0.12);
}

.rma-message--outgoing {
    align-items: flex-end;
}

.rma-message--outgoing .rma-message__body {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.95), rgba(102, 16, 242, 0.85));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0.95rem 1.8rem rgba(13, 110, 253, 0.2);
}

.rma-message-form .form-control {
    border-radius: 0.9rem;
}

.rma-message-form .btn-primary {
    border-radius: 0.9rem;
    padding-inline: 1.5rem;
}

.rma-status-timeline {
    border: none;
    border-radius: 1.1rem;
    box-shadow: 0 1.1rem 2.1rem rgba(13, 110, 253, 0.08);
    margin-bottom: 1.5rem;
}

.rma-status-timeline .card-body {
    padding: 1.75rem 1.5rem;
}

.rma-status-timeline__legend {
    color: rgba(33, 37, 41, 0.65);
}

.rma-status-timeline__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.rma-status-timeline__phase {
    margin-top: 1.5rem;
}

.rma-status-timeline__phase:first-of-type {
    margin-top: 1.25rem;
}

.rma-status-timeline__phase-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rma-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 1.5rem;
    position: relative;
    padding: 1.5rem 0.5rem 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}

.rma-rail::-webkit-scrollbar {
    height: 6px;
}

.rma-rail::-webkit-scrollbar-thumb {
    background: rgba(13, 110, 253, 0.25);
    border-radius: 999px;
}

.rma-rail__step {
    --rma-tone-color: var(--bs-secondary);
    --rma-tone-rgb: var(--bs-secondary-rgb);
    --rma-line-neutral: rgba(108, 117, 125, 0.28);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    scroll-snap-align: start;
}

.rma-rail__step--tone-primary {
    --rma-tone-color: var(--bs-primary);
    --rma-tone-rgb: var(--bs-primary-rgb);
}

.rma-rail__step--tone-success {
    --rma-tone-color: var(--bs-success);
    --rma-tone-rgb: var(--bs-success-rgb);
}

.rma-rail__step--tone-info {
    --rma-tone-color: var(--bs-info);
    --rma-tone-rgb: var(--bs-info-rgb);
}

.rma-rail__step--tone-warning {
    --rma-tone-color: var(--bs-warning);
    --rma-tone-rgb: var(--bs-warning-rgb);
}

.rma-rail__step--tone-danger {
    --rma-tone-color: var(--bs-danger);
    --rma-tone-rgb: var(--bs-danger-rgb);
}

.rma-rail__marker {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 3px solid var(--rma-tone-color);
    background: #fff;
    color: var(--rma-tone-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rma-rail__marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: rgba(240,13,13);
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    pointer-events: none;
}

.rma-rail__marker::before,
.rma-rail__marker::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% + 0.85rem);
    height: 3px;
    background: var(--rma-line-neutral);
    transform: translateY(-50%);
    z-index: 0;
}

.rma-rail__marker::before {
    left: calc(-50% - 0.85rem);
}

.rma-rail__marker::after {
    right: calc(-50% - 0.85rem);
}

.rma-rail__step:first-child .rma-rail__marker::before {
    display: none;
}

.rma-rail__step:last-child .rma-rail__marker::after {
    display: none;
}

.rma-rail__step--completed .rma-rail__marker {
    background: var(--rma-tone-color);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(var(--rma-tone-rgb), 0.15);
}

.rma-rail__step--completed .rma-rail__marker::before,
.rma-rail__step--completed .rma-rail__marker::after,
.rma-rail__step--current .rma-rail__marker::before {
    background: rgba(var(--rma-tone-rgb), 0.6);
}

.rma-rail__step--current .rma-rail__marker {
    background: #fff;
    border-width: 4px;
    box-shadow: 0 0 0 6px rgba(var(--rma-tone-rgb), 0.12);
}

.rma-rail__step--current .rma-rail__marker-pulse {
    animation: rma-rail-current-pulse 1.8s ease-in-out infinite;
}

@keyframes rma-rail-current-pulse {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

.rma-rail__step--terminal .rma-rail__marker {
    border-style: dashed;
}

.rma-rail__abbr {
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.rma-rail__content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rma-rail__title {
    font-weight: 600;
    color: rgba(33, 37, 41, 0.85);
}

.rma-rail__description {
    margin: 0;
    font-size: 0.86rem;
    color: rgba(33, 37, 41, 0.7);
}

.rma-rail__branch-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rma-rail__branch {
    --rma-branch-rgb: var(--bs-secondary-rgb);
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(var(--rma-branch-rgb, 108, 117, 125), 0.25);
    background: rgba(var(--rma-branch-rgb, 108, 117, 125), 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.rma-rail__branch--tone-primary { --rma-branch-rgb: var(--bs-primary-rgb); }
.rma-rail__branch--tone-success { --rma-branch-rgb: var(--bs-success-rgb); }
.rma-rail__branch--tone-info { --rma-branch-rgb: var(--bs-info-rgb); }
.rma-rail__branch--tone-warning { --rma-branch-rgb: var(--bs-warning-rgb); }
.rma-rail__branch--tone-danger { --rma-branch-rgb: var(--bs-danger-rgb); }

.rma-rail__branch-marker {
    --rma-branch-marker-border: rgba(var(--rma-branch-rgb, 108, 117, 125), 0.45);
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 2px solid var(--rma-branch-marker-border);
    background: #fff;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.25rem;
    box-shadow: inset 0 0 0 1px rgba(var(--rma-branch-rgb, 108, 117, 125), 0.08);
}

.rma-rail__branch-marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 210%;
    height: 210%;
    border-radius: inherit;
    background: rgba(240,13,13);
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    pointer-events: none;
}

.rma-rail__branch-marker::after {
    content: '';
    position: absolute;
    top: -0.75rem;
    bottom: -0.75rem;
    left: 50%;
    width: 2px;
    background: rgba(var(--rma-branch-rgb, 108, 117, 125), 0.22);
    transform: translateX(-50%);
}

.rma-rail__branch-body {
    flex: 1;
}

.rma-rail__branch-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: rgba(33, 37, 41, 0.85);
}

.rma-rail__branch-description {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: rgba(33, 37, 41, 0.65);
}

.rma-rail__branch--current {
    border-color: rgba(var(--rma-branch-rgb, 108, 117, 125), 0.45);
    background: rgba(var(--rma-branch-rgb, 108, 117, 125), 0.14);
    box-shadow: inset 0 0 0 1px rgba(var(--rma-branch-rgb, 108, 117, 125), 0.2);
}

.rma-rail__branch--current .rma-rail__branch-marker {
    --rma-branch-marker-border: rgba(var(--rma-branch-rgb, 108, 117, 125), 0.65);
    box-shadow: 0 0 0 4px rgba(var(--rma-branch-rgb, 108, 117, 125), 0.18);
}

.rma-rail__branch--current .rma-rail__branch-marker-pulse {
    animation: rma-rail-current-pulse 1.8s ease-in-out infinite;
}

.rma-rail__branch--terminal {
    border-style: dashed;
}

.rma-status-timeline--admin {
    margin-bottom: 2rem;
}

.rma-status-quick {
    border-top: 1px solid rgba(13, 110, 253, 0.12);
    padding-top: 1rem;
}

.rma-status-quick .btn {
    border-radius: 999px;
    padding-inline: 1rem;
}

.rma-status-quick .btn-outline-primary {
    border-style: dashed;
}

.rma-status-quick .btn-outline-primary:hover,
.rma-status-quick .btn-outline-primary:focus-visible {
    border-style: solid;
}

@media (max-width: 1200px) {
    .dashboard-main {
        padding: 2rem;
    }
}

@media (max-width: 992px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        flex: 0 0 auto;
        min-height: auto;
        box-shadow: none;
    }

    .dashboard-main {
        padding: 1.75rem 1.5rem 3rem;
    }

    .dashboard-content {
        padding-top: 2rem;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .dashboard-header {
        gap: 1rem;
    }

    .dashboard-header__user-info {
        text-align: left;
    }

    .language-switcher--dashboard {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .rma-conversation {
        padding: 1rem;
    }
}
