.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-logo i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-close:hover {
    color: var(--text);
    background: rgba(108, 99, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 60%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 0 4px 4px 0;
    transition: width 0.3s ease;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(108, 99, 255, 0.08);
    transform: translateX(4px);
}

.sidebar-link:hover::before {
    width: 4px;
}

.sidebar-link.active {
    color: var(--primary-light);
    background: rgba(108, 99, 255, 0.12);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.1);
}

.sidebar-link.active::before {
    width: 4px;
}

.sidebar-link i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.logout-link {
    color: #ff6b6b !important;
}

.logout-link:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    color: #ff8787 !important;
}

.logout-link::before {
    background: linear-gradient(180deg, #ff6b6b, #ff8787) !important;
}

.admin-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.topbar-toggle:hover {
    background: rgba(108, 99, 255, 0.1);
}

.topbar-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid var(--border);
}

.topbar-user i {
    font-size: 1.3rem;
    color: var(--primary-light);
}

.admin-content {
    flex: 1;
    padding: 32px;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.15);
    border-color: rgba(108, 99, 255, 0.2);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.purple {
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary-light);
}

.stat-icon.teal {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent);
}

.stat-icon.orange {
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
}

.stat-icon.green {
    background: rgba(0, 200, 83, 0.15);
    color: #00c853;
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.admin-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.admin-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff8787;
}

.alert-success {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.2);
    color: #69f0ae;
}

.add-form {
    margin-top: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-row .form-group label i {
    margin-right: 6px;
    color: var(--primary-light);
}

.form-row .form-group input {
    width: 100%;
    background: rgba(15, 15, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-row .form-group input::placeholder {
    color: rgba(154, 154, 176, 0.5);
}

.form-row .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.3);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    color: #ff8787;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

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

.admin-table thead {
    background: rgba(108, 99, 255, 0.08);
}

.admin-table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr {
    transition: background 0.2s;
}

.admin-table tbody tr:hover {
    background: rgba(108, 99, 255, 0.05);
}

.admin-table code {
    background: rgba(108, 99, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary-light);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

.post-form-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.post-form-main,
.post-form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post-form .form-group {
    margin-bottom: 16px;
}

.post-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.post-form .form-group label i {
    margin-right: 6px;
    color: var(--primary-light);
}

.post-form .form-group input,
.post-form .form-group textarea,
.post-form .form-group select {
    width: 100%;
    background: rgba(15, 15, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.post-form .form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239A9AB0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.post-form .form-group input::placeholder,
.post-form .form-group textarea::placeholder {
    color: rgba(154, 154, 176, 0.5);
}

.post-form .form-group input:focus,
.post-form .form-group textarea:focus,
.post-form .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 0;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 16px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.quill-editor {
    background: rgba(15, 15, 26, 0.6);
    border-radius: 0 0 12px 12px;
    min-height: 300px;
}

.quill-editor .ql-editor {
    min-height: 300px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.7;
}

.ql-toolbar.ql-snow {
    border: 1px solid var(--border) !important;
    border-radius: 12px 12px 0 0 !important;
    background: rgba(26, 26, 46, 0.8) !important;
}

.ql-container.ql-snow {
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
}

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

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

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

.ql-snow .ql-picker-options {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}

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

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

.table-thumb {
    width: 60px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
}

.table-thumb-placeholder {
    width: 60px;
    height: 45px;
    border-radius: 8px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary-light);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.published {
    background: rgba(0, 200, 83, 0.12);
    color: #69f0ae;
}

.status-badge.draft {
    background: rgba(255, 165, 0, 0.12);
    color: #ffa500;
}

.btn-edit {
    background: rgba(108, 99, 255, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(108, 99, 255, 0.2);
}

.btn-edit:hover {
    background: rgba(108, 99, 255, 0.2);
}

.btn-view {
    background: rgba(0, 212, 170, 0.12);
    color: var(--accent);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.btn-view:hover {
    background: rgba(0, 212, 170, 0.2);
}

.actions-cell {
    display: flex;
    gap: 6px;
    align-items: center;
}

.thumb-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    min-height: 160px;
}

.thumb-upload-area:hover,
.thumb-upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.05);
}

.thumb-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    gap: 8px;
    min-height: 160px;
}

.thumb-upload-content i {
    font-size: 2.2rem;
    color: var(--primary-light);
}

.thumb-upload-content p {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.thumb-upload-content small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.thumb-file-input {
    display: none !important;
}

.thumb-preview {
    position: relative;
    width: 100%;
    min-height: 160px;
}

.thumb-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.thumb-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 70, 70, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.thumb-remove:hover {
    background: #ff4646;
    transform: scale(1.1);
}

.thumb-url-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.thumb-url-divider::before,
.thumb-url-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.thumb-url-divider span {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .post-form-grid {
        grid-template-columns: 1fr;
    }
}

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

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 36px;
    box-shadow:
        0 12px 40px rgba(108, 99, 255, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.form-group label i {
    margin-right: 6px;
    color: var(--primary-light);
}

.form-group input {
    background: rgba(15, 15, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder {
    color: rgba(154, 154, 176, 0.5);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.login-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn i {
    margin-right: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--primary-light);
}

.login-footer a i {
    margin-right: 6px;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .admin-overlay.active {
        display: block;
    }

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

    .topbar-toggle {
        display: block;
    }

    .admin-topbar {
        padding: 0 16px;
    }

    .admin-content {
        padding: 20px 16px;
    }

    .admin-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
        gap: 14px;
    }

    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 1.1rem;
    }

    .stat-info h3 {
        font-size: 1.4rem;
    }

    .login-card {
        padding: 36px 24px;
    }
}
