* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: #0f1117;
    color: #e5e7eb;
}

.mailnificent-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #151824;
    border-bottom: 1px solid #222739;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    font-size: 1.2rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: #9aa4b2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #1f2433;
    border: 1px solid #2b3146;
    font-size: 0.9rem;
}

.btn {
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-ghost {
    background: #1b2030;
    color: #e5e7eb;
    border: 1px solid #2b3146;
}

.btn-primary {
    background: #7c5cff;
    color: white;
}

.mail-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    padding: 20px 24px;
}

.sidebar {
    background: #141826;
    border: 1px solid #23283b;
    border-radius: 16px;
    padding: 16px;
    height: fit-content;
}

.folder-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #cbd5f5;
}

.folder-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #cbd5f5;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.folder-item.active,
.folder-item:hover {
    background: #1f2433;
    color: #fff;
}

.tips-card {
    margin-top: 18px;
    padding: 12px;
    background: #1a1f2e;
    border: 1px solid #2b3146;
    border-radius: 12px;
}

.tips-card h3 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
}

.tips-card ul {
    padding-left: 18px;
    margin: 0;
    color: #9aa4b2;
    font-size: 0.85rem;
}

.inbox {
    background: #141826;
    border: 1px solid #23283b;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 18, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    width: min(560px, 90vw);
    background: #141826;
    border: 1px solid #2b3146;
    border-radius: 16px;
    padding: 16px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row input,
.form-row textarea {
    background: #1f2433;
    border: 1px solid #2b3146;
    border-radius: 10px;
    color: #e5e7eb;
    padding: 10px 12px;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2433;
    border: 1px solid #2b3146;
    color: #e5e7eb;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 400;
}

.inbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1f2433;
    border: 1px solid #2b3146;
    border-radius: 10px;
    padding: 8px 12px;
}

.search input {
    border: none;
    outline: none;
    background: transparent;
    color: #e5e7eb;
    width: 100%;
}

.filters select {
    background: #1f2433;
    border: 1px solid #2b3146;
    border-radius: 10px;
    color: #e5e7eb;
    padding: 8px 12px;
}

.inbox-content {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 16px;
    min-height: 360px;
}

.message-list {
    border: 1px solid #23283b;
    border-radius: 12px;
    overflow: hidden;
}

.message-item {
    padding: 12px 14px;
    border-bottom: 1px solid #23283b;
    cursor: pointer;
    background: #151a28;
}

.message-item:hover,
.message-item.active {
    background: #1f2433;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #9aa4b2;
    margin-bottom: 6px;
}

.message-from {
    font-weight: 600;
    color: #e5e7eb;
}

.message-subject {
    font-weight: 600;
    margin-bottom: 4px;
}

.message-preview {
    color: #9aa4b2;
    font-size: 0.85rem;
}

.message-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

.detail-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-line {
    display: flex;
    gap: 10px;
    color: #9aa4b2;
    font-size: 0.85rem;
}

.detail-line strong {
    color: #e5e7eb;
}

.message-detail {
    border: 1px solid #23283b;
    border-radius: 12px;
    padding: 16px;
    background: #151a28;
}

.empty-detail {
    text-align: center;
    color: #9aa4b2;
    padding: 40px 12px;
}

.detail-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9aa4b2;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.detail-body {
    white-space: pre-wrap;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #9aa4b2;
}

@media (max-width: 1024px) {
    .mail-layout {
        grid-template-columns: 1fr;
    }
    .inbox-content {
        grid-template-columns: 1fr;
    }
}
