:root {
    --color-bg-base: #f7f6ff;
    --color-ink: #0b1231;
    --color-ink-muted: rgba(11, 18, 49, 0.65);
    --color-glass: rgba(255, 255, 255, 0.68);
    --color-glass-strong: rgba(255, 255, 255, 0.82);
    --color-glass-border: rgba(255, 255, 255, 0.45);
    --glass-light: rgba(255, 255, 255, 0.35);
    --glass-overlay: rgba(255, 255, 255, 0.65);
    --glass-button: rgba(255, 255, 255, 0.45);
    --ink-border-muted: rgba(11, 18, 49, 0.15);
    --shadow-soft: 0 28px 60px -40px rgba(74, 78, 140, 0.55);
    --shadow-strong: 0 45px 120px -70px rgba(88, 92, 190, 0.65);
    --gradient-rainbow: linear-gradient(135deg, #8f8dff 0%, #f8a6ff 40%, #7de7d3 80%, #8f8dff 100%);
    --gradient-rainbow-soft: linear-gradient(135deg, rgba(143, 141, 255, 0.65) 0%, rgba(248, 166, 255, 0.65) 40%, rgba(125, 231, 211, 0.65) 80%, rgba(143, 141, 255, 0.65) 100%);
    --gradient-primary: linear-gradient(125deg, #716af5 0%, #b97bff 45%, #6de4cf 100%);
    --gradient-success: linear-gradient(135deg, #6ee7b7 0%, #7dd3fc 100%);
    --btn-shadow: 0 18px 35px -18px rgba(124, 117, 255, 0.7);
    --btn-shadow-hover: 0 20px 45px -16px rgba(124, 117, 255, 0.85);
    --transition-fast: 0.16s ease-out;
    --transition-medium: 0.18s ease-out;
}

body {
    position: relative;
    min-height: 100vh;
    color: var(--color-ink);
    background: var(--color-bg-base);
    overflow-x: hidden;
}

body::before,
body::after {
    content: none;
}

.app-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.section-pane {
    scroll-margin-top: 96px;
}

.navbar {
    border-radius: 22px;
    margin: 1rem auto 2rem;
    background: linear-gradient(120deg, var(--glass-overlay), var(--glass-light));
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-glass-border);
}

.aurora-navbar {
    position: relative;
    overflow: hidden;
}

.aurora-navbar::before {
    content: '';
    position: absolute;
    inset: -60%;
    background: var(--gradient-rainbow);
    opacity: 0.28;
    filter: blur(80px);
    z-index: 0;
}

.aurora-navbar > * {
    position: relative;
    z-index: 1;
}

.navbar .navbar-brand,
.navbar .text-muted,
.navbar .fw-semibold {
    color: var(--color-ink);
}

.navbar #logout-btn {
    border-color: var(--ink-border-muted);
    color: var(--color-ink);
    background: var(--glass-light);
    backdrop-filter: blur(12px);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar #logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -18px rgba(11, 18, 49, 0.35);
}

.tabbed-navigation {
    border-bottom: none;
    padding: 0.6rem 0.4rem;
    gap: 0.75rem;
    background: var(--gradient-rainbow-soft);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-soft);
}

.tabbed-navigation .nav-link {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.3rem;
    color: var(--color-ink-muted);
    background: var(--glass-light);
    box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
    backdrop-filter: blur(14px);
}

.tabbed-navigation .nav-link:hover {
    transform: translateY(-2px);
    color: var(--color-ink);
    box-shadow: inset 0 1px 10px rgba(255, 255, 255, 0.6), 0 10px 24px -18px rgba(113, 106, 245, 0.6);
}

.tabbed-navigation .nav-link.active {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 16px 32px -18px rgba(113, 106, 245, 0.72);
}

.tabbed-navigation .nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

.card {
    border-radius: 22px;
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
}

#auth-wrapper .card {
    position: relative;
    overflow: hidden;
    background: var(--color-glass-strong);
    box-shadow: 0 40px 80px -48px rgba(113, 106, 245, 0.55);
}

.login-card {
    border: 1px solid transparent;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.6)) padding-box,
        linear-gradient(135deg, rgba(143, 141, 255, 0.4), rgba(125, 231, 211, 0.35)) border-box;
    backdrop-filter: blur(20px);
}

#auth-wrapper .card:before {
    content: '';
    position: absolute;
    width: 140%;
    height: 140%;
    top: -60%;
    left: -20%;
    background:
        radial-gradient(circle at 10% 20%, rgba(248, 166, 255, 0.4), transparent 55%),
        radial-gradient(circle at 80% 15%, rgba(125, 231, 211, 0.4), transparent 60%),
        radial-gradient(circle at 40% 90%, rgba(143, 141, 255, 0.35), transparent 60%);
    opacity: 0.85;
    filter: blur(60px);
    transform: rotate(8deg);
    z-index: 0;
}

#auth-wrapper .card > * {
    position: relative;
    z-index: 1;
}

.btn-primary {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    background-image: var(--gradient-primary);
    color: #ffffff;
    box-shadow: var(--btn-shadow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-hover);
    filter: brightness(1.02);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(143, 141, 255, 0.25);
}

.btn-outline-secondary,
.btn-secondary {
    border-radius: 999px;
    border: 1px solid var(--ink-border-muted);
    background: var(--glass-button);
    color: var(--color-ink);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    backdrop-filter: blur(12px);
}

.btn-outline-secondary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    background: var(--glass-overlay);
    box-shadow: 0 18px 32px -20px rgba(74, 78, 140, 0.35);
    color: var(--color-ink);
}

#dashboard-cards .card {
    box-shadow: var(--shadow-soft);
}

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid rgba(11, 18, 49, 0.12);
    background: var(--glass-overlay);
    box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.6);
    color: var(--color-ink);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(143, 141, 255, 0.65);
    box-shadow: 0 0 0 0.25rem rgba(143, 141, 255, 0.18);
    color: var(--color-ink);
}

#dashboard-cards .icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.6), 0 10px 25px -15px rgba(113, 106, 245, 0.35);
}

.chat-card {
    position: relative;
    border-radius: 22px;
    border: 1px solid transparent;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.78), var(--glass-button)) padding-box,
        linear-gradient(135deg, rgba(143, 141, 255, 0.38), rgba(125, 231, 211, 0.35)) border-box;
    backdrop-filter: blur(18px);
}


.chat-history {
    height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 14px rgba(255, 255, 255, 0.6);
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 90%;
    font-size: 0.95rem;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 10px var(--glass-light);
}

.chat-bubble.me {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 16px 30px -18px rgba(113, 106, 245, 0.65);
}

.chat-bubble.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-ink);
}

.agent-card {
    border-radius: 22px;
    border: 1px solid transparent;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48)) padding-box,
        linear-gradient(135deg, rgba(143, 141, 255, 0.4), rgba(125, 231, 211, 0.35)) border-box;
    box-shadow: 0 24px 60px -35px rgba(59, 72, 166, 0.55);
    backdrop-filter: blur(22px);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.agent-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 30px 80px -40px rgba(59, 72, 166, 0.65);
}

.agent-card .badge {
    font-size: 0.75rem;
}

.prompt-row {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    padding: 18px;
    border: 1px solid var(--glass-button);
    box-shadow: inset 0 1px 12px rgba(255, 255, 255, 0.5);
}

.prompt-row textarea {
    min-height: 146px;
    max-height: 500px;
    height: auto;
    resize: vertical;
}

.prompt-key-description {
    min-height: 32px;
}

.prompt-key-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prompt-key-meta {
    margin-left: 0.75rem;
    margin-top: 4px;
}

.prompt-key-label {
    font-size: 0.7rem;
}

.prompt-key-actions .btn {
    padding: 0;
    font-size: 0.8rem;
}

.prompt-key-actions .btn + .btn {
    margin-left: 0.25rem;
}

.table thead {
    background: var(--glass-button);
    color: var(--color-ink);
}

.table tbody tr {
    background-color: rgba(255, 255, 255, 0.55);
}

.table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.72);
}

.table > :not(caption) > * > * {
    border-color: rgba(11, 18, 49, 0.05);
}

.modal-content {
    border-radius: 22px;
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass-strong);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-strong);
}

#login-form input {
    border-radius: 14px;
    border: 1px solid rgba(11, 18, 49, 0.12);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: inset 0 1px 6px rgba(255, 255, 255, 0.6);
}

#login-form input:focus {
    border-color: rgba(143, 141, 255, 0.65);
    box-shadow: 0 0 0 0.25rem rgba(143, 141, 255, 0.18);
}

#login-form button {
    border-radius: 999px;
    padding-block: 12px;
}

#memory-table td {
    vertical-align: top;
}

.memory-content-wrapper {
    display: block;
}

.memory-text {
    position: relative;
    white-space: pre-wrap;
}

.memory-text-preview {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
}

.memory-text-full {
    white-space: pre-wrap;
}

.memory-text.is-expanded .memory-text-preview {
    display: none;
}

.memory-text.is-expanded .memory-text-full {
    display: block;
}

.memory-text .memory-toggle {
    margin-top: 4px;
    padding-left: 0;
    font-size: 0.85rem;
}

#memoryModal .modal-content {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.95);
}

#memoryModal .modal-body {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

#memory-form.memory-editing #memory-content,
#memory-content.memory-editing {
    min-height: 220px;
}

.memory-edit-hint {
    display: none;
}

#memory-form.memory-editing .memory-edit-hint {
    display: block;
}

.chat-agent-history {
    min-height: 260px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 14px rgba(255, 255, 255, 0.6);
    padding: 1rem;
}

.chat-agent-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 999px;
    padding: 2px;
    background: var(--gradient-primary);
}

.chat-agent-input {
    border: none;
    border-radius: 999px 0 0 999px;
    padding: 12px 16px;
    flex: 1;
}

.chat-agent-input:focus {
    outline: none;
    box-shadow: none;
}

.chat-agent-send {
    border-radius: 0 999px 999px 0;
    border: none;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #ffffff;
}

.chat-agent-send i {
    font-size: 1.1rem;
    display: inline-block;
}

.danger-toggle {
    border-radius: 14px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.danger-toggle[aria-expanded="true"] {
    background: rgba(220, 53, 69, 0.08);
    border-color: rgba(220, 53, 69, 0.35);
    color: #dc3545;
}

.danger-card {
    border-radius: 22px;
    border: 1px solid rgba(220, 53, 69, 0.22);
    background: rgba(255, 247, 247, 0.85);
    padding: 1.45rem;
    box-shadow: 0 25px 60px -40px rgba(220, 53, 69, 0.35);
}

.chat-agent-input-wrapper:before,
.chat-agent-input-wrapper:after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    padding: 2px;
    background: inherit;
    z-index: -2;
}

.chat-agent-input-wrapper:after {
    filter: blur(12px);
}

.chat-agent-input-wrapper > * {
    background: rgba(255, 255, 255, 0.92);
    z-index: 1;
}

@keyframes rainbow-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rainbow-icon {
    0% { color: #f8a6ff; }
    25% { color: #8f8dff; }
    50% { color: #7de7d3; }
    75% { color: #ffe7a3; }
    100% { color: #f8a6ff; }
}

@keyframes auroraFlow {
    0% {
        transform: translate3d(-3%, -2%, 0) scale(1.05);
    }
    50% {
        transform: translate3d(3%, 1%, 0) scale(1.08);
    }
    100% {
        transform: translate3d(-2%, 2%, 0) scale(1.02);
    }
}

.chat-agent-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 80%;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 10px var(--glass-light);
}

.chat-agent-bubble.me {
    align-self: flex-end;
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 18px 32px -18px rgba(110, 231, 183, 0.55);
}

.chat-agent-bubble.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.75);
    color: var(--color-ink);
    box-shadow: inset 0 1px 10px var(--glass-button);
}

.chat-agent-bubble.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.8);
    color: transparent;
}

.chat-agent-bubble.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8f8dff, #7de7d3);
    opacity: 0.4;
    animation: typingBounce 1.1s infinite ease-in-out;
}

.chat-agent-bubble.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.chat-agent-bubble.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-4px);
        opacity: 0.85;
    }
}

.agent-settings-section h6 {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

#agent-metrics-rows .metric-row {
    display: flex;
    gap: 8px;
}

#agent-metrics-rows .metric-row input {
    border-radius: 10px;
}

#agent-metrics-rows .metric-row button {
    border-radius: 10px;
}


.mail-folder-list {
    background-color: rgba(255, 255, 255, 0.6);
    max-height: 260px;
    min-height: 80px;
    overflow-y: auto;
    padding: 0.4rem;
    border-radius: 0.75rem;
}

.mail-folder-list .mail-folder-group,
.mail-folder-list .mail-folder-leaf {
    --depth: 0;
    margin-left: calc(var(--depth) * 1.05rem);
}

.mail-folder-group {
    border-radius: 0.75rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(143, 141, 255, 0.16);
    transition: background-color 0.18s ease;
    margin-bottom: 0.25rem;
}

.mail-folder-group-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.45rem;
    border-radius: 0.65rem;
    background: rgba(143, 141, 255, 0.12);
}

.mail-folder-group.is-open .mail-folder-group-header {
    background: rgba(143, 141, 255, 0.2);
}

.mail-folder-toggle {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--color-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.mail-folder-toggle:hover {
    background: rgba(143, 141, 255, 0.24);
    transform: translateY(-1px);
}


.mail-folder-group-header .form-check,
.mail-folder-leaf .form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0.6rem;
    margin-bottom: 0;
    width: 100%;
    border-radius: 0.55rem;
    transition: background-color 0.18s ease;
    cursor: pointer;
}

.mail-folder-group-header .form-check-input,
.mail-folder-leaf .form-check-input {
    position: static;
    margin: 0;
    transform: translateY(0);
}

.mail-folder-group-header .form-check-label,
.mail-folder-leaf .form-check-label {
    flex: 1;
    cursor: pointer;
}

.mail-folder-group-header .form-check:hover,
.mail-folder-leaf .form-check:hover {
    background: rgba(143, 141, 255, 0.14);
}

.mail-folder-group-label {
    font-weight: 600;
    color: var(--color-ink);
}

.mail-folder-group-label .text-muted {
    font-weight: normal;
}

.mail-folder-children {
    margin-top: 0.35rem;
    padding-left: 0.85rem;
    border-left: 1px dashed rgba(143, 141, 255, 0.22);
}

.mail-folder-children.collapse-hidden {
    display: none;
}

.mail-folder-leaf {
    padding: 0.15rem 0.35rem;
    border-radius: 0.6rem;
}

.mail-tab-wrapper.container-fluid {
    width: 100vw;
    margin-left: calc((100% - 100vw) / 2);
    margin-right: calc((100% - 100vw) / 2);
    padding-left: clamp(16px, 3vw, 48px);
    padding-right: clamp(16px, 3vw, 48px);
}

.mail-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3vw, 28px);
}

@media (min-width: 992px) {
    .mail-layout {
        flex-direction: row;
        align-items: stretch;
    }
}

.mail-settings-wrapper {
    display: flex;
    align-items: stretch;
    gap: clamp(12px, 2vw, 18px);
    flex: 0 0 auto;
}

.mail-table-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}

.mail-settings-toggle {
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.65rem;
    min-width: 44px;
    border-radius: 999px;
    border: 1px solid rgba(59, 72, 166, 0.25);
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
    box-shadow: 0 18px 44px -28px rgba(59, 72, 166, 0.55);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mail-settings-toggle::before {
    content: '';
    position: absolute;
    top: 0.85rem;
    bottom: 0.85rem;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(59, 72, 166, 0.45), rgba(59, 72, 166, 0.12));
}

.mail-settings-toggle i {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

.mail-settings-toggle:hover {
    background-color: rgba(59, 72, 166, 0.08);
    border-color: rgba(59, 72, 166, 0.35);
}

.mail-settings-toggle:focus-visible {
    outline: 2px solid rgba(59, 72, 166, 0.55);
    outline-offset: 3px;
}

.mail-settings-card {
    border-radius: 1rem;
    width: clamp(260px, 32vw, 360px);
    max-width: 100%;
}

.mail-table-card {
    border-radius: 1rem;
    width: 100%;
    flex: 1 1 auto;
}

.mail-tab-wrapper .mail-table-card {
    width: 100%;
}

@media (max-width: 991.98px) {
    .mail-settings-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .mail-settings-toggle {
        min-width: auto;
        padding: 0.45rem 0.7rem;
        border-radius: 0.75rem;
    }

    .mail-settings-toggle::before {
        top: 0.4rem;
        bottom: 0.4rem;
    }

    .mail-settings-toggle i,
    .mail-settings-toggle:not(.collapsed) i {
        transform: none;
    }

    .mail-settings-card {
        width: 100%;
    }
}

.mail-detail-body {
    white-space: pre-wrap;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: var(--bs-font-monospace, 'SFMono-Regular', monospace);
}

.mail-detail-modal .modal-dialog {
    max-width: min(1200px, 95vw);
}

.mail-detail-modal .modal-content {
    border-radius: 1.25rem;
    border: 1px solid rgba(143, 141, 255, 0.25);
    box-shadow: 0 24px 80px -40px rgba(59, 72, 166, 0.55);
}

.mail-detail-modal .modal-body {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.mail-detail-view-toggle .btn {
    min-width: 110px;
}

.mail-detail-html {
    border-radius: 0.85rem;
    border: 1px solid rgba(143, 141, 255, 0.25);
    background: rgba(59, 72, 166, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.mail-detail-html-frame {
    display: block;
    width: 100%;
    min-height: 420px;
    border: none;
    background-color: #ffffff;
}

@media (max-width: 767.98px) {
    .mail-detail-html-frame {
        min-height: 320px;
    }
}

.mail-attachment-list {
    margin: 0;
    padding: 0;
}

.mail-attachment-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background-color: rgba(248, 249, 252, 0.65);
    transition: background-color 0.18s ease-in-out, border-color 0.18s ease-in-out;
}

.mail-attachment-list li:last-child {
    margin-bottom: 0;
}

.mail-attachment-list li:hover {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.2);
}

.mail-attachment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.mail-attachment-name {
    font-weight: 500;
    word-break: break-all;
}

.mail-attachment-size {
    font-size: 0.85rem;
}

.mail-attachment-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

.mail-attachment-actions {
    flex-shrink: 0;
}

.mail-row-actions .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    padding: 0;
}

.mail-row-action-menu .btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mail-search-group {
    max-width: 260px;
}

.mail-search-group .form-control {
    min-width: 0;
}

.mail-search-group .btn {
    width: 2.25rem;
    padding: 0;
}

.mail-detail-html-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 160px;
    color: #6c757d;
}

.mail-message-unseen {
    background-color: rgba(255, 193, 7, 0.12);
}

.mail-message-row {
    cursor: pointer;
    transition: background-color 0.18s ease-in-out;
}

.mail-message-row:hover {
    background-color: rgba(13, 110, 253, 0.08);
}

.mail-folder-pill-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.mail-folder-pill-group > .text-muted {
    margin-right: 0.25rem;
}

.mail-folder-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.7rem;
    line-height: 1.2;
    border-radius: 999px;
}

.mail-folder-pill .badge {
    font-size: 0.7rem;
    border-radius: 999px;
    transform: translateY(-0.05rem);
}

.mail-message-row.mail-message-unseen:hover {
    background-color: rgba(255, 193, 7, 0.22);
}

.mail-placeholder-row {
    position: relative;
    pointer-events: none;
    cursor: default;
    color: #856404;
    background-color: rgba(255, 193, 7, 0.08);
    overflow: hidden;
}

.mail-placeholder-row td {
    background-color: rgba(255, 193, 7, 0.08);
    position: relative;
    z-index: 1;
}

.mail-placeholder-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: -160%;
    width: 120%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 193, 7, 0.32) 50%, rgba(255, 255, 255, 0) 100%);
    animation: mailPlaceholderSweep 2.6s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes mailPlaceholderSweep {
    0% {
        left: -160%;
    }
    100% {
        left: 160%;
    }
}

.mail-placeholder-text {
    font-style: italic;
    color: #c28100;
}

.mail-placeholder-progress {
    height: 4px;
    background-color: rgba(255, 193, 7, 0.25);
    overflow: hidden;
    border-radius: 999px;
}

.mail-placeholder-progress .progress-bar {
    transition: width 0.35s ease;
}

.progress-thin {
    height: 4px;
}

.mail-placeholder-timer {
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.mail-row-removing {
    animation: mailRowFade 0.24s ease-in forwards;
}

@keyframes mailRowFade {
    to {
        opacity: 0;
        transform: translateX(-14px);
    }
}
