:root {
    --mafp-bg: #f8fafc;
    --mafp-sidebar-bg: #ffffff;
    --mafp-text: #334155;
    --mafp-text-muted: #64748b;
    --mafp-primary: #3b82f6;
    --mafp-primary-hover: #2563eb;
    --mafp-danger: #ef4444;
    --mafp-success: #22c55e;
    --mafp-border: #e2e8f0;
    --mafp-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --mafp-radius: 12px;
    --mafp-font: 'Inter', system-ui, -apple-system, sans-serif;
}

.mafp-dashboard {
    display: flex;
    min-height: 600px;
    background: var(--mafp-bg);
    font-family: var(--mafp-font);
    color: var(--mafp-text);
    border-radius: var(--mafp-radius);
    overflow: hidden;
    box-shadow: var(--mafp-shadow);
    border: 1px solid var(--mafp-border);
}

/* Sidebar */
.mafp-sidebar {
    width: 260px;
    background: var(--mafp-sidebar-bg);
    border-right: 1px solid var(--mafp-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.mafp-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mafp-text);
    margin-bottom: 2rem;
}

.mafp-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.mafp-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--mafp-text-muted);
    cursor: pointer;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s;
}

.mafp-nav-item:hover {
    background: #f1f5f9;
    color: var(--mafp-text);
}

.mafp-nav-item.active {
    background: #eff6ff;
    color: var(--mafp-primary);
}

.mafp-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--mafp-border);
}

.mafp-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.mafp-user-details {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
}

.mafp-username { font-weight: 600; }
.mafp-role { font-size: 0.75rem; color: var(--mafp-text-muted); }

/* Content */
.mafp-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.mafp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.mafp-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.mafp-mobile-toggle { display: none; }

/* Views */
.mafp-view { display: none; animation: fadeIn 0.3s ease; }
.mafp-view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Toolbar */
.mafp-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.mafp-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--mafp-border);
    background-color: white;
    font-family: inherit;
    cursor: pointer;
}

/* Table */
.mafp-table-wrapper {
    background: white;
    border-radius: var(--mafp-radius);
    border: 1px solid var(--mafp-border);
    overflow: hidden;
}

.mafp-table {
    width: 100%;
    border-collapse: collapse;
}

.mafp-table th, .mafp-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--mafp-border);
}

.mafp-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--mafp-text-muted);
}

.mafp-table tr:last-child td { border-bottom: none; }
.mafp-table tr:hover { background: #f8fafc; }

/* Badges */
.mafp-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.mafp-badge-publish { background: #dcfce7; color: #166534; }
.mafp-badge-pending { background: #fef9c3; color: #854d0e; }
.mafp-badge-draft { background: #f1f5f9; color: #475569; }

/* Buttons */
.mafp-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.mafp-btn-sm { padding: 0.25rem 0.5rem; font-size: 0.875rem; }

.mafp-btn-primary { background: var(--mafp-primary); color: white; }
.mafp-btn-primary:hover { background: var(--mafp-primary-hover); }

.mafp-btn-secondary { background: white; border-color: var(--mafp-border); color: var(--mafp-text); }
.mafp-btn-secondary:hover { background: #f8fafc; }

.mafp-btn-outline { background: transparent; border-color: var(--mafp-primary); color: var(--mafp-primary); }
.mafp-btn-outline:hover { background: #eff6ff; }

.mafp-btn-danger-text { background: transparent; color: var(--mafp-danger); }
.mafp-btn-danger-text:hover { background: #fef2f2; }

/* Form */
.mafp-form-card {
    background: white;
    padding: 2rem;
    border-radius: var(--mafp-radius);
    border: 1px solid var(--mafp-border);
}

.mafp-form-group { margin-bottom: 1.5rem; }
.mafp-form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }

.mafp-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--mafp-border);
    font-family: inherit;
    transition: border-color 0.2s;
}
.mafp-input:focus { outline: none; border-color: var(--mafp-primary); box-shadow: 0 0 0 3px #eff6ff; }

.mafp-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mafp-border);
}

.mafp-action-right { display: flex; gap: 0.75rem; }

/* Toast */
#mafp-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mafp-toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border-left: 4px solid var(--mafp-primary);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mafp-toast.success { border-color: var(--mafp-success); }
.mafp-toast.error { border-color: var(--mafp-danger); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Mobile */
@media (max-width: 768px) {
    .mafp-dashboard { flex-direction: column; min-height: auto; }
    .mafp-sidebar { display: none; width: 100%; }
    .mafp-sidebar.active { display: flex; }
    .mafp-mobile-toggle { display: block; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
    .mafp-content { padding: 1rem; }
    .mafp-form-actions { flex-direction: column; gap: 1rem; }
    .mafp-action-right { width: 100%; flex-direction: column; }
    .mafp-btn { width: 100%; }
}
