/* ═══════════════════════════════════════════════════════════════════════════
   L&B SYSTEM - Admin Dashboard Styles
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

:root {
    --admin-primary: #6366f1;
    --admin-bg: #0f0f14;
    --admin-card: #1a1a24;
    --admin-border: rgba(255, 255, 255, 0.1);
    --admin-text: #ffffff;
    --admin-text-muted: rgba(255, 255, 255, 0.6);
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-card);
    border-right: 1px solid var(--admin-border);
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

/* Sidebar */
.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-decoration: none;
    color: var(--admin-text);
}

.admin-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--admin-primary);
}

.admin-nav-link svg {
    width: 20px;
    height: 20px;
}

.admin-nav-divider {
    height: 1px;
    background: var(--admin-border);
    margin: 1rem 0;
}

/* Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--admin-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Stats Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.stat-card__label {
    font-size: 0.875rem;
    color: var(--admin-text-muted);
    margin-bottom: 0.5rem;
}

.stat-card__value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card__change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-card__change--up {
    color: var(--admin-success);
}

.stat-card__change--down {
    color: var(--admin-danger);
}

/* Cards */
.admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-card__title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted);
    font-weight: 600;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.admin-btn--primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.admin-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.admin-btn--secondary {
    background: transparent;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
}

.admin-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-btn--danger {
    background: var(--admin-danger);
    color: white;
}

.admin-btn--sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.admin-btn svg {
    width: 16px;
    height: 16px;
}

/* Forms */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-text-muted);
}

.form-input,
.form-textarea,
.form-select {
    padding: 0.875rem 1rem;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    color: var(--admin-text);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--unread {
    background: rgba(99, 102, 241, 0.2);
    color: var(--admin-primary);
}

.badge--read {
    background: rgba(255, 255, 255, 0.1);
    color: var(--admin-text-muted);
}

.badge--ai {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.badge--bigdata {
    background: rgba(6, 182, 212, 0.2);
    color: #22d3ee;
}

.badge--cloud {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge--devops {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-bg);
}

.login-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
}

.login-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-card__subtitle {
    text-align: center;
    color: var(--admin-text-muted);
    margin-bottom: 2rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--admin-danger);
    color: var(--admin-danger);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--admin-card);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal__close {
    background: none;
    border: none;
    color: var(--admin-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Message Detail */
.message-detail__meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.message-detail__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-detail__label {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
}

.message-detail__content {
    line-height: 1.75;
    color: var(--admin-text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   POST EDITOR STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Post Stats */
.post-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.post-stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.post-stat-icon {
    font-size: 1.75rem;
}

.post-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.post-stat-label {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
}

/* Post Filter Group */
.post-filter-group {
    display: flex;
    gap: 0.25rem;
    background: var(--admin-bg);
    border-radius: 10px;
    padding: 3px;
}

.post-filter-btn {
    background: transparent;
    border: none;
    color: var(--admin-text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.post-filter-btn.active {
    background: var(--admin-primary);
    color: white;
}

.post-filter-btn:hover:not(.active) {
    color: var(--admin-text);
}

/* Post Title Cell */
.post-title-cell {
    max-width: 300px;
}

.post-title-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.post-excerpt-text {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons Inline */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

/* Badge Status */
.badge--published {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge--draft {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ─── Editor View ─── */
.post-editor-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.editor-header__actions {
    display: flex;
    gap: 0.5rem;
}

/* Editor Meta */
.editor-meta {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    padding: 1.25rem;
}

.editor-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.editor-status-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Status Toggle */
.status-toggle {
    display: flex;
    background: var(--admin-bg);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid var(--admin-border);
}

.status-toggle__btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--admin-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-toggle__btn.active[data-status="draft"] {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-toggle__btn.active[data-status="published"] {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Title Input */
.editor-title-wrap {
    margin-top: 0.5rem;
}

.editor-title-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--admin-border);
    color: var(--admin-text);
    font-size: 1.75rem;
    font-weight: 700;
    padding: 0.75rem 0;
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}

.editor-title-input:focus {
    border-bottom-color: var(--admin-primary);
}

.editor-title-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Excerpt Input */
.editor-excerpt-wrap {
    margin-top: 0.25rem;
}

.editor-excerpt-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
    font-size: 1rem;
    padding: 0.5rem 0;
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}

.editor-excerpt-input:focus {
    border-bottom-color: var(--admin-primary);
}

.editor-excerpt-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Quill Editor Container */
.editor-container {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    overflow: hidden;
    min-height: 400px;
}

/* Quill Dark Theme Overrides */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid var(--admin-border) !important;
    background: rgba(255, 255, 255, 0.03);
}

.ql-container.ql-snow {
    border: none !important;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    font-size: 1rem;
    min-height: 350px;
}

.ql-editor {
    color: var(--admin-text);
    padding: 1.5rem;
    line-height: 1.8;
    min-height: 350px;
}

.ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.25) !important;
    font-style: normal !important;
}

.ql-snow .ql-stroke {
    stroke: var(--admin-text-muted) !important;
}

.ql-snow .ql-fill {
    fill: var(--admin-text-muted) !important;
}

.ql-snow .ql-picker-label {
    color: var(--admin-text-muted) !important;
}

.ql-snow .ql-picker-options {
    background: var(--admin-card) !important;
    border-color: var(--admin-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

.ql-snow .ql-picker-item {
    color: var(--admin-text) !important;
}

.ql-snow .ql-picker-item:hover {
    color: var(--admin-primary) !important;
}

.ql-toolbar.ql-snow .ql-formats button:hover,
.ql-toolbar.ql-snow .ql-formats button.ql-active {
    color: var(--admin-primary) !important;
}

.ql-toolbar.ql-snow .ql-formats button:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-formats button.ql-active .ql-stroke {
    stroke: var(--admin-primary) !important;
}

.ql-toolbar.ql-snow .ql-formats button:hover .ql-fill,
.ql-toolbar.ql-snow .ql-formats button.ql-active .ql-fill {
    fill: var(--admin-primary) !important;
}

.ql-editor blockquote {
    border-left: 3px solid var(--admin-primary);
    color: var(--admin-text-muted);
    padding-left: 1rem;
}

.ql-editor pre.ql-syntax {
    background: var(--admin-bg) !important;
    color: #e2e8f0 !important;
    border-radius: 8px;
    padding: 1rem;
}

.ql-snow a {
    color: var(--admin-primary) !important;
}

/* Editor Footer */
.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.editor-footer__info {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
}

/* Preview Panel */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.preview-panel {
    background: var(--admin-card);
    border-radius: 20px;
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.preview-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    background: var(--admin-card);
    z-index: 1;
}

.preview-panel__content {
    padding: 2rem;
}

.preview-category {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--admin-primary);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.preview-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.preview-excerpt {
    color: var(--admin-text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.preview-meta {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 1.5rem;
}

.preview-body {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--admin-text);
}

.preview-body h1,
.preview-body h2,
.preview-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.preview-body h1 {
    font-size: 1.75rem;
}

.preview-body h2 {
    font-size: 1.5rem;
}

.preview-body h3 {
    font-size: 1.25rem;
}

.preview-body p {
    margin-bottom: 1rem;
}

.preview-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
}

.preview-body blockquote {
    border-left: 4px solid var(--admin-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--admin-text-muted);
}

.preview-body blockquote p {
    margin-bottom: 0;
}

.preview-body pre,
.preview-body pre.ql-syntax {
    background: var(--admin-bg) !important;
    color: #e2e8f0 !important;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    border: 1px solid var(--admin-border);
}

.preview-body code {
    background: rgba(99, 102, 241, 0.12);
    color: var(--admin-primary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.preview-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.preview-body hr {
    border: none;
    border-top: 1px solid var(--admin-border);
    margin: 1.5rem 0;
}

.preview-body a {
    color: var(--admin-primary) !important;
    text-decoration: underline;
}

.preview-body strong {
    font-weight: 600;
    color: var(--admin-text);
}

.preview-body ul,
.preview-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.preview-body li {
    margin-bottom: 0.25rem;
}

.preview-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.preview-body th,
.preview-body td {
    border: 1px solid var(--admin-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.preview-body th {
    background: var(--admin-bg);
    font-weight: 600;
}

/* Quill alignment classes */
.preview-body .ql-align-center {
    text-align: center;
}

.preview-body .ql-align-right {
    text-align: right;
}

.preview-body .ql-align-justify {
    text-align: justify;
}

.preview-body .ql-indent-1 {
    padding-left: 3em;
}

.preview-body .ql-indent-2 {
    padding-left: 6em;
}

.preview-body .ql-indent-3 {
    padding-left: 9em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MESSAGE INBOX STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Message Stats */
.msg-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.msg-stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.msg-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.msg-stat-card--unread {
    border-color: rgba(99, 102, 241, 0.3);
}

.msg-stat-icon {
    font-size: 1.75rem;
}

.msg-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.msg-stat-label {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
}

.msg-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Nav Badge */
.nav-badge {
    background: var(--admin-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Inbox Container */
.inbox-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    overflow: hidden;
    height: calc(100vh - 320px);
    min-height: 500px;
}

/* Inbox List */
.inbox-list {
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Search */
.inbox-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
}

.inbox-search__input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--admin-text);
    font-size: 0.9rem;
    outline: none;
}

.inbox-search__input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Filter Tabs */
.inbox-filters {
    display: flex;
    padding: 0.5rem 0.75rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, 0.02);
}

.inbox-filter {
    background: transparent;
    border: none;
    color: var(--admin-text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s;
}

.inbox-filter.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--admin-primary);
}

.inbox-filter:hover:not(.active) {
    color: var(--admin-text);
}

/* Message Items */
.inbox-messages {
    flex: 1;
    overflow-y: auto;
}

.inbox-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    padding: 2rem;
}

.inbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.inbox-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.inbox-item--selected {
    background: rgba(99, 102, 241, 0.08) !important;
    border-left: 3px solid var(--admin-primary);
}

.inbox-item--unread .inbox-item__name {
    font-weight: 700;
    color: var(--admin-text);
}

.inbox-item--unread .inbox-item__preview {
    color: var(--admin-text-muted);
}

/* Star */
.inbox-item__star {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    margin-top: 0.15rem;
    transition: color 0.2s, transform 0.2s;
}

.inbox-item__star:hover {
    transform: scale(1.2);
}

.inbox-item__star--active {
    color: #fbbf24 !important;
}

/* Message Item Body */
.inbox-item__body {
    flex: 1;
    min-width: 0;
}

.inbox-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.inbox-item__name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--admin-text-muted);
}

.inbox-item__time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

.inbox-item__service {
    font-size: 0.75rem;
    color: var(--admin-primary);
    margin-bottom: 0.25rem;
}

.inbox-item__preview {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Unread Dot */
.inbox-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--admin-primary);
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Inbox Detail */
.inbox-detail {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

.inbox-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
    color: var(--admin-text-muted);
}

.inbox-detail-empty svg {
    opacity: 0.3;
}

/* Detail Header */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--admin-border);
}

.detail-header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.detail-name {
    font-size: 1.15rem;
    font-weight: 600;
}

.detail-email {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
}

.detail-date {
    color: var(--admin-text-muted);
    font-size: 0.8rem;
}

/* Detail Meta Cards */
.detail-meta-cards {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 2rem;
}

.detail-meta-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--admin-bg);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    flex: 1;
}

.detail-meta-card svg {
    color: var(--admin-primary);
}

.detail-meta-label {
    display: block;
    font-size: 0.7rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-meta-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Detail Message Content */
.detail-message-content {
    padding: 1.5rem 2rem;
    flex: 1;
}

.detail-section-title {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.detail-message-text {
    line-height: 1.8;
    font-size: 0.95rem;
    white-space: pre-wrap;
    background: var(--admin-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
}

/* Detail Actions */
.detail-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--admin-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE - EXTENDED
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .inbox-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .inbox-list {
        border-right: none;
        border-bottom: 1px solid var(--admin-border);
        max-height: 400px;
    }

    .inbox-detail {
        min-height: 400px;
    }

    .editor-meta-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {

    .post-stats,
    .msg-stats {
        grid-template-columns: 1fr;
    }

    .editor-meta-row {
        grid-template-columns: 1fr;
    }

    .detail-meta-cards {
        flex-direction: column;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .editor-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .editor-header__actions {
        width: 100%;
        justify-content: flex-end;
    }
}