:root {
    --bg-dark: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);

    --purple: #a855f7;
    --blue: #3b82f6;
    --green: #22c55e;
    --orange: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2.5rem;
    font-family: 'Outfit', sans-serif;
}

.logo i {
    color: var(--accent);
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item i {
    width: 20px;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--glass);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--accent);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.details .name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.details .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.search-bar {
    position: relative;
    width: 400px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 1rem;
    color: var(--text-main);
    outline: none;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Fix for Select dropdown visibility */
select.form-control {
    cursor: pointer;
}

select.form-control option {
    background-color: var(--sidebar-bg);
    /* Dark background for options */
    color: var(--text-main);
    padding: 10px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.notifications {
    position: relative;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--orange);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.2rem;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.5rem;
}

.highlight {
    color: var(--accent);
}

.dashboard-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
}

.stat-info .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Content Rows */
.content-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-family: 'Outfit', sans-serif;
}

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.empty-row td {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Account List */
.account-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass);
    padding: 1rem;
    border-radius: 0.75rem;
}

.acc-icon {
    font-size: 1.5rem;
}

.acc-details {
    flex: 1;
}

.acc-email {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.acc-status {
    font-size: 0.75rem;
}

.acc-status.active {
    color: var(--green);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    background: white;
    color: #333;
    padding: 2rem;
    border-radius: 0.5rem;
    line-height: 1.6;
}

.preview-body h1,
.preview-body h2,
.preview-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #000;
}

.preview-body p {
    margin-bottom: 1rem;
}

.preview-body ul,
.preview-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Utilities */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.w-full {
    width: 100%;
}

.text-muted {
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.published {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.status-badge.draft {
    background: rgba(255, 165, 2, 0.2);
    color: #ffa502;
}

/* Dashboard Specific */
.post-title-cell {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-xs.text-muted {
    font-size: 0.75rem;
    color: var(--text-muted);
}